Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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.

Signed-off-by: Yury Norov (NVIDIA) <yury.norov@gmail.com>
Link: https://patch.msgid.link/20250913182837.206800-1-yury.norov@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>

authored by

Yury Norov (NVIDIA) and committed by
Paolo Abeni
29fa7f9e dfc0882a

+2 -6
+2 -6
drivers/net/phy/nxp-c45-tja11xx-macsec.c
··· 926 926 struct phy_device *phydev = ctx->phydev; 927 927 struct nxp_c45_phy *priv = phydev->priv; 928 928 struct nxp_c45_secy *phy_secy; 929 - int any_bit_set; 930 929 931 930 phy_secy = nxp_c45_find_secy(&priv->macsec->secy_list, ctx->secy->sci); 932 931 if (IS_ERR(phy_secy)) ··· 938 939 if (phy_secy->rx_sc) 939 940 nxp_c45_rx_sc_en(phydev, phy_secy->rx_sc, true); 940 941 941 - any_bit_set = find_first_bit(priv->macsec->secy_bitmap, TX_SC_MAX); 942 - if (any_bit_set == TX_SC_MAX) 942 + if (bitmap_empty(priv->macsec->secy_bitmap, TX_SC_MAX)) 943 943 nxp_c45_macsec_en(phydev, true); 944 944 945 945 set_bit(phy_secy->secy_id, priv->macsec->secy_bitmap); ··· 951 953 struct phy_device *phydev = ctx->phydev; 952 954 struct nxp_c45_phy *priv = phydev->priv; 953 955 struct nxp_c45_secy *phy_secy; 954 - int any_bit_set; 955 956 956 957 phy_secy = nxp_c45_find_secy(&priv->macsec->secy_list, ctx->secy->sci); 957 958 if (IS_ERR(phy_secy)) ··· 964 967 nxp_c45_set_rx_sc0_impl(phydev, false); 965 968 966 969 clear_bit(phy_secy->secy_id, priv->macsec->secy_bitmap); 967 - any_bit_set = find_first_bit(priv->macsec->secy_bitmap, TX_SC_MAX); 968 - if (any_bit_set == TX_SC_MAX) 970 + if (bitmap_empty(priv->macsec->secy_bitmap, TX_SC_MAX)) 969 971 nxp_c45_macsec_en(phydev, false); 970 972 971 973 return 0;