[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200526210456.GH3972@piout.net>
Date: Tue, 26 May 2020 23:04:56 +0200
From: Alexandre Belloni <alexandre.belloni@...tlin.com>
To: Antoine Tenart <antoine.tenart@...tlin.com>
Cc: davem@...emloft.net, andrew@...n.ch, f.fainelli@...il.com,
hkallweit1@...il.com, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, thomas.petazzoni@...tlin.com,
allan.nielsen@...rochip.com
Subject: Re: [PATCH net-next 2/4] net: phy: mscc-miim: remove redundant
timeout check
On 26/05/2020 18:22:54+0200, Antoine Ténart wrote:
> readl_poll_timeout already returns -ETIMEDOUT if the condition isn't
> satisfied, there's no need to check again the condition after calling
> it. Remove the redundant timeout check.
>
> Signed-off-by: Antoine Tenart <antoine.tenart@...tlin.com>
Reviewed-by: Alexandre Belloni <alexandre.belloni@...tlin.com>
> ---
> drivers/net/phy/mdio-mscc-miim.c | 8 ++------
> 1 file changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/net/phy/mdio-mscc-miim.c b/drivers/net/phy/mdio-mscc-miim.c
> index 0b7544f593fb..42119f661452 100644
> --- a/drivers/net/phy/mdio-mscc-miim.c
> +++ b/drivers/net/phy/mdio-mscc-miim.c
> @@ -43,12 +43,8 @@ static int mscc_miim_wait_ready(struct mii_bus *bus)
> struct mscc_miim_dev *miim = bus->priv;
> u32 val;
>
> - readl_poll_timeout(miim->regs + MSCC_MIIM_REG_STATUS, val,
> - !(val & MSCC_MIIM_STATUS_STAT_BUSY), 50, 10000);
> - if (val & MSCC_MIIM_STATUS_STAT_BUSY)
> - return -ETIMEDOUT;
> -
> - return 0;
> + return readl_poll_timeout(miim->regs + MSCC_MIIM_REG_STATUS, val,
> + !(val & MSCC_MIIM_STATUS_STAT_BUSY), 50, 10000);
> }
>
> static int mscc_miim_read(struct mii_bus *bus, int mii_id, int regnum)
> --
> 2.26.2
>
--
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
Powered by blists - more mailing lists