Re: [PATCH v2 net-next] mdio_bus: Fix PTR_ERR() usage after initialization to constant

From: David Miller
Date: Mon Feb 18 2019 - 19:36:14 EST


From: YueHaibing <yuehaibing@xxxxxxxxxx>
Date: Sat, 16 Feb 2019 10:59:35 +0800

> Fix coccinelle warning:
>
> ./drivers/net/phy/mdio_bus.c:51:5-12: ERROR: PTR_ERR applied after initialization to constant on line 44
> ./drivers/net/phy/mdio_bus.c:52:5-12: ERROR: PTR_ERR applied after initialization to constant on line 44
>
> fix this by using IS_ERR before PTR_ERR
>
> Fixes: bafbdd527d56 ("phylib: Add device reset GPIO support")
> Signed-off-by: YueHaibing <yuehaibing@xxxxxxxxxx>
> ---
> v2: remove variable 'ret'

Applied.