wanmain: comparing array with NULL
Subsystems (2)
PATCH 1/1 wanmain: comparing array with NULL
From: Alan Cox <[email protected]>
gcc really should warn about these !
Signed-off-by Alan Cox <[email protected]>
---
net/wanrouter/wanmain.c | 51 +++++++++++++++++++++-------------------------- 1 file changed, 23 insertions(+), 28 deletions(-)
net/wanrouter/wanmain.c +23 -28
@@ -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" , +#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; +#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; }if (wandev->del_if) wandev->del_if (wandev, dev);
David Miller
maintainerFrom: Alan Cox <[email protected]>
Date: Tue, 24 Jul 2012 19:16:25 +0100
Quoted 5 lines
From: Alan Cox <[email protected]>
gcc really should warn about these !
Signed-off-by Alan Cox <[email protected]>
Applied and queued up for -stable.
net/wanrouter/wanmain.c static int wanrouter_device_new_if(struct wan_device *wandev, · line 607
Quoted 2 lines
net/wanrouter/wanmain.c +1
-0+printk (KERN_INFO "%s: registering interface %s...\n" , wanrouter_modname, dev->name);
I adjusted the indentation of the second line, as needed.