summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2015-12-15 12:06:08 +0100
committerDavid S. Miller <davem@davemloft.net>2015-12-15 18:46:26 +0100
commitfe0be35e2cb6f8f43ae70ecc9fb372142fdf096b (patch)
tree57352ff5c8f6752309b72e076d4aa33f940de785
parentqlge: fix a timeout loop in ql_change_rx_buffers() (diff)
downloadlinux-fe0be35e2cb6f8f43ae70ecc9fb372142fdf096b.tar.xz
linux-fe0be35e2cb6f8f43ae70ecc9fb372142fdf096b.zip
sfc: fix a timeout loop
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>
-rw-r--r--drivers/net/ethernet/sfc/txc43128_phy.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/sfc/txc43128_phy.c b/drivers/net/ethernet/sfc/txc43128_phy.c
index 3d5ee3259885..194f67d9f3bf 100644
--- a/drivers/net/ethernet/sfc/txc43128_phy.c
+++ b/drivers/net/ethernet/sfc/txc43128_phy.c
@@ -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;