[PATCH] net: sched: simplify the qdisc_leaf code

Subsystems: networking [general], tc subsystem, the rest

STALE2817d

3 messages, 3 authors, 2018-12-15 · open the first message on its own page

[PATCH] net: sched: simplify the qdisc_leaf code

From: <hidden>
Date: 2018-12-13 08:43:34

From: Tonghao Zhang <redacted>

Except for returning, the var leaf is not
used in the qdisc_leaf(). For simplicity, remove it.

Signed-off-by: Tonghao Zhang <redacted>
---
 net/sched/sch_api.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
index 9c88cec..187a57e 100644
--- a/net/sched/sch_api.c
+++ b/net/sched/sch_api.c
@@ -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)
@@ -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 */
-- 
1.8.3.1

Re: [PATCH] net: sched: simplify the qdisc_leaf code

From: Cong Wang <hidden>
Date: 2018-12-13 22:52:17

On Thu, Dec 13, 2018 at 12:43 AM [off-list ref] wrote:
From: Tonghao Zhang <redacted>

Except for returning, the var leaf is not
used in the qdisc_leaf(). For simplicity, remove it.

Signed-off-by: Tonghao Zhang <redacted>
Acked-by: Cong Wang <redacted>

In the future, please explicitly mark it is for net-next.

Thanks.

Re: [PATCH] net: sched: simplify the qdisc_leaf code

From: David Miller <davem@davemloft.net>
Date: 2018-12-15 19:38:13

From: xiangxia.m.yue@gmail.com
Date: Thu, 13 Dec 2018 00:43:23 -0800
From: Tonghao Zhang <redacted>

Except for returning, the var leaf is not
used in the qdisc_leaf(). For simplicity, remove it.

Signed-off-by: Tonghao Zhang <redacted>
Applied to net-next.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help