Messages in this thread Patch in this message | | | From | Geliang Tang <> | Subject | [PATCH 12/14] net: sched: use list_for_each_entry | Date | Fri, 18 Dec 2015 23:33:36 +0800 |
| |
Use list_for_each_entry() instead of list_for_each() to simplify the code.
Signed-off-by: Geliang Tang <geliangtang@163.com> --- net/sched/sch_htb.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c index 15ccd7f..5f7aa74 100644 --- a/net/sched/sch_htb.c +++ b/net/sched/sch_htb.c @@ -948,10 +948,9 @@ static unsigned int htb_drop(struct Qdisc *sch) int prio; for (prio = TC_HTB_NUMPRIO - 1; prio >= 0; prio--) { - struct list_head *p; - list_for_each(p, q->drops + prio) { - struct htb_class *cl = list_entry(p, struct htb_class, - un.leaf.drop_list); + struct htb_class *cl; + + list_for_each_entry(cl, q->drops + prio, un.leaf.drop_list) { unsigned int len; if (cl->un.leaf.q->ops->drop && (len = cl->un.leaf.q->ops->drop(cl->un.leaf.q))) { -- 2.5.0
| |