[PATCH] net: atm: remove redundant null pointer check on dev->name

Subsystems: atm, networking [general], the rest

STALE3658d

2 messages, 2 authors, 2016-08-19 · open the first message on its own page

[PATCH] net: atm: remove redundant null pointer check on dev->name

From: Colin King <hidden>
Date: 2016-08-16 11:10:48

From: Colin Ian King <redacted>

dev->name is a char array of IFNAMSIZ elements, hence can never be
null, so the null pointer check is redundant. Remove it.

Signed-off-by: Colin Ian King <redacted>
---
 net/atm/mpc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/atm/mpc.c b/net/atm/mpc.c
index 0e98222..3b3b1a2 100644
--- a/net/atm/mpc.c
+++ b/net/atm/mpc.c
@@ -1007,7 +1007,7 @@ static int mpoa_event_listener(struct notifier_block *mpoa_notifier,
 	if (!net_eq(dev_net(dev), &init_net))
 		return NOTIFY_DONE;
 
-	if (dev->name == NULL || strncmp(dev->name, "lec", 3))
+	if (strncmp(dev->name, "lec", 3))
 		return NOTIFY_DONE; /* we are only interested in lec:s */
 
 	switch (event) {
-- 
2.8.1

Re: [PATCH] net: atm: remove redundant null pointer check on dev->name

From: David Miller <davem@davemloft.net>
Date: 2016-08-19 04:04:05

From: Colin King <redacted>
Date: Tue, 16 Aug 2016 12:08:42 +0100
From: Colin Ian King <redacted>

dev->name is a char array of IFNAMSIZ elements, hence can never be
null, so the null pointer check is redundant. Remove it.

Signed-off-by: Colin Ian King <redacted>
Applied.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help