[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1252782529.3687.26.camel@ht.satnam>
Date: Sun, 13 Sep 2009 00:38:49 +0530
From: Jaswinder Singh Rajput <jaswinder@...nel.org>
To: David Miller <davem@...emloft.net>, Jeff Garzik <jeff@...zik.org>,
netdev <netdev@...r.kernel.org>,
linux-pcmcia@...ts.infradead.org,
Dominik Brodowski <linux@...inikbrodowski.net>
Subject: [RFC][PATCH] pcmcia: pcnet_cs.c removing useless condition
[This is untested]
'if (i < NR_INFO)' will only true if we breaks from 'for (i = 0; i < NR_INFO; i++)'
So removing useless 'if (i < NR_INFO)'
This also fixed following compilation warning :
CC [M] drivers/net/pcmcia/pcnet_cs.o
drivers/net/pcmcia/pcnet_cs.c: In function ‘get_hwinfo’:
drivers/net/pcmcia/pcnet_cs.c:321: warning: ‘base’ may be used uninitialized in this function
Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@...il.com>
---
drivers/net/pcmcia/pcnet_cs.c | 11 +++++------
1 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/drivers/net/pcmcia/pcnet_cs.c b/drivers/net/pcmcia/pcnet_cs.c
index 9ef1c1b..6a60227 100644
--- a/drivers/net/pcmcia/pcnet_cs.c
+++ b/drivers/net/pcmcia/pcnet_cs.c
@@ -339,12 +339,11 @@ static hw_info_t *get_hwinfo(struct pcmcia_device *link)
base = &virt[hw_info[i].offset & (req.Size-1)];
if ((readb(base+0) == hw_info[i].a0) &&
(readb(base+2) == hw_info[i].a1) &&
- (readb(base+4) == hw_info[i].a2))
- break;
- }
- if (i < NR_INFO) {
- for (j = 0; j < 6; j++)
- dev->dev_addr[j] = readb(base + (j<<1));
+ (readb(base+4) == hw_info[i].a2)) {
+ for (j = 0; j < 6; j++)
+ dev->dev_addr[j] = readb(base + (j<<1));
+ break;
+ }
}
iounmap(virt);
--
1.6.4.2
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists