From: Johannes Berg <johannes@sipsolutions.net>
To: Anders Roxell <anders.roxell@linaro.org>
Cc: miriam.rachel.korenblit@intel.com, dan.carpenter@linaro.org,
arnd@arndb.de, linux-wireless@vger.kernel.org,
linux-kernel@vger.kernel.org,
Linux Kernel Functional Testing <lkft@linaro.org>
Subject: Re: [PATCH] wifi: iwlwifi: pcie: ensure RX_QUEUE_CB_SIZE fits bitfield for gcc-8|9
Date: Thu, 12 Jun 2025 21:46:33 +0200 [thread overview]
Message-ID: <5c75d32c9416dc0487f2cbb2b3b6708eec671137.camel@sipsolutions.net> (raw)
In-Reply-To: <aEsrmH7sDVvsmgLs@monster> (sfid-20250612_213349_818508_12002470)
>
> 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
next prev parent reply other threads:[~2025-06-12 19:46 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-12 13:07 [PATCH] wifi: iwlwifi: pcie: ensure RX_QUEUE_CB_SIZE fits bitfield for gcc-8|9 Anders Roxell
2025-06-12 13:17 ` Dan Carpenter
2025-06-12 15:21 ` Johannes Berg
2025-06-12 19:33 ` Anders Roxell
2025-06-12 19:46 ` Johannes Berg [this message]
2025-06-12 19:48 ` Arnd Bergmann
2025-06-14 8:21 ` David Laight
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5c75d32c9416dc0487f2cbb2b3b6708eec671137.camel@sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=anders.roxell@linaro.org \
--cc=arnd@arndb.de \
--cc=dan.carpenter@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=lkft@linaro.org \
--cc=miriam.rachel.korenblit@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox