diff options
author | Peng Li <lipeng321@huawei.com> | 2021-06-01 21:23:20 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-06-01 16:57:47 -0700 |
commit | 387847f295c86fe72693178ed1eab000154f98ff (patch) | |
tree | 48929d63b46cfe3c77a0fff8d2aab203731007d8 /drivers/net/wan/hdlc.c | |
parent | 01506939cc8466635fb05711a79f8eb2b5df1ff3 (diff) |
net: hdlc: replace comparison to NULL with "!param"
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>
Diffstat (limited to 'drivers/net/wan/hdlc.c')
-rw-r--r-- | drivers/net/wan/hdlc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/wan/hdlc.c b/drivers/net/wan/hdlc.c index 13388bad88a3..fefc7321c0c4 100644 --- a/drivers/net/wan/hdlc.c +++ b/drivers/net/wan/hdlc.c @@ -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; } |