wanmain: comparing array with NULL
authorAlan Cox <alan@linux.intel.com>
Tue, 24 Jul 2012 08:16:25 +0000 (08:16 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 24 Jul 2012 20:55:21 +0000 (13:55 -0700)
gcc really should warn about these !

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/wanrouter/wanmain.c

index 788a12c1eb5d61c9df0a98d6ca2f5ad8ce7bfeda..2ab785064b7e36da5d0871f2abfd57b5a92f09ee 100644 (file)
@@ -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);