Repository : ssh://git@open-mesh.org/batman-adv
On branch : next
>---------------------------------------------------------------
commit 45dab5f5509023946793fc9d1d0566c12ca8bb52
Author: Antonio Quartulli <antonio(a)meshcoding.com>
Date: Wed Mar 19 18:57:34 2014 +0100
batman-adv: fix more code style
- keep variable declarations in descending line length order
- use common iteration style pattern when looking up an
object
Introduced by 86cb16e5ec1e2d75821006e8f4abbec66fb741ac
("batman-adv: Add IPv4 link-local/IPv6-ll-all-nodes multicast support")
Cc: Linux Lüssing <linus.luessing(a)web.de>
Signed-off-by: Antonio Quartulli <antonio(a)meshcoding.com>
Signed-off-by: Marek Lindner <mareklindner(a)neomailbox.ch>
>---------------------------------------------------------------
45dab5f5509023946793fc9d1d0566c12ca8bb52
multicast.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/multicast.c b/multicast.c
index d67d75d..dfe4cd6 100644
--- a/multicast.c
+++ b/multicast.c
@@ -487,20 +487,20 @@ batadv_mcast_forw_ip_node_get(struct batadv_priv *bat_priv,
static struct batadv_orig_node *
batadv_mcast_forw_unsnoop_node_get(struct batadv_priv *bat_priv)
{
- struct batadv_orig_node *orig_node;
+ struct batadv_orig_node *tmp_orig_node, *orig_node = NULL;
rcu_read_lock();
- hlist_for_each_entry_rcu(orig_node,
+ hlist_for_each_entry_rcu(tmp_orig_node,
&bat_priv->mcast.want_all_unsnoopables_list,
mcast_want_all_unsnoopables_node) {
- if (atomic_inc_not_zero(&orig_node->refcount))
- goto unlock;
- }
-
- orig_node = NULL;
+ if (!atomic_inc_not_zero(&orig_node->refcount))
+ continue;
-unlock:
+ orig_node = tmp_orig_node;
+ break;
+ }
rcu_read_unlock();
+
return orig_node;
}
@@ -518,9 +518,9 @@ enum batadv_forw_mode
batadv_mcast_forw_mode(struct batadv_priv *bat_priv, struct sk_buff *skb,
struct batadv_orig_node **orig)
{
- struct ethhdr *ethhdr;
- bool is_unsnoopable = false;
int ret, tt_count, ip_count, unsnoop_count, total_count;
+ bool is_unsnoopable = false;
+ struct ethhdr *ethhdr;
ret = batadv_mcast_forw_mode_check(bat_priv, skb, &is_unsnoopable);
if (ret == -ENOMEM)