net: hdlc: replace comparison to NULL with "!param"
authorPeng Li <lipeng321@huawei.com>
Tue, 1 Jun 2021 13:23:20 +0000 (21:23 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 1 Jun 2021 23:57:47 +0000 (16:57 -0700)
According to the chackpatch.pl, comparison to NULL could
be written "!param".

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/hdlc.c

index 13388ba..fefc732 100644 (file)
@@ -148,7 +148,7 @@ int hdlc_open(struct net_device *dev)
               hdlc->carrier, hdlc->open);
 #endif
 
-       if (hdlc->proto == NULL)
+       if (!hdlc->proto)
                return -ENOSYS; /* no protocol attached */
 
        if (hdlc->proto->open) {
@@ -284,7 +284,7 @@ int attach_hdlc_protocol(struct net_device *dev, struct hdlc_proto *proto,
 
        if (size) {
                dev_to_hdlc(dev)->state = kmalloc(size, GFP_KERNEL);
-               if (dev_to_hdlc(dev)->state == NULL) {
+               if (!dev_to_hdlc(dev)->state) {
                        module_put(proto->module);
                        return -ENOBUFS;
                }