summaryrefslogtreecommitdiff
path: root/net/batman-adv/vis.c
diff options
context:
space:
mode:
authorSven Eckelmann <sven@narfation.org>2012-07-08 18:33:51 +0200
committerAntonio Quartulli <ordex@autistici.org>2012-08-23 14:20:21 +0200
commitc67893d17a6bbd16328a1ee38ab0cb460511014a (patch)
tree4bf7c241b31200f0dfb2c0c41b2852b47d42921f /net/batman-adv/vis.c
parentbbb1f90efba89b31fc5e329d5fcaf10aca99212b (diff)
downloadlwn-c67893d17a6bbd16328a1ee38ab0cb460511014a.tar.gz
lwn-c67893d17a6bbd16328a1ee38ab0cb460511014a.zip
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/vis.c')
-rw-r--r--net/batman-adv/vis.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/net/batman-adv/vis.c b/net/batman-adv/vis.c
index 55cc51bcc110..5abd1454fb07 100644
--- a/net/batman-adv/vis.c
+++ b/net/batman-adv/vis.c
@@ -578,6 +578,7 @@ static int batadv_generate_vis_packet(struct batadv_priv *bat_priv)
struct batadv_vis_packet *packet;
struct batadv_vis_info_entry *entry;
struct batadv_tt_common_entry *tt_common_entry;
+ uint8_t *packet_pos;
int best_tq = -1;
uint32_t i;
@@ -618,8 +619,8 @@ static int batadv_generate_vis_packet(struct batadv_priv *bat_priv)
goto next;
/* fill one entry into buffer. */
- entry = (struct batadv_vis_info_entry *)
- skb_put(info->skb_packet, sizeof(*entry));
+ packet_pos = skb_put(info->skb_packet, sizeof(*entry));
+ entry = (struct batadv_vis_info_entry *)packet_pos;
memcpy(entry->src,
router->if_incoming->net_dev->dev_addr,
ETH_ALEN);
@@ -644,9 +645,8 @@ next:
rcu_read_lock();
hlist_for_each_entry_rcu(tt_common_entry, node, head,
hash_entry) {
- entry = (struct batadv_vis_info_entry *)
- skb_put(info->skb_packet,
- sizeof(*entry));
+ packet_pos = skb_put(info->skb_packet, sizeof(*entry));
+ entry = (struct batadv_vis_info_entry *)packet_pos;
memset(entry->src, 0, ETH_ALEN);
memcpy(entry->dest, tt_common_entry->addr, ETH_ALEN);
entry->quality = 0; /* 0 means TT */