Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[PATCH] atarilance: timeout ignored in lance_open()

0 views
Skip to first unread message

Roel Kluin

unread,
Dec 27, 2009, 8:30:01 AM12/27/09
to
With `while (--limit > 0)' i reaches 0 after the loop, so upon timeout the
error was not returned.

Signed-off-by: Roel Kluin <roel....@gmail.com>
---
diff --git a/drivers/net/niu.c b/drivers/net/niu.c
index 8ce58c4..2aed2b3 100644
--- a/drivers/net/niu.c
+++ b/drivers/net/niu.c
@@ -2844,7 +2844,7 @@ static int tcam_wait_bit(struct niu *np, u64 bit)
break;
udelay(1);
}
- if (limit < 0)
+ if (limit <= 0)
return -ENODEV;

return 0;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majo...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Roel Kluin

unread,
Dec 27, 2009, 8:30:02 AM12/27/09
to
With `while (--i > 0)' i reaches 0 after the loop, so upon timeout the
error was not issued.

Signed-off-by: Roel Kluin <roel....@gmail.com>
---

drivers/net/atarilance.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/atarilance.c b/drivers/net/atarilance.c
index c5721cb..cc9ed86 100644
--- a/drivers/net/atarilance.c
+++ b/drivers/net/atarilance.c
@@ -663,7 +663,7 @@ static int lance_open( struct net_device *dev )
while (--i > 0)
if (DREG & CSR0_IDON)
break;
- if (i < 0 || (DREG & CSR0_ERR)) {
+ if (i <= 0 || (DREG & CSR0_ERR)) {
DPRINTK( 2, ( "lance_open(): opening %s failed, i=%d, csr0=%04x\n",
dev->name, i, DREG ));
DREG = CSR0_STOP;

Roel Kluin

unread,
Dec 27, 2009, 9:10:02 AM12/27/09
to
Op 27-12-09 14:28, Roel Kluin schreef:

> With `while (--limit > 0)' i reaches 0 after the loop, so upon timeout the
> error was not returned.
>
> Signed-off-by: Roel Kluin <roel....@gmail.com>
> ---
> diff --git a/drivers/net/niu.c b/drivers/net/niu.c

Oops, forgot to update the subject, please ignore, I'll send another.

Roel

David Miller

unread,
Jan 4, 2010, 12:50:01 AM1/4/10
to
From: Roel Kluin <roel....@gmail.com>
Date: Sun, 27 Dec 2009 14:26:12 +0100

> With `while (--i > 0)' i reaches 0 after the loop, so upon timeout the
> error was not issued.
>
> Signed-off-by: Roel Kluin <roel....@gmail.com>

Applied.

0 new messages