netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: phy: c45: don't use temporary linkmode bitmaps in genphy_c45_ethtool_get_eee
@ 2024-11-12 20:33 Heiner Kallweit
  2024-11-12 21:18 ` Russell King (Oracle)
  2024-11-14  3:00 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Heiner Kallweit @ 2024-11-12 20:33 UTC (permalink / raw)
  To: Russell King - ARM Linux, Andrew Lunn, Paolo Abeni,
	Jakub Kicinski, David Miller, Eric Dumazet
  Cc: netdev@vger.kernel.org

genphy_c45_eee_is_active() populates both bitmaps only if it returns
successfully. So we can avoid the overhead of the temporary bitmaps.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 drivers/net/phy/phy-c45.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/net/phy/phy-c45.c b/drivers/net/phy/phy-c45.c
index 29cc22a4b..96a51a0b2 100644
--- a/drivers/net/phy/phy-c45.c
+++ b/drivers/net/phy/phy-c45.c
@@ -1521,20 +1521,17 @@ EXPORT_SYMBOL(genphy_c45_eee_is_active);
 int genphy_c45_ethtool_get_eee(struct phy_device *phydev,
 			       struct ethtool_keee *data)
 {
-	__ETHTOOL_DECLARE_LINK_MODE_MASK(adv) = {};
-	__ETHTOOL_DECLARE_LINK_MODE_MASK(lp) = {};
 	bool is_enabled;
 	int ret;
 
-	ret = genphy_c45_eee_is_active(phydev, adv, lp, &is_enabled);
+	ret = genphy_c45_eee_is_active(phydev, data->advertised,
+				       data->lp_advertised, &is_enabled);
 	if (ret < 0)
 		return ret;
 
 	data->eee_enabled = is_enabled;
 	data->eee_active = ret;
 	linkmode_copy(data->supported, phydev->supported_eee);
-	linkmode_copy(data->advertised, adv);
-	linkmode_copy(data->lp_advertised, lp);
 
 	return 0;
 }
-- 
2.47.0


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

* Re: [PATCH net-next] net: phy: c45: don't use temporary linkmode bitmaps in genphy_c45_ethtool_get_eee
  2024-11-12 20:33 [PATCH net-next] net: phy: c45: don't use temporary linkmode bitmaps in genphy_c45_ethtool_get_eee Heiner Kallweit
@ 2024-11-12 21:18 ` Russell King (Oracle)
  2024-11-14  3:00 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Russell King (Oracle) @ 2024-11-12 21:18 UTC (permalink / raw)
  To: Heiner Kallweit
  Cc: Andrew Lunn, Paolo Abeni, Jakub Kicinski, David Miller,
	Eric Dumazet, netdev@vger.kernel.org

On Tue, Nov 12, 2024 at 09:33:11PM +0100, Heiner Kallweit wrote:
> genphy_c45_eee_is_active() populates both bitmaps only if it returns
> successfully. So we can avoid the overhead of the temporary bitmaps.
> 
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>

Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>

Thanks!
-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!

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

* Re: [PATCH net-next] net: phy: c45: don't use temporary linkmode bitmaps in genphy_c45_ethtool_get_eee
  2024-11-12 20:33 [PATCH net-next] net: phy: c45: don't use temporary linkmode bitmaps in genphy_c45_ethtool_get_eee Heiner Kallweit
  2024-11-12 21:18 ` Russell King (Oracle)
@ 2024-11-14  3:00 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-11-14  3:00 UTC (permalink / raw)
  To: Heiner Kallweit; +Cc: linux, andrew, pabeni, kuba, davem, edumazet, netdev

Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Tue, 12 Nov 2024 21:33:11 +0100 you wrote:
> genphy_c45_eee_is_active() populates both bitmaps only if it returns
> successfully. So we can avoid the overhead of the temporary bitmaps.
> 
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
> ---
>  drivers/net/phy/phy-c45.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)

Here is the summary with links:
  - [net-next] net: phy: c45: don't use temporary linkmode bitmaps in genphy_c45_ethtool_get_eee
    https://git.kernel.org/netdev/net-next/c/3bf8163a36ad

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2024-11-14  3:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-12 20:33 [PATCH net-next] net: phy: c45: don't use temporary linkmode bitmaps in genphy_c45_ethtool_get_eee Heiner Kallweit
2024-11-12 21:18 ` Russell King (Oracle)
2024-11-14  3:00 ` patchwork-bot+netdevbpf

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).