Skip to contentSkip to conversation

SMSC: timeout reaches -1

PATCH Applied Roel Kluin 2 participants 4 messages Feb 16, 2009 – Feb 20, 2009

Subsystems (2)
lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 SMSC: timeout reaches -1

With a postfix decrement timeouts will reach -1 rather than 0, so the error path does not appear.

---

drivers/net/smsc911x.c +1 -1
index 783c1a7..9a78dae 100644
@@ -1624,7 +1624,7 @@ static int smsc911x_eeprom_send_cmd(struct smsc911x_data *pdata, u32 op)
 	do {
 		msleep(1);
 		e2cmd = smsc911x_reg_read(pdata, E2P_CMD);
-	} while ((e2cmd & E2P_CMD_EPC_BUSY_) && (timeout--));
+	} while ((e2cmd & E2P_CMD_EPC_BUSY_) && (--timeout));
 
 	if (!timeout) {
 		SMSC_TRACE(DRV, "TIMED OUT");
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");
maintainer
#1 lore raw

From: Roel Kluin <[email protected]>
Date: Mon, 16 Feb 2009 11:21:33 +0100

Quoted 4 lines

With a postfix decrement timeouts will reach -1 rather than 0, so the error path does not appear.

Steve Glendinning submitted the smsc9420 side of this patch, please resubmit this with only the smsc911x.c part present.

Thanks.

author
#2 lore raw
Quoted 6 lines · David Miller

From: Roel Kluin <[email protected]>
Date: Mon, 16 Feb 2009 11:21:33 +0100

Quoted 3 lines

With a postfix decrement timeouts will reach -1 rather than 0, so the error path does not appear.

Quoted 7 lines
Quoted 1 line

Steve Glendinning submitted the smsc9420 side of this patch, please resubmit this with only the smsc911x.c part present.

Thanks.

ok, here:

--------------------------->8-------------8<------------------------------ With a postfix decrement timeouts will reach -1 rather than 0, so the error path does not appear.

---

drivers/net/smsc911x.c +1 -1
index 783c1a7..9a78dae 100644
@@ -1624,7 +1624,7 @@ static int smsc911x_eeprom_send_cmd(struct smsc911x_data *pdata, u32 op)
 	do {
 		msleep(1);
 		e2cmd = smsc911x_reg_read(pdata, E2P_CMD);
-	} while ((e2cmd & E2P_CMD_EPC_BUSY_) && (timeout--));
+	} while ((e2cmd & E2P_CMD_EPC_BUSY_) && (--timeout));
 
 	if (!timeout) {
 		SMSC_TRACE(DRV, "TIMED OUT");