From: Steve Glendinning Date: Mon, 16 Feb 2009 07:46:06 +0000 (+0000) Subject: smsc9420: fix another postfixed timeout X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9df8f4e3ee760c14211a5f484e9ee4f0bc0c566b;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git smsc9420: fix another postfixed timeout Roel Kluin recently fixed several instances where variables reach -1, but 0 is tested afterwards. This patch fixes another, so the timeout will be correctly detected and a warning printed. Signed-off-by: Steve Glendinning Signed-off-by: David S. Miller --- diff --git a/drivers/net/smsc9420.c b/drivers/net/smsc9420.c index a1e4b3895b3..83938e1953b 100644 --- a/drivers/net/smsc9420.c +++ b/drivers/net/smsc9420.c @@ -341,7 +341,7 @@ static int smsc9420_eeprom_send_cmd(struct smsc9420_pdata *pd, u32 op) do { msleep(1); e2cmd = smsc9420_reg_read(pd, E2P_CMD); - } while ((e2cmd & E2P_CMD_EPC_BUSY_) && (timeout--)); + } while ((e2cmd & E2P_CMD_EPC_BUSY_) && (--timeout)); if (!timeout) { smsc_info(HW, "TIMED OUT");