Skip to content

Commit 3bf8163

Browse files
hkallweitkuba-moo
authored andcommitted
net: phy: c45: don't use temporary linkmode bitmaps in genphy_c45_ethtool_get_eee
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 <[email protected]> Reviewed-by: Russell King (Oracle) <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 6b99840 commit 3bf8163

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

drivers/net/phy/phy-c45.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1523,20 +1523,17 @@ EXPORT_SYMBOL(genphy_c45_eee_is_active);
15231523
int genphy_c45_ethtool_get_eee(struct phy_device *phydev,
15241524
struct ethtool_keee *data)
15251525
{
1526-
__ETHTOOL_DECLARE_LINK_MODE_MASK(adv) = {};
1527-
__ETHTOOL_DECLARE_LINK_MODE_MASK(lp) = {};
15281526
bool is_enabled;
15291527
int ret;
15301528

1531-
ret = genphy_c45_eee_is_active(phydev, adv, lp, &is_enabled);
1529+
ret = genphy_c45_eee_is_active(phydev, data->advertised,
1530+
data->lp_advertised, &is_enabled);
15321531
if (ret < 0)
15331532
return ret;
15341533

15351534
data->eee_enabled = is_enabled;
15361535
data->eee_active = ret;
15371536
linkmode_copy(data->supported, phydev->supported_eee);
1538-
linkmode_copy(data->advertised, adv);
1539-
linkmode_copy(data->lp_advertised, lp);
15401537

15411538
return 0;
15421539
}

0 commit comments

Comments
 (0)