diff options
| author | Ying Xue <ying.xue@windriver.com> | 2014-11-25 22:41:51 -0500 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2014-11-26 12:30:17 -0500 |
| commit | 58d78b328a70f4b5ed1c00010499aaedb715ea5b (patch) | |
| tree | ca705d8ce251dfac67400253c07e16647e89282e /net/tipc | |
| parent | 99315ad43d92a8df0e4a30a0694336cdcdb7965f (diff) | |
tipc: use skb_queue_walk_safe marco to simplify link_prepare_wakeup routine
Signed-off-by: Ying Xue <ying.xue@windriver.com>
Reviewed-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc')
| -rw-r--r-- | net/tipc/link.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/net/tipc/link.c b/net/tipc/link.c index 8eb885eb1433..ddee498e74bc 100644 --- a/net/tipc/link.c +++ b/net/tipc/link.c | |||
| @@ -367,15 +367,15 @@ static bool link_schedule_user(struct tipc_link *link, u32 oport, | |||
| 367 | */ | 367 | */ |
| 368 | static void link_prepare_wakeup(struct tipc_link *link) | 368 | static void link_prepare_wakeup(struct tipc_link *link) |
| 369 | { | 369 | { |
| 370 | struct sk_buff_head *wq = &link->waiting_sks; | ||
| 371 | struct sk_buff *buf; | ||
| 372 | uint pend_qsz = link->out_queue_size; | 370 | uint pend_qsz = link->out_queue_size; |
| 371 | struct sk_buff *skb, *tmp; | ||
| 373 | 372 | ||
| 374 | for (buf = skb_peek(wq); buf; buf = skb_peek(wq)) { | 373 | skb_queue_walk_safe(&link->waiting_sks, skb, tmp) { |
| 375 | if (pend_qsz >= link->queue_limit[TIPC_SKB_CB(buf)->chain_imp]) | 374 | if (pend_qsz >= link->queue_limit[TIPC_SKB_CB(skb)->chain_imp]) |
| 376 | break; | 375 | break; |
| 377 | pend_qsz += TIPC_SKB_CB(buf)->chain_sz; | 376 | pend_qsz += TIPC_SKB_CB(skb)->chain_sz; |
| 378 | __skb_queue_tail(&link->owner->waiting_sks, __skb_dequeue(wq)); | 377 | __skb_unlink(skb, &link->waiting_sks); |
| 378 | __skb_queue_tail(&link->owner->waiting_sks, skb); | ||
| 379 | } | 379 | } |
| 380 | } | 380 | } |
| 381 | 381 | ||
