Commit 58d78b32 authored by Ying Xue's avatar Ying Xue Committed by David S. Miller

tipc: use skb_queue_walk_safe marco to simplify link_prepare_wakeup routine

Signed-off-by: default avatarYing Xue <ying.xue@windriver.com>
Reviewed-by: default avatarJon Maloy <jon.maloy@ericsson.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 99315ad4
......@@ -367,15 +367,15 @@ static bool link_schedule_user(struct tipc_link *link, u32 oport,
*/
static void link_prepare_wakeup(struct tipc_link *link)
{
struct sk_buff_head *wq = &link->waiting_sks;
struct sk_buff *buf;
uint pend_qsz = link->out_queue_size;
struct sk_buff *skb, *tmp;
for (buf = skb_peek(wq); buf; buf = skb_peek(wq)) {
if (pend_qsz >= link->queue_limit[TIPC_SKB_CB(buf)->chain_imp])
skb_queue_walk_safe(&link->waiting_sks, skb, tmp) {
if (pend_qsz >= link->queue_limit[TIPC_SKB_CB(skb)->chain_imp])
break;
pend_qsz += TIPC_SKB_CB(buf)->chain_sz;
__skb_queue_tail(&link->owner->waiting_sks, __skb_dequeue(wq));
pend_qsz += TIPC_SKB_CB(skb)->chain_sz;
__skb_unlink(skb, &link->waiting_sks);
__skb_queue_tail(&link->owner->waiting_sks, skb);
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment