diff options
author | Alan Cox <alan@linux.intel.com> | 2012-07-24 04:16:25 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-07-24 16:55:21 -0400 |
commit | 8b72ff6484fe303e01498b58621810a114f3cf09 (patch) | |
tree | ec1608e0839d237c526672d9802d52fa90dafd44 /net | |
parent | c66b9b7d365444b433307ebb18734757cb668a02 (diff) |
wanmain: comparing array with NULL
gcc really should warn about these !
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/wanrouter/wanmain.c | 51 |
1 files changed, 23 insertions, 28 deletions
diff --git a/net/wanrouter/wanmain.c b/net/wanrouter/wanmain.c index 788a12c1eb5d..2ab785064b7e 100644 --- a/net/wanrouter/wanmain.c +++ b/net/wanrouter/wanmain.c | |||
@@ -602,36 +602,31 @@ static int wanrouter_device_new_if(struct wan_device *wandev, | |||
602 | * successfully, add it to the interface list. | 602 | * successfully, add it to the interface list. |
603 | */ | 603 | */ |
604 | 604 | ||
605 | if (dev->name == NULL) { | 605 | #ifdef WANDEBUG |
606 | err = -EINVAL; | 606 | printk(KERN_INFO "%s: registering interface %s...\n", |
607 | } else { | 607 | wanrouter_modname, dev->name); |
608 | #endif | ||
608 | 609 | ||
609 | #ifdef WANDEBUG | 610 | err = register_netdev(dev); |
610 | printk(KERN_INFO "%s: registering interface %s...\n", | 611 | if (!err) { |
611 | wanrouter_modname, dev->name); | 612 | struct net_device *slave = NULL; |
612 | #endif | 613 | unsigned long smp_flags=0; |
613 | 614 | ||
614 | err = register_netdev(dev); | 615 | lock_adapter_irq(&wandev->lock, &smp_flags); |
615 | if (!err) { | 616 | |
616 | struct net_device *slave = NULL; | 617 | if (wandev->dev == NULL) { |
617 | unsigned long smp_flags=0; | 618 | wandev->dev = dev; |
618 | 619 | } else { | |
619 | lock_adapter_irq(&wandev->lock, &smp_flags); | 620 | for (slave=wandev->dev; |
620 | 621 | DEV_TO_SLAVE(slave); | |
621 | if (wandev->dev == NULL) { | 622 | slave = DEV_TO_SLAVE(slave)) |
622 | wandev->dev = dev; | 623 | DEV_TO_SLAVE(slave) = dev; |
623 | } else { | ||
624 | for (slave=wandev->dev; | ||
625 | DEV_TO_SLAVE(slave); | ||
626 | slave = DEV_TO_SLAVE(slave)) | ||
627 | DEV_TO_SLAVE(slave) = dev; | ||
628 | } | ||
629 | ++wandev->ndev; | ||
630 | |||
631 | unlock_adapter_irq(&wandev->lock, &smp_flags); | ||
632 | err = 0; /* done !!! */ | ||
633 | goto out; | ||
634 | } | 624 | } |
625 | ++wandev->ndev; | ||
626 | |||
627 | unlock_adapter_irq(&wandev->lock, &smp_flags); | ||
628 | err = 0; /* done !!! */ | ||
629 | goto out; | ||
635 | } | 630 | } |
636 | if (wandev->del_if) | 631 | if (wandev->del_if) |
637 | wandev->del_if(wandev, dev); | 632 | wandev->del_if(wandev, dev); |