From: Colin Ian King Date: Wed, 27 Mar 2019 16:15:20 +0000 (+0000) Subject: net: phy: mdio-bcm-unimac: remove redundant !timeout check X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=180a8c3d5dad5862b2f19727b363069bfecb26d8;p=openwrt%2Fstaging%2Fblogic.git net: phy: mdio-bcm-unimac: remove redundant !timeout check The check for zero timeout is always true at the end of the proceeding while loop; the only other exit path in the loop is if the unimac MDIO is not busy. Remove the redundant zero timeout check and always return -ETIMEDOUT on this timeout return path. Signed-off-by: Colin Ian King Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller --- diff --git a/drivers/net/phy/mdio-bcm-unimac.c b/drivers/net/phy/mdio-bcm-unimac.c index 3a592629dc7e..4a28fb29adaa 100644 --- a/drivers/net/phy/mdio-bcm-unimac.c +++ b/drivers/net/phy/mdio-bcm-unimac.c @@ -92,10 +92,7 @@ static int unimac_mdio_poll(void *wait_func_data) usleep_range(1000, 2000); } while (--timeout); - if (!timeout) - return -ETIMEDOUT; - - return 0; + return -ETIMEDOUT; } static int unimac_mdio_read(struct mii_bus *bus, int phy_id, int reg)