mac80211: use skb_queue_walk() in mesh_path_assign_nexthop

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Sat Sep 29 10:59:40 EDT 2012


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=b22bd5221cfe80ee3d345d9deccfd29edf9bafb4
Commit:     b22bd5221cfe80ee3d345d9deccfd29edf9bafb4
Parent:     aa7a00809cf6afe3cd6f5af2889110b47b798667
Author:     Thomas Pedersen <thomas at cozybit.com>
AuthorDate: Thu Aug 9 18:15:39 2012 -0700
Committer:  Johannes Berg <johannes.berg at intel.com>
CommitDate: Mon Aug 20 13:25:05 2012 +0200

    mac80211: use skb_queue_walk() in mesh_path_assign_nexthop
    
    Since all we really want is just to iterate over all skbs, do just that
    and avoid (de)queueing to a clusmy tmpq.
    
    Signed-off-by: Thomas Pedersen <thomas at cozybit.com>
    Signed-off-by: Johannes Berg <johannes.berg at intel.com>
---
 net/mac80211/mesh_pathtbl.c |    8 +-------
 1 files changed, 1 insertions(+), 7 deletions(-)

diff --git a/net/mac80211/mesh_pathtbl.c b/net/mac80211/mesh_pathtbl.c
index bec7b28..b819d6b 100644
--- a/net/mac80211/mesh_pathtbl.c
+++ b/net/mac80211/mesh_pathtbl.c
@@ -203,23 +203,17 @@ void mesh_path_assign_nexthop(struct mesh_path *mpath, struct sta_info *sta)
 {
 	struct sk_buff *skb;
 	struct ieee80211_hdr *hdr;
-	struct sk_buff_head tmpq;
 	unsigned long flags;
 
 	rcu_assign_pointer(mpath->next_hop, sta);
 
-	__skb_queue_head_init(&tmpq);
-
 	spin_lock_irqsave(&mpath->frame_queue.lock, flags);
-
-	while ((skb = __skb_dequeue(&mpath->frame_queue)) != NULL) {
+	skb_queue_walk(&mpath->frame_queue, skb) {
 		hdr = (struct ieee80211_hdr *) skb->data;
 		memcpy(hdr->addr1, sta->sta.addr, ETH_ALEN);
 		memcpy(hdr->addr2, mpath->sdata->vif.addr, ETH_ALEN);
-		__skb_queue_tail(&tmpq, skb);
 	}
 
-	skb_queue_splice(&tmpq, &mpath->frame_queue);
 	spin_unlock_irqrestore(&mpath->frame_queue.lock, flags);
 }
 



More information about the linux-mtd-cvs mailing list