[PATCH 4/5] can: slcan: convert comparison to NULL into !val

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Signed-off-by: Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx>
---
 drivers/net/can/slcan/slcan-core.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/drivers/net/can/slcan/slcan-core.c b/drivers/net/can/slcan/slcan-core.c
index 8b3aa6215420..09f76a62c7f1 100644
--- a/drivers/net/can/slcan/slcan-core.c
+++ b/drivers/net/can/slcan/slcan-core.c
@@ -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");
 		goto out;
 	}
-	if (sl->tty == NULL) {
+	if (!sl->tty) {
 		spin_unlock(&sl->lock);
 		goto out;
 	}
@@ -707,7 +707,7 @@ static int slc_open(struct net_device *dev)
 	unsigned char cmd[SLC_MTU];
 	int err, s;
 
-	if (sl->tty == NULL)
+	if (!sl->tty)
 		return -ENODEV;
 
 	/* The baud rate is not set with the command
@@ -834,7 +834,7 @@ static void slc_sync(void)
 
 	for (i = 0; i < maxdev; i++) {
 		dev = slcan_devs[i];
-		if (dev == NULL)
+		if (!dev)
 			break;
 
 		sl = netdev_priv(dev);
@@ -854,9 +854,8 @@ static struct slcan *slc_alloc(void)
 
 	for (i = 0; i < maxdev; i++) {
 		dev = slcan_devs[i];
-		if (dev == NULL)
+		if (!dev)
 			break;
-
 	}
 
 	/* Sorry, too many, all slots in use */
@@ -902,7 +901,7 @@ static int slcan_open(struct tty_struct *tty)
 	if (!capable(CAP_NET_ADMIN))
 		return -EPERM;
 
-	if (tty->ops->write == NULL)
+	if (!tty->ops->write)
 		return -EOPNOTSUPP;
 
 	/* RTnetlink lock is misused here to serialize concurrent
@@ -924,7 +923,7 @@ static int slcan_open(struct tty_struct *tty)
 	/* OK.  Find a free SLCAN channel to use. */
 	err = -ENFILE;
 	sl = slc_alloc();
-	if (sl == NULL)
+	if (!sl)
 		goto err_exit;
 
 	sl->tty = tty;
@@ -1071,7 +1070,7 @@ static void __exit slcan_exit(void)
 	unsigned long timeout = jiffies + HZ;
 	int busy = 0;
 
-	if (slcan_devs == NULL)
+	if (!slcan_devs)
 		return;
 
 	/* First of all: check for active disciplines and hangup them.
-- 
2.35.1





[Index of Archives]     [Automotive Discussions]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [CAN Bus]

  Powered by Linux