mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH net-next] net: phy: air_en8811h: simplify en8811h_probe() trailing return
@ 2026-09-06 19:35 Vitaliy Sochnev
  2026-09-10  0:48 ` Jakub Kicinski
  0 siblings, 1 reply; 2+ messages in thread
From: Vitaliy Sochnev @ 2026-09-06 19:35 UTC (permalink / raw)
  To: netdev
  Cc: Vitaliy Sochnev, Andrew Lunn, Heiner Kallweit, Russell King,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	open list

en8811h_clk_provider_setup() is now the last statement in the
function, so the intermediate "if (ret) return ret; return 0;" is
redundant.

Signed-off-by: Vitaliy Sochnev <sochnev.v.74@gmail.com>
---
 drivers/net/phy/air_en8811h.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/net/phy/air_en8811h.c b/drivers/net/phy/air_en8811h.c
index ec7c44ca68e7..99221ee87977 100644
--- a/drivers/net/phy/air_en8811h.c
+++ b/drivers/net/phy/air_en8811h.c
@@ -1168,11 +1168,7 @@ static int en8811h_probe(struct phy_device *phydev)
 
 	priv->phydev = phydev;
 	/* Co-Clock Output */
-	ret = en8811h_clk_provider_setup(&phydev->mdio.dev, &priv->hw);
-	if (ret)
-		return ret;
-
-	return 0;
+	return en8811h_clk_provider_setup(&phydev->mdio.dev, &priv->hw);
 }
 
 static int an8811hb_config_serdes_polarity(struct phy_device *phydev)
-- 
2.55.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] net: phy: air_en8811h: simplify en8811h_probe() trailing return
  2026-09-06 19:35 [PATCH net-next] net: phy: air_en8811h: simplify en8811h_probe() trailing return Vitaliy Sochnev
@ 2026-09-10  0:48 ` Jakub Kicinski
  0 siblings, 0 replies; 2+ messages in thread
From: Jakub Kicinski @ 2026-09-10  0:48 UTC (permalink / raw)
  To: Vitaliy Sochnev
  Cc: netdev, Andrew Lunn, Heiner Kallweit, Russell King,
	David S. Miller, Eric Dumazet, Paolo Abeni, linux-kernel

On Sun,  6 Sep 2026 20:35:57 +0100 Vitaliy Sochnev wrote:
> en8811h_clk_provider_setup() is now the last statement in the
> function, so the intermediate "if (ret) return ret; return 0;" is
> redundant.
> 
> Signed-off-by: Vitaliy Sochnev <sochnev.v.74@gmail.com>
> ---
>  drivers/net/phy/air_en8811h.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/drivers/net/phy/air_en8811h.c b/drivers/net/phy/air_en8811h.c
> index ec7c44ca68e7..99221ee87977 100644
> --- a/drivers/net/phy/air_en8811h.c
> +++ b/drivers/net/phy/air_en8811h.c
> @@ -1168,11 +1168,7 @@ static int en8811h_probe(struct phy_device *phydev)
>  
>  	priv->phydev = phydev;
>  	/* Co-Clock Output */
> -	ret = en8811h_clk_provider_setup(&phydev->mdio.dev, &priv->hw);
> -	if (ret)
> -		return ret;
> -
> -	return 0;
> +	return en8811h_clk_provider_setup(&phydev->mdio.dev, &priv->hw);
>  }
>  
>  static int an8811hb_config_serdes_polarity(struct phy_device *phydev)

It's a personal preference, someone may think it's better to keep the
ret handling separate to avoid changing git blame when more code is
added. The shorter version is probably slightly better but not enough
to justify a cleanup of this sort IMO, sorry.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-09-10  0:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-06 19:35 [PATCH net-next] net: phy: air_en8811h: simplify en8811h_probe() trailing return Vitaliy Sochnev
2026-09-10  0:48 ` Jakub Kicinski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®