Skip to content

Commit

Permalink
net: sched: simplify the qdisc_leaf code
Browse files Browse the repository at this point in the history
Except for returning, the var leaf is not
used in the qdisc_leaf(). For simplicity, remove it.

Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
Acked-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Tonghao Zhang authored and David S. Miller committed Dec 15, 2018
1 parent c2027d1 commit 2561f97
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions net/sched/sch_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,6 @@ struct Qdisc *qdisc_lookup_rcu(struct net_device *dev, u32 handle)
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)
Expand All @@ -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 */
Expand Down

0 comments on commit 2561f97

Please sign in to comment.