]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net: wan: replace comparison to NULL with "!card"
authorPeng Li <lipeng321@huawei.com>
Tue, 25 May 2021 14:07:57 +0000 (22:07 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 25 May 2021 22:41:54 +0000 (15:41 -0700)
According to the chackpatch.pl, comparison to NULL could
be written "!card".

Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/wan/n2.c

index 2f602171cbc655c1f2193dd78de5282e5ac9e4d2..76ef808c27697bebb4550b1c82d5d69e533d01ad 100644 (file)
@@ -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