netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] SMSC: timeout reaches -1
@ 2009-02-16 10:21 Roel Kluin
  2009-02-20  8:41 ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Roel Kluin @ 2009-02-16 10:21 UTC (permalink / raw)
  To: steve.glendinning; +Cc: netdev, Andrew Morton

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

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
diff --git a/drivers/net/smsc911x.c b/drivers/net/smsc911x.c
index 783c1a7..9a78dae 100644
--- a/drivers/net/smsc911x.c
+++ b/drivers/net/smsc911x.c
@@ -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");
diff --git a/drivers/net/smsc9420.c b/drivers/net/smsc9420.c
index a1e4b38..83938e1 100644
--- a/drivers/net/smsc9420.c
+++ b/drivers/net/smsc9420.c
@@ -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");

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] SMSC: timeout reaches -1
  2009-02-16 10:21 [PATCH] SMSC: timeout reaches -1 Roel Kluin
@ 2009-02-20  8:41 ` David Miller
  2009-02-20  8:51   ` Roel Kluin
  0 siblings, 1 reply; 4+ messages in thread
From: David Miller @ 2009-02-20  8:41 UTC (permalink / raw)
  To: roel.kluin; +Cc: steve.glendinning, netdev, akpm

From: Roel Kluin <roel.kluin@gmail.com>
Date: Mon, 16 Feb 2009 11:21:33 +0100

> With a postfix decrement timeouts will reach -1 rather than 0, so
> the error path does not appear.
> 
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>

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

Thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] SMSC: timeout reaches -1
  2009-02-20  8:41 ` David Miller
@ 2009-02-20  8:51   ` Roel Kluin
  2009-02-20  8:52     ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Roel Kluin @ 2009-02-20  8:51 UTC (permalink / raw)
  To: David Miller; +Cc: steve.glendinning, netdev, akpm

David Miller wrote:
> From: Roel Kluin <roel.kluin@gmail.com>
> Date: Mon, 16 Feb 2009 11:21:33 +0100
> 
>> With a postfix decrement timeouts will reach -1 rather than 0, so
>> the error path does not appear.
>>
>> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
> 
> 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.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
diff --git a/drivers/net/smsc911x.c b/drivers/net/smsc911x.c
index 783c1a7..9a78dae 100644
--- a/drivers/net/smsc911x.c
+++ b/drivers/net/smsc911x.c
@@ -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");

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] SMSC: timeout reaches -1
  2009-02-20  8:51   ` Roel Kluin
@ 2009-02-20  8:52     ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2009-02-20  8:52 UTC (permalink / raw)
  To: roel.kluin; +Cc: steve.glendinning, netdev, akpm

From: Roel Kluin <roel.kluin@gmail.com>
Date: Fri, 20 Feb 2009 09:51:36 +0100

> With a postfix decrement timeouts will reach -1 rather than 0, so
> the error path does not appear.
> 
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>

Applied, thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-02-20  8:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-16 10:21 [PATCH] SMSC: timeout reaches -1 Roel Kluin
2009-02-20  8:41 ` David Miller
2009-02-20  8:51   ` Roel Kluin
2009-02-20  8:52     ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).