b.a.t.m.a.n.lists.open-mesh.org archive mirror
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: Use chain pointer when purging fragments
@ 2015-08-26  8:31 Sven Eckelmann
  2015-08-26  8:31 ` [B.A.T.M.A.N.] [PATCH 2/2] batman-adv: Fix typo 'wether' -> 'whether' Sven Eckelmann
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Sven Eckelmann @ 2015-08-26  8:31 UTC (permalink / raw)
  To: b.a.t.m.a.n

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>
---
 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);
 	}
 }
 
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [B.A.T.M.A.N.] [PATCH 2/2] batman-adv: Fix typo 'wether' -> 'whether'
  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 ` Sven Eckelmann
  2015-09-06  8:37   ` Marek Lindner
  2015-08-26 18:25 ` [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: Use chain pointer when purging fragments Martin Hundebøll
  2015-09-06  8:36 ` Marek Lindner
  2 siblings, 1 reply; 5+ messages in thread
From: Sven Eckelmann @ 2015-08-26  8:31 UTC (permalink / raw)
  To: b.a.t.m.a.n

Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
 net/batman-adv/main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/batman-adv/main.c b/net/batman-adv/main.c
index 45952dcb0b68..5dbcb2e2b497 100644
--- a/net/batman-adv/main.c
+++ b/net/batman-adv/main.c
@@ -908,7 +908,7 @@ end:
  *  appropriate handlers
  * @bat_priv: the bat priv with all the soft interface information
  * @tvlv_handler: tvlv callback function handling the tvlv content
- * @ogm_source: flag indicating wether the tvlv is an ogm or a unicast packet
+ * @ogm_source: flag indicating whether the tvlv is an ogm or a unicast packet
  * @orig_node: orig node emitting the ogm packet
  * @src: source mac address of the unicast packet
  * @dst: destination mac address of the unicast packet
@@ -961,7 +961,7 @@ static int batadv_tvlv_call_handler(struct batadv_priv *bat_priv,
  * batadv_tvlv_containers_process - parse the given tvlv buffer to call the
  *  appropriate handlers
  * @bat_priv: the bat priv with all the soft interface information
- * @ogm_source: flag indicating wether the tvlv is an ogm or a unicast packet
+ * @ogm_source: flag indicating whether the tvlv is an ogm or a unicast packet
  * @orig_node: orig node emitting the ogm packet
  * @src: source mac address of the unicast packet
  * @dst: destination mac address of the unicast packet
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: Use chain pointer when purging fragments
  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-08-26 18:25 ` Martin Hundebøll
  2015-09-06  8:36 ` Marek Lindner
  2 siblings, 0 replies; 5+ messages in thread
From: Martin Hundebøll @ 2015-08-26 18:25 UTC (permalink / raw)
  To: The list for a Better Approach To Mobile Ad-hoc Networking

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: Use chain pointer when purging fragments
  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-08-26 18:25 ` [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: Use chain pointer when purging fragments Martin Hundebøll
@ 2015-09-06  8:36 ` Marek Lindner
  2 siblings, 0 replies; 5+ messages in thread
From: Marek Lindner @ 2015-09-06  8:36 UTC (permalink / raw)
  To: b.a.t.m.a.n

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

On Wednesday, August 26, 2015 10:31:50 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>
> ---
>  net/batman-adv/fragmentation.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)

Applied in revision d54f7c8.

Cheers,
Marek

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [B.A.T.M.A.N.] [PATCH 2/2] batman-adv: Fix typo 'wether' -> 'whether'
  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
  0 siblings, 0 replies; 5+ messages in thread
From: Marek Lindner @ 2015-09-06  8:37 UTC (permalink / raw)
  To: b.a.t.m.a.n

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

On Wednesday, August 26, 2015 10:31:51 Sven Eckelmann wrote:
> Signed-off-by: Sven Eckelmann <sven@narfation.org>
> ---
>  net/batman-adv/main.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Applied in revision e72ce42.

Thanks,
Marek

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-09-06  8:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: Use chain pointer when purging fragments Martin Hundebøll
2015-09-06  8:36 ` Marek Lindner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).