sfc: fix a timeout loop
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 15 Dec 2015 11:06:08 +0000 (14:06 +0300)
committerDavid S. Miller <davem@davemloft.net>
Tue, 15 Dec 2015 17:46:26 +0000 (12:46 -0500)
We test for if "tries" is zero at the end but "tries--" is a post-op so
it will end with "tries" set to -1.  I have changed it to a pre-op
instead.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/sfc/txc43128_phy.c

index 3d5ee3259885d9486933e5b821c3af2a94c910d2..194f67d9f3bfaa81bd99bf3ad64c6c1568476319 100644 (file)
@@ -418,7 +418,7 @@ static void txc_reset_logic_mmd(struct efx_nic *efx, int mmd)
 
        val |= (1 << TXC_GLCMD_LMTSWRST_LBN);
        efx_mdio_write(efx, mmd, TXC_GLRGS_GLCMD, val);
-       while (tries--) {
+       while (--tries) {
                val = efx_mdio_read(efx, mmd, TXC_GLRGS_GLCMD);
                if (!(val & (1 << TXC_GLCMD_LMTSWRST_LBN)))
                        break;