提交 8b72ff64 编写于 作者: A Alan Cox 提交者: David S. Miller

wanmain: comparing array with NULL

gcc really should warn about these !
Signed-off-by: NAlan Cox <alan@linux.intel.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 c66b9b7d
......@@ -602,36 +602,31 @@ static int wanrouter_device_new_if(struct wan_device *wandev,
* successfully, add it to the interface list.
*/
if (dev->name == NULL) {
err = -EINVAL;
} else {
#ifdef WANDEBUG
printk(KERN_INFO "%s: registering interface %s...\n",
wanrouter_modname, dev->name);
#endif
#ifdef WANDEBUG
printk(KERN_INFO "%s: registering interface %s...\n",
wanrouter_modname, dev->name);
#endif
err = register_netdev(dev);
if (!err) {
struct net_device *slave = NULL;
unsigned long smp_flags=0;
lock_adapter_irq(&wandev->lock, &smp_flags);
if (wandev->dev == NULL) {
wandev->dev = dev;
} else {
for (slave=wandev->dev;
DEV_TO_SLAVE(slave);
slave = DEV_TO_SLAVE(slave))
DEV_TO_SLAVE(slave) = dev;
}
++wandev->ndev;
unlock_adapter_irq(&wandev->lock, &smp_flags);
err = 0; /* done !!! */
goto out;
err = register_netdev(dev);
if (!err) {
struct net_device *slave = NULL;
unsigned long smp_flags=0;
lock_adapter_irq(&wandev->lock, &smp_flags);
if (wandev->dev == NULL) {
wandev->dev = dev;
} else {
for (slave=wandev->dev;
DEV_TO_SLAVE(slave);
slave = DEV_TO_SLAVE(slave))
DEV_TO_SLAVE(slave) = dev;
}
++wandev->ndev;
unlock_adapter_irq(&wandev->lock, &smp_flags);
err = 0; /* done !!! */
goto out;
}
if (wandev->del_if)
wandev->del_if(wandev, dev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册