mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-17 02:15:57 +00:00
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 <hkallweit1@gmail.com> Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Link: https://patch.msgid.link/b0832102-28ab-4223-b879-91fb1fc11278@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
6b998404c7
commit
3bf8163a36
@ -1523,20 +1523,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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user