[PATCH 1/2] ice: simplify ice_pf_state_is_nominal()

Loktionov, Aleksandr aleksandr.loktionov at intel.com
Tue Sep 8 13:12:41 UTC 2026



> -----Original Message-----
> From: Yury Norov <ynorov at nvidia.com>
> Sent: Thursday, September 3, 2026 3:21 PM
> To: Nguyen, Anthony L <anthony.l.nguyen at intel.com>; Kitszel,
> Przemyslaw <przemyslaw.kitszel at intel.com>; Andrew Lunn
> <andrew+netdev at lunn.ch>; 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>; intel-wired-lan at lists.osuosl.org;
> netdev at vger.kernel.org; open list <linux-kernel at vger.kernel.org>
> Cc: Yury Norov <ynorov at nvidia.com>
> Subject: [PATCH 1/2] ice: simplify ice_pf_state_is_nominal()
> 
> The function creates a temporary mask on stack just to check that
> first ICE_STATE_NOMINAL_CHECK_BITS is empty. Simplify it by using the
> ice_pf_state_is_nominal().
> 
> Signed-off-by: Yury Norov <ynorov at nvidia.com>
> ---
>  drivers/net/ethernet/intel/ice/ice_lib.c | 8 +-------
>  1 file changed, 1 insertion(+), 7 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/ice/ice_lib.c
> b/drivers/net/ethernet/intel/ice/ice_lib.c
> index 9e08db376d3d..73996e3022ef 100644
> --- a/drivers/net/ethernet/intel/ice/ice_lib.c
> +++ b/drivers/net/ethernet/intel/ice/ice_lib.c
> @@ -1705,16 +1705,10 @@ static void ice_vsi_set_rss_flow_fld(struct
> ice_vsi *vsi)
>   */
>  bool ice_pf_state_is_nominal(struct ice_pf *pf)  {
> -	DECLARE_BITMAP(check_bits, ICE_STATE_NBITS) = { 0 };
> -
>  	if (!pf)
>  		return false;
> 
> -	bitmap_set(check_bits, 0, ICE_STATE_NOMINAL_CHECK_BITS);
> -	if (bitmap_intersects(pf->state, check_bits, ICE_STATE_NBITS))
> -		return false;
> -
> -	return true;
> +	return bitmap_empty(pf->state, ICE_STATE_NOMINAL_CHECK_BITS);
>  }
> 
>  #define ICE_FW_MODE_REC_M BIT(1)
> --
> 2.53.0

Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov at intel.com>


More information about the Intel-wired-lan mailing list