[PATCH net-next 02/11] net: stmmac: dwmac-visconti: Make visconti_eth_clock_remove() return void

Simon Horman simon.horman at corigine.com
Sun Apr 2 10:02:26 PDT 2023


On Sun, Apr 02, 2023 at 04:30:16PM +0200, Uwe Kleine-König wrote:
> The function returns zero unconditionally. Change it to return void
> instead which simplifies one caller as error handing becomes
> unnecessary.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig at pengutronix.de>

...

> @@ -267,9 +265,7 @@ static int visconti_eth_dwmac_remove(struct platform_device *pdev)
>  
>  	stmmac_pltfr_remove(pdev);
>  
> -	err = visconti_eth_clock_remove(pdev);
> -	if (err < 0)
> -		dev_err(&pdev->dev, "failed to remove clock: %d\n", err);
> +	visconti_eth_clock_remove(pdev);
>  
>  	stmmac_remove_config_dt(pdev, priv->plat);

err is now returned uninitialised by this function.

I see that err is removed in a later patch.
But perhaps it's best to make this patch clean in this regard too.





More information about the linux-arm-kernel mailing list