[PATCH 5/9] net: phy: use linkmode_and() return value in genphy_c45_eee_is_active()

From: Yury Norov

Date: Mon Sep 07 2026 - 18:00:51 EST


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@xxxxxxxxxx>
---
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