Skip to contentSkip to conversation

net: phy: nxp-c45-tja11xx: use bitmap_empty() where appropriate

PATCH Applied Yury Norov (NVIDIA) 2 participants 2 messages Sep 13, 2025 – Sep 16, 2025

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: phy: nxp-c45-tja11xx: use bitmap_empty() where appropriate

The driver opencodes bitmap_empty() in a couple of funcitons. Switch to the proper and more verbose API.

---
 drivers/net/phy/nxp-c45-tja11xx-macsec.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/net/phy/nxp-c45-tja11xx-macsec.c +2 -6
index 550ef08970f4..fc897ba79b03 100644
@@ -926,7 +926,6 @@ static int nxp_c45_mdo_dev_open(struct macsec_context *ctx)
 	struct phy_device *phydev = ctx->phydev;
 	struct nxp_c45_phy *priv = phydev->priv;
 	struct nxp_c45_secy *phy_secy;
-	int any_bit_set;
 
 	phy_secy = nxp_c45_find_secy(&priv->macsec->secy_list, ctx->secy->sci);
 	if (IS_ERR(phy_secy))
@@ -939,8 +938,7 @@ static int nxp_c45_mdo_dev_open(struct macsec_context *ctx)
 	if (phy_secy->rx_sc)
 		nxp_c45_rx_sc_en(phydev, phy_secy->rx_sc, true);
 
-	any_bit_set = find_first_bit(priv->macsec->secy_bitmap, TX_SC_MAX);
-	if (any_bit_set == TX_SC_MAX)
+	if (bitmap_empty(priv->macsec->secy_bitmap, TX_SC_MAX))
 		nxp_c45_macsec_en(phydev, true);
 
 	set_bit(phy_secy->secy_id, priv->macsec->secy_bitmap);
@@ -953,7 +951,6 @@ static int nxp_c45_mdo_dev_stop(struct macsec_context *ctx)
 	struct phy_device *phydev = ctx->phydev;
 	struct nxp_c45_phy *priv = phydev->priv;
 	struct nxp_c45_secy *phy_secy;
-	int any_bit_set;
 
 	phy_secy = nxp_c45_find_secy(&priv->macsec->secy_list, ctx->secy->sci);
 	if (IS_ERR(phy_secy))
@@ -967,8 +964,7 @@ static int nxp_c45_mdo_dev_stop(struct macsec_context *ctx)
 	nxp_c45_set_rx_sc0_impl(phydev, false);
 
 	clear_bit(phy_secy->secy_id, priv->macsec->secy_bitmap);
-	any_bit_set = find_first_bit(priv->macsec->secy_bitmap, TX_SC_MAX);
-	if (any_bit_set == TX_SC_MAX)
+	if (bitmap_empty(priv->macsec->secy_bitmap, TX_SC_MAX))
 		nxp_c45_macsec_en(phydev, false);
 
 	return 0;
Signature · 1 line
2.43.0
#1 lore raw
This patch was applied to netdev/net-next.git (main) by Paolo Abeni <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Paolo Abeni <[email protected]>:

Quoted 7 lines · On Sat, 13 Sep 2025 14:28:36 -0400 you wrote:

The driver opencodes bitmap_empty() in a couple of funcitons. Switch to the proper and more verbose API.

---
 drivers/net/phy/nxp-c45-tja11xx-macsec.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

Here is the summary with links:
- net: phy: nxp-c45-tja11xx: use bitmap_empty() where appropriate

    https://git.kernel.org/netdev/net-next/c/29fa7f9e5adf

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html