public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] Cleanup: Formatting iwlwifi driver
@ 2024-08-19 21:45 Juan José Arboleda
  2024-08-19 21:45 ` [PATCH v2 1/3] iwlwifi: mvm: Improve code style in pointer declarations Juan José Arboleda
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Juan José Arboleda @ 2024-08-19 21:45 UTC (permalink / raw)
  To: linux-wireless, linux-kernel
  Cc: miriam.rachel.korenblit, kvalo, Juan José Arboleda

Code Style Enhancements:

* Pointer Declarations: Improved spacing consistency.

Macro Improvements:

* Enclosed multi-statement macro in a do-while loop.

Formatting Standardization:

* Replaced spaces with tabs in iwl_mvm_vendor_events_idx.

This V2 fixes the compile issue. I had a small confussion with my kernel
configuration. Now it is tested/compiled.

Best regards,
Juan

Juan José Arboleda (3):
  iwlwifi: mvm: Improve code style in pointer declarations
  iwlwifi: mvm: Enclose multi-statement macro in a do while
  iwlwifi: mvm: Replace spaces for tabs in iwl_mvm_vendor_events_idx

 drivers/net/wireless/intel/iwlwifi/mvm/power.c      |  4 ++--
 drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c       | 11 +++++++----
 drivers/net/wireless/intel/iwlwifi/mvm/vendor-cmd.c |  6 +++---
 3 files changed, 12 insertions(+), 9 deletions(-)

-- 
2.46.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2 1/3] iwlwifi: mvm: Improve code style in pointer declarations
  2024-08-19 21:45 [PATCH v2 0/3] Cleanup: Formatting iwlwifi driver Juan José Arboleda
@ 2024-08-19 21:45 ` 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-08-19 21:45 ` [PATCH v2 3/3] iwlwifi: mvm: Replace spaces for tabs in iwl_mvm_vendor_events_idx Juan José Arboleda
  2 siblings, 0 replies; 5+ messages in thread
From: Juan José Arboleda @ 2024-08-19 21:45 UTC (permalink / raw)
  To: linux-wireless, linux-kernel
  Cc: miriam.rachel.korenblit, kvalo, Juan José Arboleda

The changes ensure that there is a space between the `u8` type and the
`*` character 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/power.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/power.c b/drivers/net/wireless/intel/iwlwifi/mvm/power.c
index bc363e8427e4..a386b315e52f 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/power.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/power.c
@@ -567,7 +567,7 @@ struct iwl_power_vifs {
 	bool monitor_active;
 };
 
-static void iwl_mvm_power_disable_pm_iterator(void *_data, u8* mac,
+static void iwl_mvm_power_disable_pm_iterator(void *_data, u8 *mac,
 					      struct ieee80211_vif *vif)
 {
 	struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
@@ -575,7 +575,7 @@ static void iwl_mvm_power_disable_pm_iterator(void *_data, u8* mac,
 	mvmvif->pm_enabled = false;
 }
 
-static void iwl_mvm_power_ps_disabled_iterator(void *_data, u8* mac,
+static void iwl_mvm_power_ps_disabled_iterator(void *_data, u8 *mac,
 					       struct ieee80211_vif *vif)
 {
 	struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
-- 
2.46.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v2 2/3] iwlwifi: mvm: Enclose multi-statement macro in a do while
  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 ` Juan José Arboleda
  2024-11-21 20:13   ` Korenblit, Miriam Rachel
  2024-08-19 21:45 ` [PATCH v2 3/3] iwlwifi: mvm: Replace spaces for tabs in iwl_mvm_vendor_events_idx Juan José Arboleda
  2 siblings, 1 reply; 5+ messages in thread
From: Juan José Arboleda @ 2024-08-19 21:45 UTC (permalink / raw)
  To: linux-wireless, linux-kernel
  Cc: miriam.rachel.korenblit, kvalo, Juan José Arboleda

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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v2 3/3] iwlwifi: mvm: Replace spaces for tabs in iwl_mvm_vendor_events_idx
  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-08-19 21:45 ` Juan José Arboleda
  2 siblings, 0 replies; 5+ messages in thread
From: Juan José Arboleda @ 2024-08-19 21:45 UTC (permalink / raw)
  To: linux-wireless, linux-kernel
  Cc: miriam.rachel.korenblit, kvalo, Juan José Arboleda

This patch replaces spaces with tabs in the affected source files to
adhere to the Linux kernel coding style 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/vendor-cmd.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/vendor-cmd.c b/drivers/net/wireless/intel/iwlwifi/mvm/vendor-cmd.c
index 080a1587caa5..0f7fa6032c66 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/vendor-cmd.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/vendor-cmd.c
@@ -104,9 +104,9 @@ static const struct wiphy_vendor_command iwl_mvm_vendor_commands[] = {
 };
 
 enum iwl_mvm_vendor_events_idx {
-        /* 0x0 - 0x3 are deprecated */
-        IWL_MVM_VENDOR_EVENT_IDX_ROAMING_FORBIDDEN = 4,
-        NUM_IWL_MVM_VENDOR_EVENT_IDX
+	/* 0x0 - 0x3 are deprecated */
+	IWL_MVM_VENDOR_EVENT_IDX_ROAMING_FORBIDDEN = 4,
+	NUM_IWL_MVM_VENDOR_EVENT_IDX
 };
 
 static const struct nl80211_vendor_cmd_info
-- 
2.46.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* RE: [PATCH v2 2/3] iwlwifi: mvm: Enclose multi-statement macro in a do while
  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
  0 siblings, 0 replies; 5+ messages in thread
From: Korenblit, Miriam Rachel @ 2024-11-21 20:13 UTC (permalink / raw)
  To: Juan José Arboleda, linux-wireless@vger.kernel.org,
	linux-kernel@vger.kernel.org
  Cc: kvalo@kernel.org



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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-11-21 20:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2024-08-19 21:45 ` [PATCH v2 3/3] iwlwifi: mvm: Replace spaces for tabs in iwl_mvm_vendor_events_idx Juan José Arboleda

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox