Skip to contentSkip to conversation

smsc9420: fix another postfixed timeout

PATCH Applied Steve Glendinning 2 participants 2 messages Feb 16, 2009 – Feb 20, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 smsc9420: fix another postfixed timeout

Roel Kluin recently fixed several instances where variables reach -1, but 0 is tested afterwards. This patch fixes another, so the timeout will be correctly detected and a warning printed.

---
 drivers/net/smsc9420.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/smsc9420.c +1 -1
index a1e4b38..83938e1 100644
@@ -341,7 +341,7 @@ static int smsc9420_eeprom_send_cmd(struct smsc9420_pdata *pd, u32 op)
 	do {
 		msleep(1);
 		e2cmd = smsc9420_reg_read(pd, E2P_CMD);
-	} while ((e2cmd & E2P_CMD_EPC_BUSY_) && (timeout--));
+	} while ((e2cmd & E2P_CMD_EPC_BUSY_) && (--timeout));
 
 	if (!timeout) {
 		smsc_info(HW, "TIMED OUT");
Signature · 1 line
1.6.0.6
maintainer Applied
#1 lore raw

From: Steve Glendinning <[email protected]>
Date: Mon, 16 Feb 2009 07:46:06 +0000

Quoted 5 lines

Roel Kluin recently fixed several instances where variables reach -1, but 0 is tested afterwards. This patch fixes another, so the timeout will be correctly detected and a warning printed.

Applied.