* [PATCH] smsc911x: timeout reaches -1
@ 2009-01-29 15:12 Roel Kluin
2009-01-29 15:22 ` Steve.Glendinning
0 siblings, 1 reply; 3+ messages in thread
From: Roel Kluin @ 2009-01-29 15:12 UTC (permalink / raw)
To: steve.glendinning; +Cc: netdev
With a postfix decrement the timeout will reach -1 rather than 0,
so the warning will not be issued.
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
diff --git a/drivers/net/smsc911x.c b/drivers/net/smsc911x.c
index f513bdf..783c1a7 100644
--- a/drivers/net/smsc911x.c
+++ b/drivers/net/smsc911x.c
@@ -953,7 +953,7 @@ smsc911x_rx_fastforward(struct smsc911x_data *pdata, unsigned int pktbytes)
do {
udelay(1);
val = smsc911x_reg_read(pdata, RX_DP_CTRL);
- } while (timeout-- && (val & RX_DP_CTRL_RX_FFWD_));
+ } while (--timeout && (val & RX_DP_CTRL_RX_FFWD_));
if (unlikely(timeout == 0))
SMSC_WARNING(HW, "Timed out waiting for "
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] smsc911x: timeout reaches -1
2009-01-29 15:12 [PATCH] smsc911x: timeout reaches -1 Roel Kluin
@ 2009-01-29 15:22 ` Steve.Glendinning
2009-01-30 1:30 ` David Miller
0 siblings, 1 reply; 3+ messages in thread
From: Steve.Glendinning @ 2009-01-29 15:22 UTC (permalink / raw)
To: Roel Kluin; +Cc: netdev, Ian.Saturley
Roel Kluin <roel.kluin@gmail.com> wrote on 29/01/2009 15:12:03:
> With a postfix decrement the timeout will reach -1 rather than 0,
> so the warning will not be issued.
>
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
> ---
> diff --git a/drivers/net/smsc911x.c b/drivers/net/smsc911x.c
> index f513bdf..783c1a7 100644
> --- a/drivers/net/smsc911x.c
> +++ b/drivers/net/smsc911x.c
> @@ -953,7 +953,7 @@ smsc911x_rx_fastforward(struct smsc911x_data
> *pdata, unsigned int pktbytes)
> do {
> udelay(1);
> val = smsc911x_reg_read(pdata, RX_DP_CTRL);
> - } while (timeout-- && (val & RX_DP_CTRL_RX_FFWD_));
> + } while (--timeout && (val & RX_DP_CTRL_RX_FFWD_));
>
> if (unlikely(timeout == 0))
> SMSC_WARNING(HW, "Timed out waiting for "
Thanks for spotting this Roel.
Acked-by: Steve Glendinning <steve.glendinning@smsc.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] smsc911x: timeout reaches -1
2009-01-29 15:22 ` Steve.Glendinning
@ 2009-01-30 1:30 ` David Miller
0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2009-01-30 1:30 UTC (permalink / raw)
To: Steve.Glendinning; +Cc: roel.kluin, netdev, Ian.Saturley
From: Steve.Glendinning@smsc.com
Date: Thu, 29 Jan 2009 15:22:03 +0000
> Roel Kluin <roel.kluin@gmail.com> wrote on 29/01/2009 15:12:03:
>
> > With a postfix decrement the timeout will reach -1 rather than 0,
> > so the warning will not be issued.
> >
> > Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
> > ---
> > diff --git a/drivers/net/smsc911x.c b/drivers/net/smsc911x.c
> > index f513bdf..783c1a7 100644
> > --- a/drivers/net/smsc911x.c
> > +++ b/drivers/net/smsc911x.c
> > @@ -953,7 +953,7 @@ smsc911x_rx_fastforward(struct smsc911x_data
> > *pdata, unsigned int pktbytes)
> > do {
> > udelay(1);
> > val = smsc911x_reg_read(pdata, RX_DP_CTRL);
> > - } while (timeout-- && (val & RX_DP_CTRL_RX_FFWD_));
> > + } while (--timeout && (val & RX_DP_CTRL_RX_FFWD_));
> >
> > if (unlikely(timeout == 0))
> > SMSC_WARNING(HW, "Timed out waiting for "
>
> Thanks for spotting this Roel.
>
> Acked-by: Steve Glendinning <steve.glendinning@smsc.com>
Applied, thanks everyone.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-01-30 1:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-29 15:12 [PATCH] smsc911x: timeout reaches -1 Roel Kluin
2009-01-29 15:22 ` Steve.Glendinning
2009-01-30 1:30 ` 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).