pcmcia: pcnet_cs.c removing useless condition
Subsystems (2)
RFC PATCH 1/1 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.odrivers/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
--- drivers/net/pcmcia/pcnet_cs.c | 11 +++++------ 1 files changed, 5 insertions(+), 6 deletions(-)
drivers/net/pcmcia/pcnet_cs.c +5 -6
@@ -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);
Signature · 1 line
1.6.4.2
David Miller
maintainerFrom: Jaswinder Singh Rajput <[email protected]>
Date: Sun, 13 Sep 2009 00:38:49 +0530
Quoted 5 lines
[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)'
Quoted 7 lines
This also fixed following compilation warning :
CC [M]
drivers/net/pcmcia/pcnet_cs.odrivers/net/pcmcia/pcnet_cs.c: In function ‘get_hwinfo’:drivers/net/pcmcia/pcnet_cs.c:321: warning: ‘base’ may be used uninitialized in this functionSigned-off-by Jaswinder Singh Rajput <[email protected]>
Looks good to me, applied.