Commit 69a65396 authored by Marc Kleine-Budde's avatar Marc Kleine-Budde

can: slcan: convert comparison to NULL into !val

All comparison to NULL could be written "!val", convert them to make
checkpatch happy.

Link: https://lore.kernel.org/all/20220704125954.1587880-5-mkl@pengutronix.deSigned-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
parent f07d9e3c
...@@ -618,7 +618,7 @@ static netdev_tx_t slc_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -618,7 +618,7 @@ static netdev_tx_t slc_xmit(struct sk_buff *skb, struct net_device *dev)
netdev_warn(dev, "xmit: iface is down\n"); netdev_warn(dev, "xmit: iface is down\n");
goto out; goto out;
} }
if (sl->tty == NULL) { if (!sl->tty) {
spin_unlock(&sl->lock); spin_unlock(&sl->lock);
goto out; goto out;
} }
...@@ -707,7 +707,7 @@ static int slc_open(struct net_device *dev) ...@@ -707,7 +707,7 @@ static int slc_open(struct net_device *dev)
unsigned char cmd[SLC_MTU]; unsigned char cmd[SLC_MTU];
int err, s; int err, s;
if (sl->tty == NULL) if (!sl->tty)
return -ENODEV; return -ENODEV;
/* The baud rate is not set with the command /* The baud rate is not set with the command
...@@ -834,7 +834,7 @@ static void slc_sync(void) ...@@ -834,7 +834,7 @@ static void slc_sync(void)
for (i = 0; i < maxdev; i++) { for (i = 0; i < maxdev; i++) {
dev = slcan_devs[i]; dev = slcan_devs[i];
if (dev == NULL) if (!dev)
break; break;
sl = netdev_priv(dev); sl = netdev_priv(dev);
...@@ -854,9 +854,8 @@ static struct slcan *slc_alloc(void) ...@@ -854,9 +854,8 @@ static struct slcan *slc_alloc(void)
for (i = 0; i < maxdev; i++) { for (i = 0; i < maxdev; i++) {
dev = slcan_devs[i]; dev = slcan_devs[i];
if (dev == NULL) if (!dev)
break; break;
} }
/* Sorry, too many, all slots in use */ /* Sorry, too many, all slots in use */
...@@ -902,7 +901,7 @@ static int slcan_open(struct tty_struct *tty) ...@@ -902,7 +901,7 @@ static int slcan_open(struct tty_struct *tty)
if (!capable(CAP_NET_ADMIN)) if (!capable(CAP_NET_ADMIN))
return -EPERM; return -EPERM;
if (tty->ops->write == NULL) if (!tty->ops->write)
return -EOPNOTSUPP; return -EOPNOTSUPP;
/* RTnetlink lock is misused here to serialize concurrent /* RTnetlink lock is misused here to serialize concurrent
...@@ -924,7 +923,7 @@ static int slcan_open(struct tty_struct *tty) ...@@ -924,7 +923,7 @@ static int slcan_open(struct tty_struct *tty)
/* OK. Find a free SLCAN channel to use. */ /* OK. Find a free SLCAN channel to use. */
err = -ENFILE; err = -ENFILE;
sl = slc_alloc(); sl = slc_alloc();
if (sl == NULL) if (!sl)
goto err_exit; goto err_exit;
sl->tty = tty; sl->tty = tty;
...@@ -1071,7 +1070,7 @@ static void __exit slcan_exit(void) ...@@ -1071,7 +1070,7 @@ static void __exit slcan_exit(void)
unsigned long timeout = jiffies + HZ; unsigned long timeout = jiffies + HZ;
int busy = 0; int busy = 0;
if (slcan_devs == NULL) if (!slcan_devs)
return; return;
/* First of all: check for active disciplines and hangup them. /* First of all: check for active disciplines and hangup them.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment