Skip to content

Commit

Permalink
pcmcia: pcnet_cs.c removing useless condition
Browse files Browse the repository at this point in the history
'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@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Jaswinder Singh Rajput authored and David S. Miller committed Sep 22, 2009
1 parent 44c852e commit 03b88a6
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions drivers/net/pcmcia/pcnet_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -340,12 +340,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);
Expand Down

0 comments on commit 03b88a6

Please sign in to comment.