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>
Subject: Re: [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: Use chain pointer when purging fragments
Date: Wed, 26 Aug 2015 20:25:28 +0200	[thread overview]
Message-ID: <55DE0498.3010806@hundeboll.net> (raw)
In-Reply-To: <1440577911-16107-1-git-send-email-sven@narfation.org>

On 2015-08-26 10:31, Sven Eckelmann wrote:
> 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: Sven Eckelmann <sven@narfation.org>

Acked-by: Martin Hundebøll <martin@hundeboll.net>

> ---
>   net/batman-adv/fragmentation.c | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/net/batman-adv/fragmentation.c b/net/batman-adv/fragmentation.c
> index 700c96c82a15..20d9282f895b 100644
> --- a/net/batman-adv/fragmentation.c
> +++ b/net/batman-adv/fragmentation.c
> @@ -71,14 +71,14 @@ void batadv_frag_purge_orig(struct batadv_orig_node *orig_node,
>
>   	for (i = 0; i < BATADV_FRAG_BUFFER_COUNT; 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)) {
> -			batadv_frag_clear_chain(&orig_node->fragments[i].head);
> -			orig_node->fragments[i].size = 0;
> +			batadv_frag_clear_chain(&chain->head);
> +			chain->size = 0;
>   		}
>
> -		spin_unlock_bh(&orig_node->fragments[i].lock);
> +		spin_unlock_bh(&chain->lock);
>   	}
>   }
>
>

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

+45 61 65 54 61
martin@hundeboll.net

  parent reply	other threads:[~2015-08-26 18:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-26  8:31 [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: Use chain pointer when purging fragments Sven Eckelmann
2015-08-26  8:31 ` [B.A.T.M.A.N.] [PATCH 2/2] batman-adv: Fix typo 'wether' -> 'whether' Sven Eckelmann
2015-09-06  8:37   ` Marek Lindner
2015-08-26 18:25 ` Martin Hundebøll [this message]
2015-09-06  8:36 ` [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: Use chain pointer when purging fragments Marek Lindner

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=55DE0498.3010806@hundeboll.net \
    --to=martin@hundeboll.net \
    --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