Skip to content

Commit 387847f

Browse files
321lipengdavem330
authored andcommitted
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 <[email protected]> Signed-off-by: Guangbin Huang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 0150693 commit 387847f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/wan/hdlc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ int hdlc_open(struct net_device *dev)
148148
hdlc->carrier, hdlc->open);
149149
#endif
150150

151-
if (hdlc->proto == NULL)
151+
if (!hdlc->proto)
152152
return -ENOSYS; /* no protocol attached */
153153

154154
if (hdlc->proto->open) {
@@ -284,7 +284,7 @@ int attach_hdlc_protocol(struct net_device *dev, struct hdlc_proto *proto,
284284

285285
if (size) {
286286
dev_to_hdlc(dev)->state = kmalloc(size, GFP_KERNEL);
287-
if (dev_to_hdlc(dev)->state == NULL) {
287+
if (!dev_to_hdlc(dev)->state) {
288288
module_put(proto->module);
289289
return -ENOBUFS;
290290
}

0 commit comments

Comments
 (0)