* [PATCH v2 ] net: phy: corrected the return value for genphy_check_and_restart_aneg and genphy_c45_check_and_restart_aneg
@ 2020-02-26 7:10 Sudheesh Mavila
2020-02-26 7:14 ` Heiner Kallweit
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Sudheesh Mavila @ 2020-02-26 7:10 UTC (permalink / raw)
To: sudheesh.mavila, andrew, f.fainelli, hkallweit1, linux, davem,
netdev, linux-kernel
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()")
Signed-off-by: Sudheesh Mavila <sudheesh.mavila@amd.com>
---
drivers/net/phy/phy-c45.c | 6 +++---
drivers/net/phy/phy_device.c | 6 +++---
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/net/phy/phy-c45.c b/drivers/net/phy/phy-c45.c
index a1caeee12236..dd2e23fb67c0 100644
--- a/drivers/net/phy/phy-c45.c
+++ b/drivers/net/phy/phy-c45.c
@@ -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);
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 6a5056e0ae77..8b16775b9324 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -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);
--
2.17.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2 ] net: phy: corrected the return value for genphy_check_and_restart_aneg and genphy_c45_check_and_restart_aneg
2020-02-26 7:10 [PATCH v2 ] net: phy: corrected the return value for genphy_check_and_restart_aneg and genphy_c45_check_and_restart_aneg Sudheesh Mavila
@ 2020-02-26 7:14 ` Heiner Kallweit
2020-02-26 15:51 ` [PATCH v2 ] net: phy: corrected the return value for genphy_check_and_restart_aneg ?and genphy_c45_check_and_restart_aneg Andrew Lunn
2020-02-27 4:42 ` [PATCH v2 ] net: phy: corrected the return value for genphy_check_and_restart_aneg and genphy_c45_check_and_restart_aneg David Miller
2 siblings, 0 replies; 4+ messages in thread
From: Heiner Kallweit @ 2020-02-26 7:14 UTC (permalink / raw)
To: Sudheesh Mavila, andrew, f.fainelli, linux, davem, netdev, linux-kernel
On 26.02.2020 08:10, Sudheesh Mavila wrote:
> 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()")
> Signed-off-by: Sudheesh Mavila <sudheesh.mavila@amd.com>
> ---
Reviewed-by: Heiner Kallweit <hkallweit1@gmail.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2 ] net: phy: corrected the return value for genphy_check_and_restart_aneg ?and genphy_c45_check_and_restart_aneg
2020-02-26 7:10 [PATCH v2 ] net: phy: corrected the return value for genphy_check_and_restart_aneg and genphy_c45_check_and_restart_aneg Sudheesh Mavila
2020-02-26 7:14 ` Heiner Kallweit
@ 2020-02-26 15:51 ` Andrew Lunn
2020-02-27 4:42 ` [PATCH v2 ] net: phy: corrected the return value for genphy_check_and_restart_aneg and genphy_c45_check_and_restart_aneg David Miller
2 siblings, 0 replies; 4+ messages in thread
From: Andrew Lunn @ 2020-02-26 15:51 UTC (permalink / raw)
To: Sudheesh Mavila
Cc: f.fainelli, hkallweit1, linux, davem, netdev, linux-kernel
On Wed, Feb 26, 2020 at 12:40:45PM +0530, Sudheesh Mavila wrote:
> 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()")
> Signed-off-by: Sudheesh Mavila <sudheesh.mavila@amd.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2 ] net: phy: corrected the return value for genphy_check_and_restart_aneg and genphy_c45_check_and_restart_aneg
2020-02-26 7:10 [PATCH v2 ] net: phy: corrected the return value for genphy_check_and_restart_aneg and genphy_c45_check_and_restart_aneg Sudheesh Mavila
2020-02-26 7:14 ` Heiner Kallweit
2020-02-26 15:51 ` [PATCH v2 ] net: phy: corrected the return value for genphy_check_and_restart_aneg ?and genphy_c45_check_and_restart_aneg Andrew Lunn
@ 2020-02-27 4:42 ` David Miller
2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2020-02-27 4:42 UTC (permalink / raw)
To: sudheesh.mavila
Cc: andrew, f.fainelli, hkallweit1, linux, netdev, linux-kernel
From: Sudheesh Mavila <sudheesh.mavila@amd.com>
Date: Wed, 26 Feb 2020 12:40:45 +0530
> 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()")
> Signed-off-by: Sudheesh Mavila <sudheesh.mavila@amd.com>
Applied and queued up for -stable, thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-02-27 4:42 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-26 7:10 [PATCH v2 ] net: phy: corrected the return value for genphy_check_and_restart_aneg and genphy_c45_check_and_restart_aneg Sudheesh Mavila
2020-02-26 7:14 ` Heiner Kallweit
2020-02-26 15:51 ` [PATCH v2 ] net: phy: corrected the return value for genphy_check_and_restart_aneg ?and genphy_c45_check_and_restart_aneg Andrew Lunn
2020-02-27 4:42 ` [PATCH v2 ] net: phy: corrected the return value for genphy_check_and_restart_aneg and genphy_c45_check_and_restart_aneg David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).