[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251017193525.1457064-1-alok.a.tiwari@oracle.com>
Date: Fri, 17 Oct 2025 12:35:20 -0700
From: Alok Tiwari <alok.a.tiwari@...cle.com>
To: hkallweit1@...il.com, andrew@...n.ch, kuba@...nel.org,
andrew+netdev@...n.ch, davem@...emloft.net, edumazet@...gle.com,
pabeni@...hat.com, horms@...nel.org, linux@...linux.org.uk,
netdev@...r.kernel.org, alok.a.tiwari@...cle.com
Cc: alok.a.tiwarilinux@...il.com
Subject: [PATCH net-next 1/2] net: phy: micrel: simplify return in ksz9477_phy_errata()
ksz9477_phy_errata function currently assigns the return value of
genphy_restart_aneg() to a variable and then immediately returns it
err = genphy_restart_aneg(phydev);
if (err)
return err;
return err;
This can be simplified by directly returning the function call
result, as the intermediate variable and conditional are redundant.
Signed-off-by: Alok Tiwari <alok.a.tiwari@...cle.com>
---
drivers/net/phy/micrel.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
index 79ce3eb6752b..65994d97c403 100644
--- a/drivers/net/phy/micrel.c
+++ b/drivers/net/phy/micrel.c
@@ -2095,11 +2095,7 @@ static int ksz9477_phy_errata(struct phy_device *phydev)
return err;
}
- err = genphy_restart_aneg(phydev);
- if (err)
- return err;
-
- return err;
+ return genphy_restart_aneg(phydev);
}
static int ksz9477_config_init(struct phy_device *phydev)
--
2.50.1
Powered by blists - more mailing lists