Skip to content

Commit

Permalink
net_sched: sfq: put sfq_unlink in a do - while loop
Browse files Browse the repository at this point in the history
Macros with multiple statements should be enclosed in a do - while loop

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Yang Yingliang authored and David S. Miller committed Dec 11, 2013
1 parent 833fa74 commit fa08943
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions net/sched/sch_sfq.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,12 @@ static inline void sfq_link(struct sfq_sched_data *q, sfq_index x)
}

#define sfq_unlink(q, x, n, p) \
n = q->slots[x].dep.next; \
p = q->slots[x].dep.prev; \
sfq_dep_head(q, p)->next = n; \
sfq_dep_head(q, n)->prev = p
do { \
n = q->slots[x].dep.next; \
p = q->slots[x].dep.prev; \
sfq_dep_head(q, p)->next = n; \
sfq_dep_head(q, n)->prev = p; \
} while (0)


static inline void sfq_dec(struct sfq_sched_data *q, sfq_index x)
Expand Down

0 comments on commit fa08943

Please sign in to comment.