From: "Korenblit, Miriam Rachel" <miriam.rachel.korenblit@intel.com>
To: "Juan José Arboleda" <soyjuanarbol@gmail.com>,
"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: "kvalo@kernel.org" <kvalo@kernel.org>
Subject: RE: [PATCH v2 2/3] iwlwifi: mvm: Enclose multi-statement macro in a do while
Date: Thu, 21 Nov 2024 20:13:24 +0000 [thread overview]
Message-ID: <MW5PR11MB581014711CD5F3E2812062E9A3222@MW5PR11MB5810.namprd11.prod.outlook.com> (raw)
In-Reply-To: <61d25f02322b875dd9eb37ea992dc62be7c75840.1724103043.git.soyjuanarbol@gmail.com>
> -----Original Message-----
> From: Juan José Arboleda <soyjuanarbol@gmail.com>
> Sent: Tuesday, 20 August 2024 0:45
> To: linux-wireless@vger.kernel.org; linux-kernel@vger.kernel.org
> Cc: Korenblit, Miriam Rachel <miriam.rachel.korenblit@intel.com>;
> kvalo@kernel.org; Juan José Arboleda <soyjuanarbol@gmail.com>
> Subject: [PATCH v2 2/3] iwlwifi: mvm: Enclose multi-statement macro in a do
> while
>
> This patch encloses the `CHECK_BW` macro inside a do while as preferred by the
> guidelines.
>
> This change is purely stylistic and do not affect the functionality of the code.
>
> Signed-off-by: Juan José Arboleda <soyjuanarbol@gmail.com>
> ---
> drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 11 +++++++----
> 1 file changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c
> b/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c
> index 1a210d0c22b3..6366779ccaf2 100644
> --- a/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c
> +++ b/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c
> @@ -1043,10 +1043,13 @@ iwl_mvm_decode_he_phy_ru_alloc(struct
> iwl_mvm_rx_phy_data *phy_data,
>
> cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA2_PRISEC_80_SEC);
>
> #define CHECK_BW(bw) \
> -
> BUILD_BUG_ON(IEEE80211_RADIOTAP_HE_MU_FLAGS2_BW_FROM_SI
> G_A_BW_ ## bw ## MHZ != \
> - RATE_MCS_CHAN_WIDTH_##bw >>
> RATE_MCS_CHAN_WIDTH_POS); \
> - BUILD_BUG_ON(IEEE80211_RADIOTAP_HE_DATA6_TB_PPDU_BW_ ##
> bw ## MHZ != \
> - RATE_MCS_CHAN_WIDTH_##bw >>
> RATE_MCS_CHAN_WIDTH_POS)
> + do { \
> +
> BUILD_BUG_ON(IEEE80211_RADIOTAP_HE_MU_FLAGS2_BW_FROM_SI
> G_A_BW_ ## bw ## MHZ != \
> + RATE_MCS_CHAN_WIDTH_##bw >>
> RATE_MCS_CHAN_WIDTH_POS); \
> +
> BUILD_BUG_ON(IEEE80211_RADIOTAP_HE_DATA6_TB_PPDU_BW_ ##
> bw ## MHZ != \
> + RATE_MCS_CHAN_WIDTH_##bw >>
> RATE_MCS_CHAN_WIDTH_POS); \
> + } while (0)
> +
> CHECK_BW(20);
> CHECK_BW(40);
> CHECK_BW(80);
> --
> 2.46.0
The current usage of CHECK_BW is already safe as it’s only used in standalone contexts where multi-statement expansion poses no risk.
NACK.
Thanks,
Miri
next prev parent reply other threads:[~2024-11-21 20:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-19 21:45 [PATCH v2 0/3] Cleanup: Formatting iwlwifi driver Juan José Arboleda
2024-08-19 21:45 ` [PATCH v2 1/3] iwlwifi: mvm: Improve code style in pointer declarations Juan José Arboleda
2024-08-19 21:45 ` [PATCH v2 2/3] iwlwifi: mvm: Enclose multi-statement macro in a do while Juan José Arboleda
2024-11-21 20:13 ` Korenblit, Miriam Rachel [this message]
2024-08-19 21:45 ` [PATCH v2 3/3] iwlwifi: mvm: Replace spaces for tabs in iwl_mvm_vendor_events_idx Juan José Arboleda
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=MW5PR11MB581014711CD5F3E2812062E9A3222@MW5PR11MB5810.namprd11.prod.outlook.com \
--to=miriam.rachel.korenblit@intel.com \
--cc=kvalo@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=soyjuanarbol@gmail.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
all inboxes | Powered by JetHome®