* [PATCH] net: phy: mdio-bcm-unimac: remove redundant !timeout check
@ 2019-03-27 16:15 Colin King
2019-03-27 16:21 ` Florian Fainelli
2019-03-27 21:27 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Colin King @ 2019-03-27 16:15 UTC (permalink / raw)
To: Andrew Lunn, Florian Fainelli, Heiner Kallweit, David S . Miller, netdev
Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
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 <colin.king@canonical.com>
---
drivers/net/phy/mdio-bcm-unimac.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
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)
--
2.20.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] net: phy: mdio-bcm-unimac: remove redundant !timeout check
2019-03-27 16:15 [PATCH] net: phy: mdio-bcm-unimac: remove redundant !timeout check Colin King
@ 2019-03-27 16:21 ` Florian Fainelli
2019-03-27 21:27 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Florian Fainelli @ 2019-03-27 16:21 UTC (permalink / raw)
To: Colin King, Andrew Lunn, Heiner Kallweit, David S . Miller, netdev
Cc: kernel-janitors, linux-kernel
On 3/27/19 9:15 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> 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 <colin.king@canonical.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
--
Florian
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] net: phy: mdio-bcm-unimac: remove redundant !timeout check
2019-03-27 16:15 [PATCH] net: phy: mdio-bcm-unimac: remove redundant !timeout check Colin King
2019-03-27 16:21 ` Florian Fainelli
@ 2019-03-27 21:27 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2019-03-27 21:27 UTC (permalink / raw)
To: colin.king
Cc: andrew, f.fainelli, hkallweit1, netdev, kernel-janitors, linux-kernel
From: Colin King <colin.king@canonical.com>
Date: Wed, 27 Mar 2019 16:15:20 +0000
> From: Colin Ian King <colin.king@canonical.com>
>
> 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 <colin.king@canonical.com>
Applied to net-next.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-03-27 21:27 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-27 16:15 [PATCH] net: phy: mdio-bcm-unimac: remove redundant !timeout check Colin King
2019-03-27 16:21 ` Florian Fainelli
2019-03-27 21:27 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).