Commit 01f6b5c7 authored by Sven Eckelmann's avatar Sven Eckelmann Committed by Antonio Quartulli

batman-adv: Use chain pointer when purging fragments

The chain pointer was already created in batadv_frag_purge_orig to make the
checks more readable. Just use the chain pointer everywhere instead of
having the same dereference + array access in the most lines of this
function.
Signed-off-by: default avatarSven Eckelmann <sven@narfation.org>
Acked-by: default avatarMartin Hundebøll <martin@hundeboll.net>
Signed-off-by: default avatarMarek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: default avatarAntonio Quartulli <antonio@meshcoding.com>
parent ad7e2c46
...@@ -71,14 +71,14 @@ void batadv_frag_purge_orig(struct batadv_orig_node *orig_node, ...@@ -71,14 +71,14 @@ void batadv_frag_purge_orig(struct batadv_orig_node *orig_node,
for (i = 0; i < BATADV_FRAG_BUFFER_COUNT; i++) { for (i = 0; i < BATADV_FRAG_BUFFER_COUNT; i++) {
chain = &orig_node->fragments[i]; chain = &orig_node->fragments[i];
spin_lock_bh(&orig_node->fragments[i].lock); spin_lock_bh(&chain->lock);
if (!check_cb || check_cb(chain)) { if (!check_cb || check_cb(chain)) {
batadv_frag_clear_chain(&orig_node->fragments[i].head); batadv_frag_clear_chain(&chain->head);
orig_node->fragments[i].size = 0; chain->size = 0;
} }
spin_unlock_bh(&orig_node->fragments[i].lock); spin_unlock_bh(&chain->lock);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment