Skip to contentSkip to conversation

net: phy: corrected the return value for genphy_check_and_restart_aneg and genphy_c45_check_and_restart_aneg

PATCH In review Sudheesh Mavila 4 participants 4 messages Feb 26, 2020 – Feb 27, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 net: phy: corrected the return value for genphy_check_and_restart_aneg and genphy_c45_check_and_restart_aneg

When auto-negotiation is not required, return value should be zero.

Changes v1->v2:
- improved comments and code as Andrew Lunn and Heiner Kallweit suggestion
- fixed issue in genphy_c45_check_and_restart_aneg as Russell King suggestion.

Fixes 2a10ab043ac5 ("net: phy: add genphy_check_and_restart_aneg()")
Fixes 1af9f16840e9 ("net: phy: add genphy_c45_check_and_restart_aneg()")
---
 drivers/net/phy/phy-c45.c    | 6 +++---
 drivers/net/phy/phy_device.c | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)
drivers/net/phy/phy-c45.c +3 -3
index a1caeee12236..dd2e23fb67c0 100644
@@ -167,7 +167,7 @@ EXPORT_SYMBOL_GPL(genphy_c45_restart_aneg);
  */
 int genphy_c45_check_and_restart_aneg(struct phy_device *phydev, bool restart)
 {
-	int ret = 0;
+	int ret;
 
 	if (!restart) {
 		/* Configure and restart aneg if it wasn't set before */
@@ -180,9 +180,9 @@ int genphy_c45_check_and_restart_aneg(struct phy_device *phydev, bool restart)
 	}
 
 	if (restart)
-		ret = genphy_c45_restart_aneg(phydev);
+		return genphy_c45_restart_aneg(phydev);
 
-	return ret;
+	return 0;
 }
 EXPORT_SYMBOL_GPL(genphy_c45_check_and_restart_aneg);
 
drivers/net/phy/phy_device.c +3 -3
index 6a5056e0ae77..8b16775b9324 100644
@@ -1792,7 +1792,7 @@ EXPORT_SYMBOL(genphy_restart_aneg);
  */
 int genphy_check_and_restart_aneg(struct phy_device *phydev, bool restart)
 {
-	int ret = 0;
+	int ret;
 
 	if (!restart) {
 		/* Advertisement hasn't changed, but maybe aneg was never on to
@@ -1807,9 +1807,9 @@ int genphy_check_and_restart_aneg(struct phy_device *phydev, bool restart)
 	}
 
 	if (restart)
-		ret = genphy_restart_aneg(phydev);
+		return genphy_restart_aneg(phydev);
 
-	return ret;
+	return 0;
 }
 EXPORT_SYMBOL(genphy_check_and_restart_aneg);
 
Signature · 1 line
2.17.1
maintainer Reviewed-by on v2 1/1
#1 lore raw
Quoted 11 lines · Sudheesh Mavila

When auto-negotiation is not required, return value should be zero.

Changes v1->v2:
- improved comments and code as Andrew Lunn and Heiner Kallweit suggestion
- fixed issue in genphy_c45_check_and_restart_aneg as Russell King suggestion.

Fixes 2a10ab043ac5 ("net: phy: add genphy_check_and_restart_aneg()")
Fixes 1af9f16840e9 ("net: phy: add genphy_c45_check_and_restart_aneg()")

---

maintainer Reviewed-by on v2 1/1
#2 lore raw

Re: [PATCH v2 ] net: phy: corrected the return value for genphy_check_and_restart_aneg ?and genphy_c45_check_and_restart_aneg

In reply to Sudheesh Mavila
Quoted 10 lines · Sudheesh Mavila

When auto-negotiation is not required, return value should be zero.

Changes v1->v2:
- improved comments and code as Andrew Lunn and Heiner Kallweit suggestion
- fixed issue in genphy_c45_check_and_restart_aneg as Russell King suggestion.

Fixes 2a10ab043ac5 ("net: phy: add genphy_check_and_restart_aneg()")
Fixes 1af9f16840e9 ("net: phy: add genphy_c45_check_and_restart_aneg()")

Andrew

maintainer
#3 lore raw
In reply to Sudheesh Mavila

From: Sudheesh Mavila <[email protected]>
Date: Wed, 26 Feb 2020 12:40:45 +0530

Quoted 10 lines

When auto-negotiation is not required, return value should be zero.

Changes v1->v2:
- improved comments and code as Andrew Lunn and Heiner Kallweit suggestion
- fixed issue in genphy_c45_check_and_restart_aneg as Russell King suggestion.

Fixes 2a10ab043ac5 ("net: phy: add genphy_check_and_restart_aneg()")
Fixes 1af9f16840e9 ("net: phy: add genphy_c45_check_and_restart_aneg()")

Applied and queued up for -stable, thanks.