[PATCH 5/9] net: phy: use linkmode_and() return value in genphy_c45_eee_is_active()
Loktionov, Aleksandr
aleksandr.loktionov at intel.com
Tue Sep 8 13:06:42 UTC 2026
> -----Original Message-----
> From: Yury Norov <yury.norov at gmail.com>
> Sent: Monday, September 7, 2026 11:55 PM
> To: Andrew Lunn <andrew at lunn.ch>; Heiner Kallweit
> <hkallweit1 at gmail.com>; Russell King <linux at armlinux.org.uk>; Raju
> Rangoju <Raju.Rangoju at amd.com>; Prashanth Kumar K R
> <PrashanthKumar.K.R at amd.com>; Nguyen, Anthony L
> <anthony.l.nguyen at intel.com>; Kitszel, Przemyslaw
> <przemyslaw.kitszel at intel.com>; Jian Shen <shenjian15 at huawei.com>;
> Jijie Shao <shaojijie at huawei.com>; David S. Miller
> <davem at davemloft.net>; Eric Dumazet <edumazet at google.com>; Jakub
> Kicinski <kuba at kernel.org>; Paolo Abeni <pabeni at redhat.com>; linux-
> kernel at vger.kernel.org; netdev at vger.kernel.org; intel-wired-
> lan at lists.osuosl.org; linux-usb at vger.kernel.org
> Cc: Yury Norov <ynorov at nvidia.com>; Yury Norov <yury.norov at gmail.com>;
> Rasmus Villemoes <linux at rasmusvillemoes.dk>; Andrew Morton
> <akpm at linux-foundation.org>
> Subject: [PATCH 5/9] net: phy: use linkmode_and() return value in
> genphy_c45_eee_is_active()
>
> Use the return value of linkmode_and() to detect an empty set of
> common EEE modes and get rid of a separate linkmode_empty() call.
>
> Signed-off-by: Yury Norov <ynorov at nvidia.com>
> ---
> drivers/net/phy/phy-c45.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/net/phy/phy-c45.c b/drivers/net/phy/phy-c45.c
> index 870920311f9a..27da1b9ddbc5 100644
> --- a/drivers/net/phy/phy-c45.c
> +++ b/drivers/net/phy/phy-c45.c
> @@ -1623,8 +1623,7 @@ int genphy_c45_eee_is_active(struct phy_device
> *phydev, unsigned long *lp)
> if (lp)
> linkmode_copy(lp, tmp_lp);
>
> - linkmode_and(common, phydev->advertising_eee, tmp_lp);
> - if (linkmode_empty(common))
> + if (!linkmode_and(common, phydev->advertising_eee, tmp_lp))
> return 0;
>
> return phy_check_valid(phydev->speed, phydev->duplex, common);
> --
> 2.53.0
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov at intel.com>
More information about the Intel-wired-lan
mailing list