Skip to contentSkip to conversation

batman-adv: Use chain pointer when purging fragments

PATCH Applied Sven Eckelmann 3 participants 5 messages Aug 26, 2015 – Sep 6, 2015 Batman advanced

lore
Share & tools
lore

Sven Eckelmann

author maintainer
#0 lore raw

PATCH 1/2 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.

---
 net/batman-adv/fragmentation.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
net/batman-adv/fragmentation.c +4 -4
index 700c96c82a15..20d9282f895b 100644
@@ -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);
 	}
 }
 
Signature · 1 line
2.5.0
author maintainer
#1 lore raw

PATCH 2/2 batman-adv: Fix typo 'wether' -> 'whether'

---
 net/batman-adv/main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
net/batman-adv/main.c +2 -2
index 45952dcb0b68..5dbcb2e2b497 100644
@@ -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
Signature · 1 line
2.5.0
#2 lore raw

Re: [B.A.T.M.A.N.] [PATCH 2/2] batman-adv: Fix typo 'wether' -> 'whether'

Quoted 4 lines · On Wednesday, August 26, 2015 10:31:51 Sven Eckelmann wrote:
---
 net/batman-adv/main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Applied in revision e72ce42.

Thanks,
Marek

Acked-by on v1 1/2
#3 lore raw
In reply to Sven Eckelmann
Quoted 6 lines · Sven Eckelmann

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.

Quoted 28 lines
---
  net/batman-adv/fragmentation.c | 8 ++++----
  1 file changed, 4 insertions(+), 4 deletions(-)
net/batman-adv/fragmentation.c +4 -4
index 700c96c82a15..20d9282f895b 100644
@@ -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);
  	}
  }
 
Signature · 7 lines
Kind Regards,
Martin Hundebøll
Frederiks Allé 99A, 1.th
8000 Aarhus C

+45 61 65 54 61
[email protected]
#4 lore raw
In reply to Sven Eckelmann
Quoted 9 lines · 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.

---
 net/batman-adv/fragmentation.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Applied in revision d54f7c8.

Cheers,
Marek