Thread (8 messages) flat view 8 messages, 2 authors, 2021-05-25
STALE1917d

Revision v1 of 5 in this series.

Revisions (5)
  1. v1 [diff vs current]
  2. v1 [diff vs current]
  3. v1 [diff vs current]
  4. v1 current
  5. v1 [diff vs current]

[PATCH net-next 5/6] net: wan: replace comparison to NULL with "!card"

From: Guangbin Huang <hidden>
Date: 2021-05-25 14:11:39
Also in: lkml
Subsystem: generic hdlc (wan) drivers, networking drivers, the rest · Maintainers: Krzysztof Halasa, Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

From: Peng Li <redacted>

According to the chackpatch.pl, comparison to NULL could
be written "!card".

Signed-off-by: Peng Li <redacted>
Signed-off-by: Guangbin Huang <redacted>
---
 drivers/net/wan/n2.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wan/n2.c b/drivers/net/wan/n2.c
index 2f602171cbc6..76ef808c2769 100644
--- a/drivers/net/wan/n2.c
+++ b/drivers/net/wan/n2.c
@@ -335,7 +335,7 @@ static int __init n2_run(unsigned long io, unsigned long irq,
 	}
 
 	card = kzalloc(sizeof(card_t), GFP_KERNEL);
-	if (card == NULL)
+	if (!card)
 		return -ENOBUFS;
 
 	card->ports[0].dev = alloc_hdlcdev(&card->ports[0]);
@@ -469,7 +469,7 @@ static int __init n2_run(unsigned long io, unsigned long irq,
 
 static int __init n2_init(void)
 {
-	if (hw==NULL) {
+	if (!hw) {
 #ifdef MODULE
 		pr_info("no card initialized\n");
 #endif
-- 
2.8.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help