The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] staging: rtl8723bs: Fix coding style in ieee80211.h
@ 2026-05-10 11:02 Pramod Maurya
  2026-05-10 16:44 ` Nikolay Kulikov
  0 siblings, 1 reply; 5+ messages in thread
From: Pramod Maurya @ 2026-05-10 11:02 UTC (permalink / raw)
  To: gregkh
  Cc: linux-staging, linux-kernel, pramod.nexgen, Nikolay Kulikov,
	Ethan Tidmore, Yuvraj Singh Chauhan, Bryant Boatright

Fix the following coding style issues:
- Replace __attribute__((packed)) with __packed
- Fix comparisons to place constants on the right side
- Fix block comment style: move trailing */ to its own line
- Add * on subsequent lines in block comments
- Enclose CHAN_ARG macro value in parentheses
- Wrap long IS_CCK_RATE and IS_OFDM_RATE macro lines

Signed-off-by: Pramod Maurya <pramod.nexgen@gmail.com>
---
 drivers/staging/rtl8723bs/include/ieee80211.h | 60 ++++++++++---------
 1 file changed, 31 insertions(+), 29 deletions(-)

diff --git a/drivers/staging/rtl8723bs/include/ieee80211.h b/drivers/staging/rtl8723bs/include/ieee80211.h
index fbb12fe31a6c..739d3f142ce2 100644
--- a/drivers/staging/rtl8723bs/include/ieee80211.h
+++ b/drivers/staging/rtl8723bs/include/ieee80211.h
@@ -231,7 +231,7 @@ struct eapol {
 	u8 version;
 	u8 type;
 	u16 length;
-} __attribute__ ((packed));
+} __packed;
 
 #define IEEE80211_FCS_LEN    4
 
@@ -274,7 +274,7 @@ struct ieee80211_snap_hdr {
 	u8    ssap;   /* always 0xAA */
 	u8    ctrl;   /* always 0x03 */
 	u8    oui[P80211_OUI_LEN];    /* organizational universal id */
-} __attribute__ ((packed));
+} __packed;
 
 #define SNAP_SIZE sizeof(struct ieee80211_snap_hdr)
 
@@ -394,18 +394,22 @@ enum {
 };
 
 #define IS_HT_RATE(_rate)				(_rate >= MGN_MCS0 && _rate <= MGN_MCS31)
-#define IS_CCK_RATE(_rate)				(MGN_1M == _rate || _rate == MGN_2M || _rate == MGN_5_5M || _rate == MGN_11M)
-#define IS_OFDM_RATE(_rate)				(MGN_6M <= _rate && _rate <= MGN_54M  && _rate != MGN_11M)
+#define IS_CCK_RATE(_rate)				\
+	(_rate == MGN_1M || _rate == MGN_2M || _rate == MGN_5_5M || _rate == MGN_11M)
+#define IS_OFDM_RATE(_rate)				\
+	(_rate >= MGN_6M && _rate <= MGN_54M && _rate != MGN_11M)
 
 
 /* NOTE: This data is for statistical purposes; not all hardware provides this
  *       information for frames received.  Not setting these will not cause
- *       any adverse affects. */
+ *       any adverse affects.
+ */
 
 /* IEEE 802.11 requires that STA supports concurrent reception of at least
  * three fragmented frames. This define can be increased to support more
  * concurrent frames, but it should be noted that each entry can consume about
- * 2 kB of RAM and increasing cache size will slow down frame reassembly. */
+ * 2 kB of RAM and increasing cache size will slow down frame reassembly.
+ */
 #define IEEE80211_FRAG_CACHE_LEN 4
 
 #define SEC_KEY_1         (1<<0)
@@ -431,19 +435,17 @@ enum {
 #define BIP_AAD_SIZE  20
 
 /*
-
- 802.11 data frame from AP
-
-      ,-------------------------------------------------------------------.
-Bytes |  2   |  2   |    6    |    6    |    6    |  2   | 0..2312 |   4  |
-      |------|------|---------|---------|---------|------|---------|------|
-Desc. | ctrl | dura |  DA/RA  |   TA    |    SA   | Sequ |  frame  |  fcs |
-      |      | tion | (BSSID) |         |         | ence |  data   |      |
-      `-------------------------------------------------------------------'
-
-Total: 28-2340 bytes
-
-*/
+ * 802.11 data frame from AP
+ *
+ *      ,-------------------------------------------------------------------.
+ * Bytes |  2   |  2   |    6    |    6    |    6    |  2   | 0..2312 |   4  |
+ *       |------|------|---------|---------|---------|------|---------|------|
+ * Desc. | ctrl | dura |  DA/RA  |   TA    |    SA   | Sequ |  frame  |  fcs |
+ *       |      | tion | (BSSID) |         |         | ence |  data   |      |
+ *       `-------------------------------------------------------------------'
+ *
+ * Total: 28-2340 bytes
+ */
 
 #define BEACON_PROBE_SSID_ID_POSITION 12
 
@@ -467,7 +469,8 @@ Total: 28-2340 bytes
 /* MAX_RATES_LENGTH needs to be 12.  The spec says 8, and many APs
  * only use 8, and then use extended rates for the remaining supported
  * rates.  Other APs, however, stick all of their supported rates on the
- * main rates information element... */
+ * main rates information element...
+ */
 #define MAX_RATES_LENGTH                  ((u8)12)
 #define MAX_RATES_EX_LENGTH               ((u8)16)
 #define MAX_NETWORK_COUNT                  128
@@ -497,11 +500,11 @@ Total: 28-2340 bytes
 #define IEEE80211_PS_MBCAST IEEE80211_DTIM_MBCAST
 #define IW_ESSID_MAX_SIZE 32
 /*
-join_res:
--1: authentication fail
--2: association fail
-> 0: TID
-*/
+ * join_res:
+ * -1: authentication fail
+ * -2: association fail
+ * > 0: TID
+ */
 
 #define DEFAULT_MAX_SCAN_AGE (15 * HZ)
 #define DEFAULT_FTS 2346
@@ -555,8 +558,7 @@ enum {
 	ACT_PUBLIC_MAX
 };
 
-#define OUI_MICROSOFT 0x0050f2 /* Microsoft (also used in Wi-Fi specs)
-				* 00:50:F2 */
+#define OUI_MICROSOFT 0x0050f2 /* Microsoft (also used in Wi-Fi specs); 00:50:F2 */
 #define WME_OUI_TYPE 2
 #define WME_OUI_SUBTYPE_INFORMATION_ELEMENT 0
 #define WME_OUI_SUBTYPE_PARAMETER_ELEMENT 1
@@ -637,7 +639,7 @@ struct rtw_ieee80211_channel {
 	/*"orig_mpwr:%d\n"*/
 
 #define CHAN_ARG(channel) \
-	/*(channel)->band*/ \
+	(/*(channel)->band*/ \
 	/*, (channel)->center_freq*/ \
 	(channel)->hw_value \
 	, (channel)->flags \
@@ -647,7 +649,7 @@ struct rtw_ieee80211_channel {
 	/*, (channel)->beacon_found*/ \
 	/*, (channel)->orig_flags*/ \
 	/*, (channel)->orig_mag*/ \
-	/*, (channel)->orig_mpwr*/ \
+	/*, (channel)->orig_mpwr*/)
 
 /* Parsed Information Elements */
 struct rtw_ieee802_11_elems {
-- 
2.52.0


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

* Re: [PATCH] staging: rtl8723bs: Fix coding style in ieee80211.h
  2026-05-10 11:02 [PATCH] staging: rtl8723bs: Fix coding style in ieee80211.h Pramod Maurya
@ 2026-05-10 16:44 ` Nikolay Kulikov
       [not found]   ` <CAKR_b74W78QpNKvF_bU1EfT0WhXq4GxQDJiQ05Z454eABRsYWA@mail.gmail.com>
  0 siblings, 1 reply; 5+ messages in thread
From: Nikolay Kulikov @ 2026-05-10 16:44 UTC (permalink / raw)
  To: Pramod Maurya
  Cc: gregkh, linux-staging, linux-kernel, Ethan Tidmore,
	Yuvraj Singh Chauhan, Bryant Boatright

On Sun, May 10, 2026 at 07:02:24AM -0400, Pramod Maurya wrote:
> Fix the following coding style issues:
> - Replace __attribute__((packed)) with __packed
> - Fix comparisons to place constants on the right side
> - Fix block comment style: move trailing */ to its own line
> - Add * on subsequent lines in block comments
> - Enclose CHAN_ARG macro value in parentheses
> - Wrap long IS_CCK_RATE and IS_OFDM_RATE macro lines

You're making too many different logical changes in one patch.
Please, one patch per change.

And how did you get such a Cc: list?


Thanks,
Nikolay



> 
> Signed-off-by: Pramod Maurya <pramod.nexgen@gmail.com>
> ---
>  drivers/staging/rtl8723bs/include/ieee80211.h | 60 ++++++++++---------
>  1 file changed, 31 insertions(+), 29 deletions(-)
> 
> diff --git a/drivers/staging/rtl8723bs/include/ieee80211.h b/drivers/staging/rtl8723bs/include/ieee80211.h
> index fbb12fe31a6c..739d3f142ce2 100644
> --- a/drivers/staging/rtl8723bs/include/ieee80211.h
> +++ b/drivers/staging/rtl8723bs/include/ieee80211.h
> @@ -231,7 +231,7 @@ struct eapol {
>  	u8 version;
>  	u8 type;
>  	u16 length;
> -} __attribute__ ((packed));
> +} __packed;
>  
>  #define IEEE80211_FCS_LEN    4
>  
> @@ -274,7 +274,7 @@ struct ieee80211_snap_hdr {
>  	u8    ssap;   /* always 0xAA */
>  	u8    ctrl;   /* always 0x03 */
>  	u8    oui[P80211_OUI_LEN];    /* organizational universal id */
> -} __attribute__ ((packed));
> +} __packed;
>  
>  #define SNAP_SIZE sizeof(struct ieee80211_snap_hdr)
>  
> @@ -394,18 +394,22 @@ enum {
>  };
>  
>  #define IS_HT_RATE(_rate)				(_rate >= MGN_MCS0 && _rate <= MGN_MCS31)
> -#define IS_CCK_RATE(_rate)				(MGN_1M == _rate || _rate == MGN_2M || _rate == MGN_5_5M || _rate == MGN_11M)
> -#define IS_OFDM_RATE(_rate)				(MGN_6M <= _rate && _rate <= MGN_54M  && _rate != MGN_11M)
> +#define IS_CCK_RATE(_rate)				\
> +	(_rate == MGN_1M || _rate == MGN_2M || _rate == MGN_5_5M || _rate == MGN_11M)
> +#define IS_OFDM_RATE(_rate)				\
> +	(_rate >= MGN_6M && _rate <= MGN_54M && _rate != MGN_11M)
>  
>  
>  /* NOTE: This data is for statistical purposes; not all hardware provides this
>   *       information for frames received.  Not setting these will not cause
> - *       any adverse affects. */
> + *       any adverse affects.
> + */
>  
>  /* IEEE 802.11 requires that STA supports concurrent reception of at least
>   * three fragmented frames. This define can be increased to support more
>   * concurrent frames, but it should be noted that each entry can consume about
> - * 2 kB of RAM and increasing cache size will slow down frame reassembly. */
> + * 2 kB of RAM and increasing cache size will slow down frame reassembly.
> + */
>  #define IEEE80211_FRAG_CACHE_LEN 4
>  
>  #define SEC_KEY_1         (1<<0)
> @@ -431,19 +435,17 @@ enum {
>  #define BIP_AAD_SIZE  20
>  
>  /*
> -
> - 802.11 data frame from AP
> -
> -      ,-------------------------------------------------------------------.
> -Bytes |  2   |  2   |    6    |    6    |    6    |  2   | 0..2312 |   4  |
> -      |------|------|---------|---------|---------|------|---------|------|
> -Desc. | ctrl | dura |  DA/RA  |   TA    |    SA   | Sequ |  frame  |  fcs |
> -      |      | tion | (BSSID) |         |         | ence |  data   |      |
> -      `-------------------------------------------------------------------'
> -
> -Total: 28-2340 bytes
> -
> -*/
> + * 802.11 data frame from AP
> + *
> + *      ,-------------------------------------------------------------------.
> + * Bytes |  2   |  2   |    6    |    6    |    6    |  2   | 0..2312 |   4  |
> + *       |------|------|---------|---------|---------|------|---------|------|
> + * Desc. | ctrl | dura |  DA/RA  |   TA    |    SA   | Sequ |  frame  |  fcs |
> + *       |      | tion | (BSSID) |         |         | ence |  data   |      |
> + *       `-------------------------------------------------------------------'
> + *
> + * Total: 28-2340 bytes
> + */
>  
>  #define BEACON_PROBE_SSID_ID_POSITION 12
>  
> @@ -467,7 +469,8 @@ Total: 28-2340 bytes
>  /* MAX_RATES_LENGTH needs to be 12.  The spec says 8, and many APs
>   * only use 8, and then use extended rates for the remaining supported
>   * rates.  Other APs, however, stick all of their supported rates on the
> - * main rates information element... */
> + * main rates information element...
> + */
>  #define MAX_RATES_LENGTH                  ((u8)12)
>  #define MAX_RATES_EX_LENGTH               ((u8)16)
>  #define MAX_NETWORK_COUNT                  128
> @@ -497,11 +500,11 @@ Total: 28-2340 bytes
>  #define IEEE80211_PS_MBCAST IEEE80211_DTIM_MBCAST
>  #define IW_ESSID_MAX_SIZE 32
>  /*
> -join_res:
> --1: authentication fail
> --2: association fail
> -> 0: TID
> -*/
> + * join_res:
> + * -1: authentication fail
> + * -2: association fail
> + * > 0: TID
> + */
>  
>  #define DEFAULT_MAX_SCAN_AGE (15 * HZ)
>  #define DEFAULT_FTS 2346
> @@ -555,8 +558,7 @@ enum {
>  	ACT_PUBLIC_MAX
>  };
>  
> -#define OUI_MICROSOFT 0x0050f2 /* Microsoft (also used in Wi-Fi specs)
> -				* 00:50:F2 */
> +#define OUI_MICROSOFT 0x0050f2 /* Microsoft (also used in Wi-Fi specs); 00:50:F2 */
>  #define WME_OUI_TYPE 2
>  #define WME_OUI_SUBTYPE_INFORMATION_ELEMENT 0
>  #define WME_OUI_SUBTYPE_PARAMETER_ELEMENT 1
> @@ -637,7 +639,7 @@ struct rtw_ieee80211_channel {
>  	/*"orig_mpwr:%d\n"*/
>  
>  #define CHAN_ARG(channel) \
> -	/*(channel)->band*/ \
> +	(/*(channel)->band*/ \
>  	/*, (channel)->center_freq*/ \
>  	(channel)->hw_value \
>  	, (channel)->flags \
> @@ -647,7 +649,7 @@ struct rtw_ieee80211_channel {
>  	/*, (channel)->beacon_found*/ \
>  	/*, (channel)->orig_flags*/ \
>  	/*, (channel)->orig_mag*/ \
> -	/*, (channel)->orig_mpwr*/ \
> +	/*, (channel)->orig_mpwr*/)
>  
>  /* Parsed Information Elements */
>  struct rtw_ieee802_11_elems {
> -- 
> 2.52.0
> 

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

* Re: [PATCH] staging: rtl8723bs: Fix coding style in ieee80211.h
       [not found]   ` <CAKR_b74W78QpNKvF_bU1EfT0WhXq4GxQDJiQ05Z454eABRsYWA@mail.gmail.com>
@ 2026-05-10 18:04     ` Nikolay Kulikov
  2026-05-11  8:51       ` Dan Carpenter
  0 siblings, 1 reply; 5+ messages in thread
From: Nikolay Kulikov @ 2026-05-10 18:04 UTC (permalink / raw)
  To: PRAMOD MAURYA
  Cc: gregkh, linux-staging, linux-kernel, Ethan Tidmore,
	Yuvraj Singh Chauhan, Bryant Boatright

On Sun, May 10, 2026 at 10:48:22PM +0530, PRAMOD MAURYA wrote:
> Hi Nikolay,
> 
> Thanks for the review.
> 
> Understood. I’ll split the changes into separate logical patches and keep
> future submissions more focused.
> 
> The Cc list was generated using get_maintainer.pl. I’ll review it more
> carefully before sending the next revision.

Run this script with the '--nogit-fallback' flag, it will not output the
developers who modified this file, only the maintainer and mailing
lists.

And always wait some time (1 day) before submitting a new version, no
need to rush.


> > Thanks,
> > Nikolay

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

* Re: [PATCH] staging: rtl8723bs: Fix coding style in ieee80211.h
  2026-05-10 18:04     ` Nikolay Kulikov
@ 2026-05-11  8:51       ` Dan Carpenter
  2026-05-11 12:55         ` Nikolay Kulikov
  0 siblings, 1 reply; 5+ messages in thread
From: Dan Carpenter @ 2026-05-11  8:51 UTC (permalink / raw)
  To: Nikolay Kulikov
  Cc: PRAMOD MAURYA, gregkh, linux-staging, linux-kernel, Ethan Tidmore,
	Yuvraj Singh Chauhan, Bryant Boatright

On Sun, May 10, 2026 at 09:04:14PM +0300, Nikolay Kulikov wrote:
> On Sun, May 10, 2026 at 10:48:22PM +0530, PRAMOD MAURYA wrote:
> > Hi Nikolay,
> > 
> > Thanks for the review.
> > 
> > Understood. I’ll split the changes into separate logical patches and keep
> > future submissions more focused.
> > 
> > The Cc list was generated using get_maintainer.pl. I’ll review it more
> > carefully before sending the next revision.
> 
> Run this script with the '--nogit-fallback' flag, it will not output the
> developers who modified this file, only the maintainer and mailing
> lists.

The CC list was fine.  If you send Yuvraj and Bryant can figure out how to
handle emails.  If we really decide that everyone should use
--nogit-fallback then that should be made the default.

regards,
dan carpenter

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

* Re: [PATCH] staging: rtl8723bs: Fix coding style in ieee80211.h
  2026-05-11  8:51       ` Dan Carpenter
@ 2026-05-11 12:55         ` Nikolay Kulikov
  0 siblings, 0 replies; 5+ messages in thread
From: Nikolay Kulikov @ 2026-05-11 12:55 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: PRAMOD MAURYA, gregkh, linux-staging, linux-kernel, Ethan Tidmore,
	Yuvraj Singh Chauhan, Bryant Boatright

On Mon, May 11, 2026 at 11:51:07AM +0300, Dan Carpenter wrote:
> On Sun, May 10, 2026 at 09:04:14PM +0300, Nikolay Kulikov wrote:
> > On Sun, May 10, 2026 at 10:48:22PM +0530, PRAMOD MAURYA wrote:
> > > Hi Nikolay,
> > > 
> > > Thanks for the review.
> > > 
> > > Understood. I’ll split the changes into separate logical patches and keep
> > > future submissions more focused.
> > > 
> > > The Cc list was generated using get_maintainer.pl. I’ll review it more
> > > carefully before sending the next revision.
> > 
> > Run this script with the '--nogit-fallback' flag, it will not output the
> > developers who modified this file, only the maintainer and mailing
> > lists.
> 
> The CC list was fine.  If you send Yuvraj and Bryant can figure out how to
> handle emails.  If we really decide that everyone should use
> --nogit-fallback then that should be made the default.

Understood. I suggested this flag because it helps me avoid sendig
patches to people who haven't explicity requested them. But you're
right, the decision is up to the sender.


Thanks,
Nikolay

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

end of thread, other threads:[~2026-05-11 12:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-10 11:02 [PATCH] staging: rtl8723bs: Fix coding style in ieee80211.h Pramod Maurya
2026-05-10 16:44 ` Nikolay Kulikov
     [not found]   ` <CAKR_b74W78QpNKvF_bU1EfT0WhXq4GxQDJiQ05Z454eABRsYWA@mail.gmail.com>
2026-05-10 18:04     ` Nikolay Kulikov
2026-05-11  8:51       ` Dan Carpenter
2026-05-11 12:55         ` Nikolay Kulikov

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