Files
linux/drivers
Trent Piepho baac03d9bb gianfar: Fix error in mdio reset timeout
The loop with the timeout used "while (...  && timeout--)", which means
than when the timeout occurs, "timeout" will be -1 after the loop has
exited.  The code that checks if the looped exited because of a timeout
used "if (timeout <= 0)".  Seems ok, except timeout is unsigned, and
(unsigned)-1 isn't less than zero!

Using "--timeout" in the loop fixes this problem, as now "timeout" will be
0 when the loop times out.

This also fixes a bug in the existing code, where it will erroneously think
a timeout occurred if the condition the loop was waiting for is satisfied
on the final iteration before a timeout.

Signed-off-by: Trent Piepho <tpiepho@freescale.com>
Acked-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-09-24 20:48:56 -04:00
..
2008-09-22 19:22:58 -07:00
2008-09-22 19:21:51 -07:00
2008-08-18 21:40:04 +02:00
2008-08-19 18:47:56 +02:00
2008-08-15 11:50:15 -07:00
2008-09-22 19:18:15 -07:00
2008-08-26 00:19:28 +10:00
2008-07-26 12:00:11 -07:00
2008-08-16 16:35:33 +01:00
2008-09-02 19:21:40 -07:00
2008-09-24 20:47:57 -04:00
2008-08-04 12:51:06 +09:00
2008-08-13 17:33:00 -07:00