public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
From: "Martin Hundebøll" <martin@hundeboll.net>
To: The list for a Better Approach To Mobile Ad-hoc Networking
	<b.a.t.m.a.n@lists.open-mesh.org>
Cc: Antonio Quartulli <antonio@meshcoding.com>
Subject: Re: [B.A.T.M.A.N.] [PATCH next 10/11] batman-adv: fix more code style
Date: Mon, 17 Mar 2014 09:19:41 -0700	[thread overview]
Message-ID: <5327209D.2060707@hundeboll.net> (raw)
In-Reply-To: <1395062574-28291-10-git-send-email-antonio@meshcoding.com>

[-- Attachment #1: Type: text/plain, Size: 2131 bytes --]

On 2014-03-17 06:22, Antonio Quartulli wrote:
> - keep variable declarations in ascendant line length order
> - use common iteration style pattern when looking up an
>   object

Do you mean descending line length?

// Martin

> Introduced by 86cb16e5ec1e2d75821006e8f4abbec66fb741ac
> ("batman-adv: Add IPv4 link-local/IPv6-ll-all-nodes multicast support")
> 
> Cc: Linux Lüssing <linus.luessing@web.de>
> Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
> ---
>  multicast.c | 20 ++++++++++----------
>  1 file changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/multicast.c b/multicast.c
> index 5a39fc1..166d0a3 100644
> --- a/multicast.c
> +++ b/multicast.c
> @@ -493,20 +493,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;
>  }
>  
> @@ -524,9 +524,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)
> 


-- 
Kind Regards
Martin Hundebøll
Frederiks Allé 99, 1.th
8000 Aarhus C
Denmark

+45 61 65 54 61
martin@hundeboll.net


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 901 bytes --]

  reply	other threads:[~2014-03-17 16:19 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-17 13:22 [B.A.T.M.A.N.] [PATCH next 01/11] batman-adv: remove useless goto Antonio Quartulli
2014-03-17 13:22 ` [B.A.T.M.A.N.] [PATCH next 02/11] batman-adv: don't mess up with the netdev refcounting if not needed Antonio Quartulli
2014-03-17 13:22 ` [B.A.T.M.A.N.] [PATCH next 03/11] batman-adv: fix multicast kerneldoc Antonio Quartulli
2014-03-17 16:13   ` Martin Hundebøll
2014-03-17 16:32     ` Antonio Quartulli
2014-03-17 13:22 ` [B.A.T.M.A.N.] [PATCH next 04/11] " Antonio Quartulli
2014-03-17 13:22 ` [B.A.T.M.A.N.] [PATCH next 05/11] " Antonio Quartulli
2014-03-17 13:22 ` [B.A.T.M.A.N.] [PATCH next 06/11] " Antonio Quartulli
2014-03-17 13:22 ` [B.A.T.M.A.N.] [PATCH next 07/11] " Antonio Quartulli
2014-03-17 13:22 ` [B.A.T.M.A.N.] [PATCH next 08/11] batman-adv: adjust copyright disclaimer in multicast files Antonio Quartulli
2014-03-17 13:22 ` [B.A.T.M.A.N.] [PATCH next 09/11] batman-adv: fix code style Antonio Quartulli
2014-03-17 13:22 ` [B.A.T.M.A.N.] [PATCH next 10/11] batman-adv: fix more " Antonio Quartulli
2014-03-17 16:19   ` Martin Hundebøll [this message]
2014-03-17 16:33     ` Antonio Quartulli
2014-03-17 13:22 ` [B.A.T.M.A.N.] [PATCH next 11/11] " Antonio Quartulli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5327209D.2060707@hundeboll.net \
    --to=martin@hundeboll.net \
    --cc=antonio@meshcoding.com \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox