diff options
author | Roel Kluin <roel.kluin@gmail.com> | 2009-02-02 21:39:02 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-02-02 21:39:02 -0800 |
commit | 46578a6913e6f5e69229561736b94c18c2e88ae4 (patch) | |
tree | 23db22f32e094dd971650528ea1d499bd2ab3015 /drivers/net/smc911x.c | |
parent | 0047e5d240ede4e84c03bc9001375175900fd259 (diff) | |
download | op-kernel-dev-46578a6913e6f5e69229561736b94c18c2e88ae4.zip op-kernel-dev-46578a6913e6f5e69229561736b94c18c2e88ae4.tar.gz |
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.c | 4 |
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; |