diff mbox

[v2] yam: remove redundant null check on dev

Message ID 1364408704-27359-1-git-send-email-colin.king@canonical.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Colin Ian King March 27, 2013, 6:25 p.m. UTC
From: Colin Ian King <colin.king@canonical.com>

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>
---
 drivers/net/hamradio/yam.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

David Miller March 27, 2013, 6:31 p.m. UTC | #1
From: Colin King <colin.king@canonical.com>
Date: Wed, 27 Mar 2013 18:25:04 +0000

> From: Colin Ian King <colin.king@canonical.com>
> 
> 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>

Applied to net-next, thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/hamradio/yam.c b/drivers/net/hamradio/yam.c
index 4cf8f10..b2d863f 100644
--- a/drivers/net/hamradio/yam.c
+++ b/drivers/net/hamradio/yam.c
@@ -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) {