From: Tonghao Zhang Date: Thu, 13 Dec 2018 08:43:23 +0000 (-0800) Subject: net: sched: simplify the qdisc_leaf code X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=2561f97267d656c9b2c62b32614870abb3eabfe6;p=linux.git net: sched: simplify the qdisc_leaf code Except for returning, the var leaf is not used in the qdisc_leaf(). For simplicity, remove it. Signed-off-by: Tonghao Zhang Acked-by: Cong Wang Signed-off-by: David S. Miller --- diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c index 9c88cec7e8a20..187a57e7d601d 100644 --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c @@ -335,7 +335,6 @@ out: static struct Qdisc *qdisc_leaf(struct Qdisc *p, u32 classid) { unsigned long cl; - struct Qdisc *leaf; const struct Qdisc_class_ops *cops = p->ops->cl_ops; if (cops == NULL) @@ -344,8 +343,7 @@ static struct Qdisc *qdisc_leaf(struct Qdisc *p, u32 classid) if (cl == 0) return NULL; - leaf = cops->leaf(p, cl); - return leaf; + return cops->leaf(p, cl); } /* Find queueing discipline by name */