[PATCH] octeon: false positive timeout

Roel Kluin roel.kluin at gmail.com
Thu Jul 16 14:57:43 UTC 2009


Otherwise a `timeout' value of 0 would not have been a timeout, but
rather that `smi_rd.s.pending' caused the loop to end in the last
iteration.

Signed-off-by: Roel Kluin <roel.kluin at gmail.com>
---
diff --git a/drivers/staging/octeon/cvmx-mdio.h b/drivers/staging/octeon/cvmx-mdio.h
index c987a75..f45dc49 100644
--- a/drivers/staging/octeon/cvmx-mdio.h
+++ b/drivers/staging/octeon/cvmx-mdio.h
@@ -421,7 +421,7 @@ static inline int cvmx_mdio_45_read(int bus_id, int phy_id, int device,
 	do {
 		cvmx_wait(1000);
 		smi_rd.u64 = cvmx_read_csr(CVMX_SMIX_RD_DAT(bus_id));
-	} while (smi_rd.s.pending && timeout--);
+	} while (smi_rd.s.pending && --timeout);
 
 	if (timeout <= 0) {
 		cvmx_dprintf("cvmx_mdio_45_read: bus_id %d phy_id %2d "



More information about the devel mailing list