aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/smc911x.c
diff options
context:
space:
mode:
authorRoel Kluin <roel.kluin@gmail.com>2009-02-02 21:39:02 -0800
committerDavid S. Miller <davem@davemloft.net>2009-02-02 21:39:02 -0800
commit46578a6913e6f5e69229561736b94c18c2e88ae4 (patch)
tree23db22f32e094dd971650528ea1d499bd2ab3015 /drivers/net/smc911x.c
parent0047e5d240ede4e84c03bc9001375175900fd259 (diff)
downloadkernel_samsung_espresso10-46578a6913e6f5e69229561736b94c18c2e88ae4.zip
kernel_samsung_espresso10-46578a6913e6f5e69229561736b94c18c2e88ae4.tar.gz
kernel_samsung_espresso10-46578a6913e6f5e69229561736b94c18c2e88ae4.tar.bz2
net: variables reach -1, but 0 tested
while (timeout--) { ... } timeout becomes -1 if the loop isn't ended otherwise, not 0. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/smc911x.c')
-rw-r--r--drivers/net/smc911x.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c
index bf3aa2a..223cde0 100644
--- a/drivers/net/smc911x.c
+++ b/drivers/net/smc911x.c
@@ -220,9 +220,9 @@ static void smc911x_reset(struct net_device *dev)
/* make sure EEPROM has finished loading before setting GPIO_CFG */
timeout=1000;
- while ( timeout-- && (SMC_GET_E2P_CMD(lp) & E2P_CMD_EPC_BUSY_)) {
+ while (--timeout && (SMC_GET_E2P_CMD(lp) & E2P_CMD_EPC_BUSY_))
udelay(10);
- }
+
if (timeout == 0){
PRINTK("%s: smc911x_reset timeout waiting for EEPROM busy\n", dev->name);
return;