> -----Original Message-----
> From: Intel-wired-lan <[email protected]> On Behalf
> Of Dave Ertman
> Sent: Tuesday, May 20, 2025 9:39 PM
> To: [email protected]
> Cc: Kitszel, Przemyslaw <[email protected]>
> Subject: [Intel-wired-lan] [PATCH iwl-next v2 2/8] [PATCH iwl-next
> 2/8] ice: replace u8 elements with bool where
> 
> appropriate
> 
> In preparation for the new LAG functionality implementation, there are
> a couple of existing LAG elements of the capabilities struct that
> should be bool instead of u8.  Since we are adding a new element to
> this struct that should also be a bool, fix the existing LAG u8 in
> this patch and eliminate !! operators where possible.
> 
> Reviewed-by: Przemek Kitszel <[email protected]>
> Signed-off-by: Dave Ertman <[email protected]>
> ---
>  drivers/net/ethernet/intel/ice/ice_common.c | 4 ++--
>  drivers/net/ethernet/intel/ice/ice_type.h   | 5 +++--
>  2 files changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/ice/ice_common.c
> b/drivers/net/ethernet/intel/ice/ice_common.c
> index f7fd0a2451de..29a02a0348b1 100644
> --- a/drivers/net/ethernet/intel/ice/ice_common.c
> +++ b/drivers/net/ethernet/intel/ice/ice_common.c
> @@ -2219,10 +2219,10 @@ ice_parse_common_caps(struct ice_hw *hw,
> struct ice_hw_common_caps *caps,
>                         caps->reset_restrict_support);
>               break;
>       case ICE_AQC_CAPS_FW_LAG_SUPPORT:
> -             caps->roce_lag = !!(number & ICE_AQC_BIT_ROCEV2_LAG);
> +             caps->roce_lag = number & ICE_AQC_BIT_ROCEV2_LAG;
>               ice_debug(hw, ICE_DBG_INIT, "%s: roce_lag = %u\n",
>                         prefix, caps->roce_lag);
> -             caps->sriov_lag = !!(number & ICE_AQC_BIT_SRIOV_LAG);
> +             caps->sriov_lag = number & ICE_AQC_BIT_SRIOV_LAG;
>               ice_debug(hw, ICE_DBG_INIT, "%s: sriov_lag = %u\n",
>                         prefix, caps->sriov_lag);
>               break;
> diff --git a/drivers/net/ethernet/intel/ice/ice_type.h
> b/drivers/net/ethernet/intel/ice/ice_type.h
> index 3d68f465952d..e40ea754f91b 100644
> --- a/drivers/net/ethernet/intel/ice/ice_type.h
> +++ b/drivers/net/ethernet/intel/ice/ice_type.h
> @@ -293,8 +293,9 @@ struct ice_hw_common_caps {
>       u8 dcb;
>       u8 ieee_1588;
>       u8 rdma;
> -     u8 roce_lag;
> -     u8 sriov_lag;
> +
> +     bool roce_lag;
> +     bool sriov_lag;
But why not u8 roce_lag:1; u8 sriov_lag:1;  ?

> 
>       bool nvm_update_pending_nvm;
>       bool nvm_update_pending_orom;
> --
> 2.49.0

Reply via email to