netdev_warn(dev, "xmit: iface is down\n");
goto out;
}
- if (sl->tty == NULL) {
+ if (!sl->tty) {
spin_unlock(&sl->lock);
goto out;
}
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
for (i = 0; i < maxdev; i++) {
dev = slcan_devs[i];
- if (dev == NULL)
+ if (!dev)
break;
sl = netdev_priv(dev);
for (i = 0; i < maxdev; i++) {
dev = slcan_devs[i];
- if (dev == NULL)
+ if (!dev)
break;
-
}
/* Sorry, too many, all slots in use */
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
/* OK. Find a free SLCAN channel to use. */
err = -ENFILE;
sl = slc_alloc();
- if (sl == NULL)
+ if (!sl)
goto err_exit;
sl->tty = tty;
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.