yam: remove redundant null check on dev
authorColin Ian King <colin.king@canonical.com>
Wed, 27 Mar 2013 18:25:04 +0000 (18:25 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 27 Mar 2013 18:30:55 +0000 (14:30 -0400)
yam_open has a redundant null check on null,  it will
never be called with dev == NULL. Remove this redundant check.
This also cleans up a smatch warning:

drivers/net/hamradio/yam.c:869 yam_open() warn: variable
  dereferenced before check 'dev' (see line 867)

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/hamradio/yam.c

index 4cf8f1017aad40bcb613c1922bdc9519f976f399..b2d863f2ea4255a2f9cc61bda6a9fdff8ab5623c 100644 (file)
@@ -866,7 +866,7 @@ static int yam_open(struct net_device *dev)
 
        printk(KERN_INFO "Trying %s at iobase 0x%lx irq %u\n", dev->name, dev->base_addr, dev->irq);
 
-       if (!dev || !yp->bitrate)
+       if (!yp->bitrate)
                return -ENXIO;
        if (!dev->base_addr || dev->base_addr > 0x1000 - YAM_EXTENT ||
                dev->irq < 2 || dev->irq > 15) {