Netdev List
 help / color / mirror / Atom feed
* [PATCH] [net/sched]: Remove redundant condition in qdisc_graft
@ 2020-06-18  0:55 Gaurav Singh
  2020-06-18  1:14 ` Jakub Kicinski
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Gaurav Singh @ 2020-06-18  0:55 UTC (permalink / raw)
  To: gaurav1086, Jamal Hadi Salim, Cong Wang, Jiri Pirko,
	David S. Miller, Jakub Kicinski, open list:TC subsystem,
	open list

parent cannot be NULL here since its in the else part
of the if (parent == NULL) condition. Remove the extra
check on parent pointer.

Signed-off-by: Gaurav Singh <gaurav1086@gmail.com>
---
 net/sched/sch_api.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
index 9a3449b56bd6..8c92d00c5c8e 100644
--- a/net/sched/sch_api.c
+++ b/net/sched/sch_api.c
@@ -1094,7 +1094,7 @@ static int qdisc_graft(struct net_device *dev, struct Qdisc *parent,
 
 		/* Only support running class lockless if parent is lockless */
 		if (new && (new->flags & TCQ_F_NOLOCK) &&
-		    parent && !(parent->flags & TCQ_F_NOLOCK))
+		    && !(parent->flags & TCQ_F_NOLOCK))
 			qdisc_clear_nolock(new);
 
 		if (!cops || !cops->graft)
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-06-21  0:30 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-06-18  0:55 [PATCH] [net/sched]: Remove redundant condition in qdisc_graft Gaurav Singh
2020-06-18  1:14 ` Jakub Kicinski
2020-06-18  1:23 ` Gaurav Singh
2020-06-18  3:43   ` Eric Dumazet
2020-06-18  4:00   ` Gaurav Singh
2020-06-18 14:53     ` David Miller
2020-06-18 20:36     ` Gaurav Singh
2020-06-21  0:30       ` David Miller
2020-06-18  6:05 ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox