diff options
author | Sven Eckelmann <sven@narfation.org> | 2012-07-08 12:33:51 -0400 |
---|---|---|
committer | Antonio Quartulli <ordex@autistici.org> | 2012-08-23 08:20:21 -0400 |
commit | c67893d17a6bbd16328a1ee38ab0cb460511014a (patch) | |
tree | 4bf7c241b31200f0dfb2c0c41b2852b47d42921f /net/batman-adv/translation-table.c | |
parent | bbb1f90efba89b31fc5e329d5fcaf10aca99212b (diff) |
batman-adv: Reduce accumulated length of simple statements
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Diffstat (limited to 'net/batman-adv/translation-table.c')
-rw-r--r-- | net/batman-adv/translation-table.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c index b01049a7a912..cb429d181f4d 100644 --- a/net/batman-adv/translation-table.c +++ b/net/batman-adv/translation-table.c | |||
@@ -1559,6 +1559,7 @@ batadv_send_other_tt_response(struct batadv_priv *bat_priv, | |||
1559 | uint16_t tt_len, tt_tot; | 1559 | uint16_t tt_len, tt_tot; |
1560 | struct sk_buff *skb = NULL; | 1560 | struct sk_buff *skb = NULL; |
1561 | struct batadv_tt_query_packet *tt_response; | 1561 | struct batadv_tt_query_packet *tt_response; |
1562 | uint8_t *packet_pos; | ||
1562 | size_t len; | 1563 | size_t len; |
1563 | 1564 | ||
1564 | batadv_dbg(BATADV_DBG_TT, bat_priv, | 1565 | batadv_dbg(BATADV_DBG_TT, bat_priv, |
@@ -1612,8 +1613,8 @@ batadv_send_other_tt_response(struct batadv_priv *bat_priv, | |||
1612 | goto unlock; | 1613 | goto unlock; |
1613 | 1614 | ||
1614 | skb_reserve(skb, ETH_HLEN); | 1615 | skb_reserve(skb, ETH_HLEN); |
1615 | tt_response = (struct batadv_tt_query_packet *)skb_put(skb, | 1616 | packet_pos = skb_put(skb, len); |
1616 | len); | 1617 | tt_response = (struct batadv_tt_query_packet *)packet_pos; |
1617 | tt_response->ttvn = req_ttvn; | 1618 | tt_response->ttvn = req_ttvn; |
1618 | tt_response->tt_data = htons(tt_tot); | 1619 | tt_response->tt_data = htons(tt_tot); |
1619 | 1620 | ||
@@ -1692,6 +1693,7 @@ batadv_send_my_tt_response(struct batadv_priv *bat_priv, | |||
1692 | uint16_t tt_len, tt_tot; | 1693 | uint16_t tt_len, tt_tot; |
1693 | struct sk_buff *skb = NULL; | 1694 | struct sk_buff *skb = NULL; |
1694 | struct batadv_tt_query_packet *tt_response; | 1695 | struct batadv_tt_query_packet *tt_response; |
1696 | uint8_t *packet_pos; | ||
1695 | size_t len; | 1697 | size_t len; |
1696 | 1698 | ||
1697 | batadv_dbg(BATADV_DBG_TT, bat_priv, | 1699 | batadv_dbg(BATADV_DBG_TT, bat_priv, |
@@ -1738,8 +1740,8 @@ batadv_send_my_tt_response(struct batadv_priv *bat_priv, | |||
1738 | goto unlock; | 1740 | goto unlock; |
1739 | 1741 | ||
1740 | skb_reserve(skb, ETH_HLEN); | 1742 | skb_reserve(skb, ETH_HLEN); |
1741 | tt_response = (struct batadv_tt_query_packet *)skb_put(skb, | 1743 | packet_pos = skb_put(skb, len); |
1742 | len); | 1744 | tt_response = (struct batadv_tt_query_packet *)packet_pos; |
1743 | tt_response->ttvn = req_ttvn; | 1745 | tt_response->ttvn = req_ttvn; |
1744 | tt_response->tt_data = htons(tt_tot); | 1746 | tt_response->tt_data = htons(tt_tot); |
1745 | 1747 | ||