Search Linux Wireless

Re: [PATCH] wifi: iwlwifi: pcie: ensure RX_QUEUE_CB_SIZE fits bitfield for gcc-8|9

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 
> Would it help if I indent like this?

Yeah, maybe? I actually misread it and thought the & went outside
FIELD_PREP() ...


> diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info.c b/drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info.c
> index cb36baac14da..5bb81ed7db79 100644
> --- a/drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info.c
> +++ b/drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info.c
> @@ -204,9 +204,10 @@ int iwl_pcie_ctxt_info_init(struct iwl_trans *trans,
>  
>  	WARN_ON(RX_QUEUE_CB_SIZE(iwl_trans_get_num_rbds(trans)) > 12);
>  	control_flags = IWL_CTXT_INFO_TFD_FORMAT_LONG;
> -	control_flags |=
> -		u32_encode_bits(RX_QUEUE_CB_SIZE(iwl_trans_get_num_rbds(trans)),
> -				IWL_CTXT_INFO_RB_CB_SIZE);
> +	/* This should just be u32_encode_bits() but gcc-8 and gcc-9 fail to build */
> +	control_flags |= FIELD_PREP(IWL_CTXT_INFO_RB_CB_SIZE,
> +				    RX_QUEUE_CB_SIZE(iwl_trans_get_num_rbds(trans)) &
> +				    FIELD_MAX(IWL_CTXT_INFO_RB_CB_SIZE));

Also now that I think more about it, this really just adds the part with
the masking ("& FIELD_MAX()"), is it even necessary to use FIELD_PREP()
rather than u32_encode_bits()?

johannes





[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux