lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5c75d32c9416dc0487f2cbb2b3b6708eec671137.camel@sipsolutions.net>
Date: Thu, 12 Jun 2025 21:46:33 +0200
From: Johannes Berg <johannes@...solutions.net>
To: Anders Roxell <anders.roxell@...aro.org>
Cc: miriam.rachel.korenblit@...el.com, dan.carpenter@...aro.org,
 arnd@...db.de, 	linux-wireless@...r.kernel.org,
 linux-kernel@...r.kernel.org, Linux Kernel Functional Testing	
 <lkft@...aro.org>
Subject: Re: [PATCH] wifi: iwlwifi: pcie: ensure RX_QUEUE_CB_SIZE fits
 bitfield for gcc-8|9

> 
> 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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ