Skip to contentSkip to conversation

staging: rtl8723bs: fix checkpatch errors on macros

PATCH In review Fabio Aiuto 4 participants 27 messages Mar 26, 2021 Staging

lore
Share & tools
lore
#0 lore raw

cover staging: rtl8723bs: fix checkpatch errors on macros

Fix all checkpatch errors on macros but the following:

ERROR: Macros with complex values should be enclosed in parentheses #41: FILE: drivers/staging/rtl8723bs/include/hal_pwr_seq.h:41:
+#define RTL8723B_TRANS_CARDEMU_TO_ACT \
--
ERROR: Macros with complex values should be enclosed in parentheses #67: FILE: drivers/staging/rtl8723bs/include/hal_pwr_seq.h:67:
+#define RTL8723B_TRANS_ACT_TO_CARDEMU \
--
ERROR: Macros with complex values should be enclosed in parentheses #80: FILE: drivers/staging/rtl8723bs/include/hal_pwr_seq.h:80:
+#define RTL8723B_TRANS_CARDEMU_TO_SUS \
--
ERROR: Macros with complex values should be enclosed in parentheses #91: FILE: drivers/staging/rtl8723bs/include/hal_pwr_seq.h:91:
+#define RTL8723B_TRANS_SUS_TO_CARDEMU \
--
ERROR: Macros with complex values should be enclosed in parentheses #100: FILE: drivers/staging/rtl8723bs/include/hal_pwr_seq.h:100:
+#define RTL8723B_TRANS_CARDEMU_TO_CARDDIS \
--
ERROR: Macros with complex values should be enclosed in parentheses #111: FILE: drivers/staging/rtl8723bs/include/hal_pwr_seq.h:111:
+#define RTL8723B_TRANS_CARDDIS_TO_CARDEMU \
--
ERROR: Macros with complex values should be enclosed in parentheses #123: FILE: drivers/staging/rtl8723bs/include/hal_pwr_seq.h:123:
+#define RTL8723B_TRANS_CARDEMU_TO_PDN \
--
ERROR: Macros with complex values should be enclosed in parentheses #136: FILE: drivers/staging/rtl8723bs/include/hal_pwr_seq.h:136:
+#define RTL8723B_TRANS_ACT_TO_LPS \
--
ERROR: Macros with complex values should be enclosed in parentheses #154: FILE: drivers/staging/rtl8723bs/include/hal_pwr_seq.h:154:
+#define RTL8723B_TRANS_LPS_TO_ACT \
--
ERROR: Macros with complex values should be enclosed in parentheses #170: FILE: drivers/staging/rtl8723bs/include/hal_pwr_seq.h:170:
+ #define RTL8723B_TRANS_ACT_TO_SWLPS \
--
ERROR: Macros with complex values should be enclosed in parentheses #197: FILE: drivers/staging/rtl8723bs/include/hal_pwr_seq.h:197:
+#define RTL8723B_TRANS_SWLPS_TO_ACT \
--

I counld't put braces for they are meant to be expanded inside an array definition

ERROR: Macros with complex values should be enclosed in parentheses #108: FILE: drivers/staging/rtl8723bs/include/osdep_service_linux.h:108:
+#define FUNC_NDEV_ARG(ndev) __func__, ndev->name
--
ERROR: Macros with complex values should be enclosed in parentheses #110: FILE: drivers/staging/rtl8723bs/include/osdep_service_linux.h:110:
+#define FUNC_ADPT_ARG(adapter) __func__, adapter->pnetdev->nam

All those macros are not used to generate expressions but arguments of a functions.

If someone knows how to silence those errors as well, please tell me.

Fabio Aiuto (15):
staging: rtl8723bs: inlcude macros in a do..while loop in
core/rtw_security.c
staging: rtl8723bs: put parentheses on macros with complex values in
hal/HalBtcOutSrc.h
staging: rtl8723bs: put parentheses on macros with complex values in
hal/odm_debug.h
staging: rtl8723bs: put parentheses on macros with complex values in
include/basic_types.h
staging: rtl8723bs: put parentheses on macros with complex values in
include/drv_types.h
staging: rtl8723bs: put parentheses on macros with complex values in
include/hal_com.h
staging: rtl8723bs: put parentheses on macros with complex values in
include/hal_com_reg.h
staging: rtl8723bs: put parentheses on macros with complex values in
include/hal_data.h
staging: rtl8723bs: put parentheses on macros with complex values in
include/hal_phy.h
staging: rtl8723bs: put parentheses on macros with complex values in

    include/ieee80211.h

staging: rtl8723bs: put parentheses on macros with complex values in
include/rtw_debug.h
staging: rtl8723bs: put parentheses on macros with complex values in
include/rtw_pwrctrl.h
staging: rtl8723bs: add spaces around operator in
include/rtw_pwrctrl.h
staging: rtl8723bs: put parentheses on macros with complex values in
include/sta_info.h
staging: rtl8723bs: put parentheses on macros with complex values in
include/wifi.h

 drivers/staging/rtl8723bs/core/rtw_security.c | 94 +++++++++++--------
 drivers/staging/rtl8723bs/hal/HalBtcOutSrc.h  |  6 +-
 drivers/staging/rtl8723bs/hal/odm_debug.h     |  6 +-
 .../staging/rtl8723bs/include/basic_types.h   | 30 +++---
 drivers/staging/rtl8723bs/include/drv_types.h |  4 +-
 drivers/staging/rtl8723bs/include/hal_com.h   |  8 +-
 .../staging/rtl8723bs/include/hal_com_reg.h   | 14 +--
 drivers/staging/rtl8723bs/include/hal_data.h  |  6 +-
 drivers/staging/rtl8723bs/include/hal_phy.h   |  2 +-
 drivers/staging/rtl8723bs/include/ieee80211.h |  4 +-
 drivers/staging/rtl8723bs/include/rtw_debug.h | 28 +++---
 .../staging/rtl8723bs/include/rtw_pwrctrl.h   |  6 +-
 drivers/staging/rtl8723bs/include/sta_info.h  | 12 +--
 drivers/staging/rtl8723bs/include/wifi.h      | 38 ++++----
 14 files changed, 140 insertions(+), 118 deletions(-)
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/15 staging: rtl8723bs: inlcude macros in a do..while loop in core/rtw_security.c

fix the following checkpatch warning:

ERROR: Macros starting with if should be enclosed by a do - while loop to avoid possible if/else logic defects
33: FILE: drivers/staging/rtl8723bs/core/rtw_security.c:33:
+#define WEP_SW_ENC_CNT_INC(sec, ra) \
--
ERROR: Macros starting with if should be enclosed by a do - while loop to avoid possible if/else logic defects
41: FILE: drivers/staging/rtl8723bs/core/rtw_security.c:41:
+#define WEP_SW_DEC_CNT_INC(sec, ra) \
--
ERROR: Macros starting with if should be enclosed by a do - while loop to avoid possible if/else logic defects
49: FILE: drivers/staging/rtl8723bs/core/rtw_security.c:49:
+#define TKIP_SW_ENC_CNT_INC(sec, ra) \
--
ERROR: Macros starting with if should be enclosed by a do - while loop to avoid possible if/else logic defects
57: FILE: drivers/staging/rtl8723bs/core/rtw_security.c:57:
+#define TKIP_SW_DEC_CNT_INC(sec, ra) \
--
ERROR: Macros starting with if should be enclosed by a do - while loop to avoid possible if/else logic defects
65: FILE: drivers/staging/rtl8723bs/core/rtw_security.c:65:
+#define AES_SW_ENC_CNT_INC(sec, ra) \
--
ERROR: Macros starting with if should be enclosed by a do - while loop to avoid possible if/else logic defects
73: FILE: drivers/staging/rtl8723bs/core/rtw_security.c:73:
+#define AES_SW_DEC_CNT_INC(sec, ra) \
--
ERROR: Macros with multiple statements should be enclosed in a do - while loop
2082: FILE: drivers/staging/rtl8723bs/core/rtw_security.c:2082:
+#define ROUND(i, d, s) \

---
 drivers/staging/rtl8723bs/core/rtw_security.c | 94 +++++++++++--------
 1 file changed, 54 insertions(+), 40 deletions(-)
drivers/staging/rtl8723bs/core/rtw_security.c +54 -40
index 44e2b362c867..c92984fcf42d 100644
@@ -31,52 +31,64 @@ const char *security_type_str(u8 value)
 
 #ifdef DBG_SW_SEC_CNT
 #define WEP_SW_ENC_CNT_INC(sec, ra) \
-	if (is_broadcast_mac_addr(ra)) \
-		sec->wep_sw_enc_cnt_bc++; \
-	else if (is_multicast_mac_addr(ra)) \
-		sec->wep_sw_enc_cnt_mc++; \
-	else \
-		sec->wep_sw_enc_cnt_uc++;
+	do { \
+		if (is_broadcast_mac_addr(ra)) \
+			sec->wep_sw_enc_cnt_bc++; \
+		else if (is_multicast_mac_addr(ra)) \
+			sec->wep_sw_enc_cnt_mc++; \
+		else \
+			sec->wep_sw_enc_cnt_uc++; \
+	} while (0)
 
 #define WEP_SW_DEC_CNT_INC(sec, ra) \
-	if (is_broadcast_mac_addr(ra)) \
-		sec->wep_sw_dec_cnt_bc++; \
-	else if (is_multicast_mac_addr(ra)) \
-		sec->wep_sw_dec_cnt_mc++; \
-	else \
-		sec->wep_sw_dec_cnt_uc++;
+	do { \
+		if (is_broadcast_mac_addr(ra)) \
+			sec->wep_sw_dec_cnt_bc++; \
+		else if (is_multicast_mac_addr(ra)) \
+			sec->wep_sw_dec_cnt_mc++; \
+		else \
+			sec->wep_sw_dec_cnt_uc++; \
+	} while (0)
 
 #define TKIP_SW_ENC_CNT_INC(sec, ra) \
-	if (is_broadcast_mac_addr(ra)) \
-		sec->tkip_sw_enc_cnt_bc++; \
-	else if (is_multicast_mac_addr(ra)) \
-		sec->tkip_sw_enc_cnt_mc++; \
-	else \
-		sec->tkip_sw_enc_cnt_uc++;
+	do { \
+		if (is_broadcast_mac_addr(ra)) \
+			sec->tkip_sw_enc_cnt_bc++; \
+		else if (is_multicast_mac_addr(ra)) \
+			sec->tkip_sw_enc_cnt_mc++; \
+		else \
+			sec->tkip_sw_enc_cnt_uc++; \
+	} while (0)
 
 #define TKIP_SW_DEC_CNT_INC(sec, ra) \
-	if (is_broadcast_mac_addr(ra)) \
-		sec->tkip_sw_dec_cnt_bc++; \
-	else if (is_multicast_mac_addr(ra)) \
-		sec->tkip_sw_dec_cnt_mc++; \
-	else \
-		sec->tkip_sw_dec_cnt_uc++;
+	do { \
+		if (is_broadcast_mac_addr(ra)) \
+			sec->tkip_sw_dec_cnt_bc++; \
+		else if (is_multicast_mac_addr(ra)) \
+			sec->tkip_sw_dec_cnt_mc++; \
+		else \
+			sec->tkip_sw_dec_cnt_uc++; \
+	} while (0)
 
 #define AES_SW_ENC_CNT_INC(sec, ra) \
-	if (is_broadcast_mac_addr(ra)) \
-		sec->aes_sw_enc_cnt_bc++; \
-	else if (is_multicast_mac_addr(ra)) \
-		sec->aes_sw_enc_cnt_mc++; \
-	else \
-		sec->aes_sw_enc_cnt_uc++;
+	do { \
+		if (is_broadcast_mac_addr(ra)) \
+			sec->aes_sw_enc_cnt_bc++; \
+		else if (is_multicast_mac_addr(ra)) \
+			sec->aes_sw_enc_cnt_mc++; \
+		else \
+			sec->aes_sw_enc_cnt_uc++; \
+	} while (0)
 
 #define AES_SW_DEC_CNT_INC(sec, ra) \
-	if (is_broadcast_mac_addr(ra)) \
-		sec->aes_sw_dec_cnt_bc++; \
-	else if (is_multicast_mac_addr(ra)) \
-		sec->aes_sw_dec_cnt_mc++; \
-	else \
-		sec->aes_sw_dec_cnt_uc++;
+	do { \
+		if (is_broadcast_mac_addr(ra)) \
+			sec->aes_sw_dec_cnt_bc++; \
+		else if (is_multicast_mac_addr(ra)) \
+			sec->aes_sw_dec_cnt_mc++; \
+		else \
+			sec->aes_sw_dec_cnt_uc++; \
+	} while (0)
 #else
 #define WEP_SW_ENC_CNT_INC(sec, ra)
 #define WEP_SW_DEC_CNT_INC(sec, ra)
@@ -2080,10 +2092,12 @@ static void rijndaelEncrypt(u32 rk[/*44*/], u8 pt[16], u8 ct[16])
 	s3 = GETU32(pt + 12) ^ rk[3];
 
 #define ROUND(i, d, s) \
-d##0 = TE0(s##0) ^ TE1(s##1) ^ TE2(s##2) ^ TE3(s##3) ^ rk[4 * i]; \
-d##1 = TE0(s##1) ^ TE1(s##2) ^ TE2(s##3) ^ TE3(s##0) ^ rk[4 * i + 1]; \
-d##2 = TE0(s##2) ^ TE1(s##3) ^ TE2(s##0) ^ TE3(s##1) ^ rk[4 * i + 2]; \
-d##3 = TE0(s##3) ^ TE1(s##0) ^ TE2(s##1) ^ TE3(s##2) ^ rk[4 * i + 3]
+	do { \
+		d##0 = TE0(s##0) ^ TE1(s##1) ^ TE2(s##2) ^ TE3(s##3) ^ rk[4 * i]; \
+		d##1 = TE0(s##1) ^ TE1(s##2) ^ TE2(s##3) ^ TE3(s##0) ^ rk[4 * i + 1]; \
+		d##2 = TE0(s##2) ^ TE1(s##3) ^ TE2(s##0) ^ TE3(s##1) ^ rk[4 * i + 2]; \
+		d##3 = TE0(s##3) ^ TE1(s##0) ^ TE2(s##1) ^ TE3(s##2) ^ rk[4 * i + 3]; \
+	} while (0)
 
 	/* Nr - 1 full rounds: */
 	r = Nr >> 1;
Signature · 1 line
2.20.1
#2 lore raw

Re: [PATCH 01/15] staging: rtl8723bs: inlcude macros in a do..while loop in core/rtw_security.c

Quoted 54 lines · Fabio Aiuto

fix the following checkpatch warning:

ERROR: Macros starting with if should be enclosed by a do - while loop to avoid possible if/else logic defects
33: FILE: drivers/staging/rtl8723bs/core/rtw_security.c:33:
+#define WEP_SW_ENC_CNT_INC(sec, ra) \
--
ERROR: Macros starting with if should be enclosed by a do - while loop to avoid possible if/else logic defects
41: FILE: drivers/staging/rtl8723bs/core/rtw_security.c:41:
+#define WEP_SW_DEC_CNT_INC(sec, ra) \
--
ERROR: Macros starting with if should be enclosed by a do - while loop to avoid possible if/else logic defects
49: FILE: drivers/staging/rtl8723bs/core/rtw_security.c:49:
+#define TKIP_SW_ENC_CNT_INC(sec, ra) \
--
ERROR: Macros starting with if should be enclosed by a do - while loop to avoid possible if/else logic defects
57: FILE: drivers/staging/rtl8723bs/core/rtw_security.c:57:
+#define TKIP_SW_DEC_CNT_INC(sec, ra) \
--
ERROR: Macros starting with if should be enclosed by a do - while loop to avoid possible if/else logic defects
65: FILE: drivers/staging/rtl8723bs/core/rtw_security.c:65:
+#define AES_SW_ENC_CNT_INC(sec, ra) \
--
ERROR: Macros starting with if should be enclosed by a do - while loop to avoid possible if/else logic defects
73: FILE: drivers/staging/rtl8723bs/core/rtw_security.c:73:
+#define AES_SW_DEC_CNT_INC(sec, ra) \
--
ERROR: Macros with multiple statements should be enclosed in a do - while loop
2082: FILE: drivers/staging/rtl8723bs/core/rtw_security.c:2082:
+#define ROUND(i, d, s) \

---
 drivers/staging/rtl8723bs/core/rtw_security.c | 94 +++++++++++--------
 1 file changed, 54 insertions(+), 40 deletions(-)
drivers/staging/rtl8723bs/core/rtw_security.c +0 -4
index 44e2b362c867..c92984fcf42d 100644
@@ -31,52 +31,64 @@ const char *security_type_str(u8 value)
 
 #ifdef DBG_SW_SEC_CNT
 #define WEP_SW_ENC_CNT_INC(sec, ra) \
-	if (is_broadcast_mac_addr(ra)) \
-		sec->wep_sw_enc_cnt_bc++; \
-	else if (is_multicast_mac_addr(ra)) \
-		sec->wep_sw_enc_cnt_mc++; \

drivers/staging/rtl8723bs/core/rtw_security.c const char *security_type_str(u8 value) · line 41

Quoted 10 lines
drivers/staging/rtl8723bs/core/rtw_security.c +8 -2
-	else \
-		sec->wep_sw_enc_cnt_uc++;
+	do { \
+		if (is_broadcast_mac_addr(ra)) \
+			sec->wep_sw_enc_cnt_bc++; \
+		else if (is_multicast_mac_addr(ra)) \
+			sec->wep_sw_enc_cnt_mc++; \
+		else \
+			sec->wep_sw_enc_cnt_uc++; \
+	} while (0)

What are these statistics used for? So far as I can see there not used at all. It's probably better to just delete all the DBG_SW_SEC_CNT code.

regards,
dan carpenter

#3 lore raw

Re: [PATCH 01/15] staging: rtl8723bs: inlcude macros in a do..while loop in core/rtw_security.c

Quoted 70 lines · Dan Carpenter
Quoted 54 lines · Fabio Aiuto

fix the following checkpatch warning:

ERROR: Macros starting with if should be enclosed by a do - while loop to avoid possible if/else logic defects
33: FILE: drivers/staging/rtl8723bs/core/rtw_security.c:33:
+#define WEP_SW_ENC_CNT_INC(sec, ra) \
--
ERROR: Macros starting with if should be enclosed by a do - while loop to avoid possible if/else logic defects
41: FILE: drivers/staging/rtl8723bs/core/rtw_security.c:41:
+#define WEP_SW_DEC_CNT_INC(sec, ra) \
--
ERROR: Macros starting with if should be enclosed by a do - while loop to avoid possible if/else logic defects
49: FILE: drivers/staging/rtl8723bs/core/rtw_security.c:49:
+#define TKIP_SW_ENC_CNT_INC(sec, ra) \
--
ERROR: Macros starting with if should be enclosed by a do - while loop to avoid possible if/else logic defects
57: FILE: drivers/staging/rtl8723bs/core/rtw_security.c:57:
+#define TKIP_SW_DEC_CNT_INC(sec, ra) \
--
ERROR: Macros starting with if should be enclosed by a do - while loop to avoid possible if/else logic defects
65: FILE: drivers/staging/rtl8723bs/core/rtw_security.c:65:
+#define AES_SW_ENC_CNT_INC(sec, ra) \
--
ERROR: Macros starting with if should be enclosed by a do - while loop to avoid possible if/else logic defects
73: FILE: drivers/staging/rtl8723bs/core/rtw_security.c:73:
+#define AES_SW_DEC_CNT_INC(sec, ra) \
--
ERROR: Macros with multiple statements should be enclosed in a do - while loop
2082: FILE: drivers/staging/rtl8723bs/core/rtw_security.c:2082:
+#define ROUND(i, d, s) \

---
 drivers/staging/rtl8723bs/core/rtw_security.c | 94 +++++++++++--------
 1 file changed, 54 insertions(+), 40 deletions(-)
drivers/staging/rtl8723bs/core/rtw_security.c +0 -4
index 44e2b362c867..c92984fcf42d 100644
@@ -31,52 +31,64 @@ const char *security_type_str(u8 value)
 
 #ifdef DBG_SW_SEC_CNT
 #define WEP_SW_ENC_CNT_INC(sec, ra) \
-	if (is_broadcast_mac_addr(ra)) \
-		sec->wep_sw_enc_cnt_bc++; \
-	else if (is_multicast_mac_addr(ra)) \
-		sec->wep_sw_enc_cnt_mc++; \

drivers/staging/rtl8723bs/core/rtw_security.c const char *security_type_str(u8 value) · line 41

Quoted 10 lines
drivers/staging/rtl8723bs/core/rtw_security.c +8 -2
-	else \
-		sec->wep_sw_enc_cnt_uc++;
+	do { \
+		if (is_broadcast_mac_addr(ra)) \
+			sec->wep_sw_enc_cnt_bc++; \
+		else if (is_multicast_mac_addr(ra)) \
+			sec->wep_sw_enc_cnt_mc++; \
+		else \
+			sec->wep_sw_enc_cnt_uc++; \
+	} while (0)

What are these statistics used for? So far as I can see there not used at all. It's probably better to just delete all the DBG_SW_SEC_CNT code.

Quoted 3 lines

regards,
dan carpenter

you are right Dan, I will remove all related fields in security_priv

thank you,

fabio

#4 lore raw

PATCH 2/15 staging: rtl8723bs: put parentheses on macros with complex values in hal/HalBtcOutSrc.h

In reply to Fabio Aiuto

fix the following checkpatch warning:

ERROR: Macros with complex values should be enclosed in parentheses 152: FILE: drivers/staging/rtl8723bs/hal/HalBtcOutSrc.h:152:
+#define BTC_PRINT(dbgtype, dbgflag, printstr) \
no_printk printstr
--
ERROR: Macros with complex values should be enclosed in parentheses 153: FILE: drivers/staging/rtl8723bs/hal/HalBtcOutSrc.h:153:
+#define BTC_PRINT_F(dbgtype, dbgflag, printstr) \
no_printk printstr
--
ERROR: Macros with complex values should be enclosed in parentheses 154: FILE: drivers/staging/rtl8723bs/hal/HalBtcOutSrc.h:154:
+#define BTC_PRINT_ADDR(dbgtype, dbgflag, printstr, _Ptr) \
no_printk printstr

---
 drivers/staging/rtl8723bs/hal/HalBtcOutSrc.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/rtl8723bs/hal/HalBtcOutSrc.h +3 -3
index 10c021024b24..1926a1f7a7e5 100644
@@ -149,9 +149,9 @@ extern u32 		GLBtcDbgType[];
 }
 
 #else
-#define BTC_PRINT(dbgtype, dbgflag, printstr)		 no_printk printstr
-#define BTC_PRINT_F(dbgtype, dbgflag, printstr)		 no_printk printstr
-#define BTC_PRINT_ADDR(dbgtype, dbgflag, printstr, _Ptr) no_printk printstr
+#define BTC_PRINT(dbgtype, dbgflag, printstr)		 (no_printk printstr)
+#define BTC_PRINT_F(dbgtype, dbgflag, printstr)		 (no_printk printstr)
+#define BTC_PRINT_ADDR(dbgtype, dbgflag, printstr, _Ptr) (no_printk printstr)
 #define BTC_PRINT_DATA(dbgtype, dbgflag, _TitleString, _HexData, _HexDataLen) \
 			no_printk("%s %p %zu", _TitleString, _HexData, _HexDataLen)
 #endif
Signature · 1 line
2.20.1
#5 lore raw

Re: [PATCH 02/15] staging: rtl8723bs: put parentheses on macros with complex values in hal/HalBtcOutSrc.h

Quoted 27 lines · Fabio Aiuto

fix the following checkpatch warning:

ERROR: Macros with complex values should be enclosed in parentheses 152: FILE: drivers/staging/rtl8723bs/hal/HalBtcOutSrc.h:152:
+#define BTC_PRINT(dbgtype, dbgflag, printstr) \
no_printk printstr
--
ERROR: Macros with complex values should be enclosed in parentheses 153: FILE: drivers/staging/rtl8723bs/hal/HalBtcOutSrc.h:153:
+#define BTC_PRINT_F(dbgtype, dbgflag, printstr) \
no_printk printstr
--
ERROR: Macros with complex values should be enclosed in parentheses 154: FILE: drivers/staging/rtl8723bs/hal/HalBtcOutSrc.h:154:
+#define BTC_PRINT_ADDR(dbgtype, dbgflag, printstr, _Ptr) \
no_printk printstr

---
 drivers/staging/rtl8723bs/hal/HalBtcOutSrc.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/rtl8723bs/hal/HalBtcOutSrc.h +0 -0
index 10c021024b24..1926a1f7a7e5 100644

drivers/staging/rtl8723bs/hal/HalBtcOutSrc.h extern u32 GLBtcDbgType[]; · line 154

Quoted 9 lines
drivers/staging/rtl8723bs/hal/HalBtcOutSrc.h +3 -3
@@ -149,9 +149,9 @@ extern u32 		GLBtcDbgType[];
 }
 
 #else
-#define BTC_PRINT(dbgtype, dbgflag, printstr)		 no_printk printstr
-#define BTC_PRINT_F(dbgtype, dbgflag, printstr)		 no_printk printstr
-#define BTC_PRINT_ADDR(dbgtype, dbgflag, printstr, _Ptr) no_printk printstr
+#define BTC_PRINT(dbgtype, dbgflag, printstr)		 (no_printk printstr)
+#define BTC_PRINT_F(dbgtype, dbgflag, printstr)		 (no_printk printstr)
+#define BTC_PRINT_ADDR(dbgtype, dbgflag, printstr, _Ptr) (no_printk printstr)

This makes no sense at all. no_printk is a function. The BTC_PRINT() macros are super ugly and this only makes it worse.

regards,
dan carpenter

#6 lore raw

Re: [PATCH 02/15] staging: rtl8723bs: put parentheses on macros with complex values in hal/HalBtcOutSrc.h

Quoted 41 lines · Dan Carpenter
Quoted 27 lines · Fabio Aiuto

fix the following checkpatch warning:

ERROR: Macros with complex values should be enclosed in parentheses 152: FILE: drivers/staging/rtl8723bs/hal/HalBtcOutSrc.h:152:
+#define BTC_PRINT(dbgtype, dbgflag, printstr) \
no_printk printstr
--
ERROR: Macros with complex values should be enclosed in parentheses 153: FILE: drivers/staging/rtl8723bs/hal/HalBtcOutSrc.h:153:
+#define BTC_PRINT_F(dbgtype, dbgflag, printstr) \
no_printk printstr
--
ERROR: Macros with complex values should be enclosed in parentheses 154: FILE: drivers/staging/rtl8723bs/hal/HalBtcOutSrc.h:154:
+#define BTC_PRINT_ADDR(dbgtype, dbgflag, printstr, _Ptr) \
no_printk printstr

---
 drivers/staging/rtl8723bs/hal/HalBtcOutSrc.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/rtl8723bs/hal/HalBtcOutSrc.h +0 -0
index 10c021024b24..1926a1f7a7e5 100644

drivers/staging/rtl8723bs/hal/HalBtcOutSrc.h extern u32 GLBtcDbgType[]; · line 154

Quoted 9 lines
drivers/staging/rtl8723bs/hal/HalBtcOutSrc.h +3 -3
@@ -149,9 +149,9 @@ extern u32 		GLBtcDbgType[];
 }
 
 #else
-#define BTC_PRINT(dbgtype, dbgflag, printstr)		 no_printk printstr
-#define BTC_PRINT_F(dbgtype, dbgflag, printstr)		 no_printk printstr
-#define BTC_PRINT_ADDR(dbgtype, dbgflag, printstr, _Ptr) no_printk printstr
+#define BTC_PRINT(dbgtype, dbgflag, printstr)		 (no_printk printstr)
+#define BTC_PRINT_F(dbgtype, dbgflag, printstr)		 (no_printk printstr)
+#define BTC_PRINT_ADDR(dbgtype, dbgflag, printstr, _Ptr) (no_printk printstr)

This makes no sense at all. no_printk is a function. The BTC_PRINT() macros are super ugly and this only makes it worse.

Quoted 3 lines

regards,
dan carpenter

so I'll just drop the patch in the next v2

thanks,

fabio

#7 lore raw

PATCH 3/15 staging: rtl8723bs: put parentheses on macros with complex values in hal/odm_debug.h

In reply to Fabio Aiuto

fix the following checkpatch warnings:

ERROR: Macros with complex values should be enclosed in parentheses 153: FILE: drivers/staging/rtl8723bs/hal/odm_debug.h:153:
+#define ODM_RT_TRACE(pDM_Odm, comp, level, fmt) \
no_printk fmt
--
ERROR: Macros with complex values should be enclosed in parentheses 154: FILE: drivers/staging/rtl8723bs/hal/odm_debug.h:154:
+#define ODM_RT_TRACE_F(pDM_Odm, comp, level, fmt) \
no_printk fmt
--
ERROR: Macros with complex values should be enclosed in parentheses 155: FILE: drivers/staging/rtl8723bs/hal/odm_debug.h:155:
+#define ODM_RT_ASSERT(pDM_Odm, expr, fmt) \
no_printk fmt

---
 drivers/staging/rtl8723bs/hal/odm_debug.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/rtl8723bs/hal/odm_debug.h +3 -3
index be0d4c49a747..e6eb517c8685 100644
@@ -150,9 +150,9 @@
 		} \
 	} while (0)
 #else
-#define ODM_RT_TRACE(pDM_Odm, comp, level, fmt)		no_printk fmt
-#define ODM_RT_TRACE_F(pDM_Odm, comp, level, fmt)	no_printk fmt
-#define ODM_RT_ASSERT(pDM_Odm, expr, fmt)		no_printk fmt
+#define ODM_RT_TRACE(pDM_Odm, comp, level, fmt)		(no_printk fmt)
+#define ODM_RT_TRACE_F(pDM_Odm, comp, level, fmt)	(no_printk fmt)
+#define ODM_RT_ASSERT(pDM_Odm, expr, fmt)		(no_printk fmt)
 #define ODM_dbg_enter()					do {} while (0)
 #define ODM_dbg_exit()					do {} while (0)
 #define ODM_dbg_trace(str)				no_printk("%s", str)
Signature · 1 line
2.20.1
#8 lore raw

PATCH 4/15 staging: rtl8723bs: put parentheses on macros with complex values in include/basic_types.h

In reply to Fabio Aiuto

fix the following checkpatch warnings:

ERROR: Macros with complex values should be enclosed in parentheses 154: FILE: drivers/staging/rtl8723bs/include/basic_types.h:154:
+#define SET_BITS_TO_LE_4BYTE(__pstart, __bitoffset, __bitlen, __val) \
--
ERROR: Macros with multiple statements should be enclosed in a do - while loop
161: FILE: drivers/staging/rtl8723bs/include/basic_types.h:161:
+#define SET_BITS_TO_LE_2BYTE(__pstart, __bitoffset, __bitlen, __val) \
--
ERROR: Macros with complex values should be enclosed in parentheses 168: FILE: drivers/staging/rtl8723bs/include/basic_types.h:168:
+#define SET_BITS_TO_LE_1BYTE(__pstart, __bitoffset, __bitlen, __val) \

parentheses solution preferred for all fixes and made macros more readables

---
 .../staging/rtl8723bs/include/basic_types.h   | 30 +++++++++++--------
 1 file changed, 18 insertions(+), 12 deletions(-)
drivers/staging/rtl8723bs/include/basic_types.h +18 -12
index 76304086107a..5054c2e3384c 100644
@@ -152,24 +152,30 @@
 /* 		Set subfield of little-endian 4-byte value to specified value. */
 /*  */
 #define SET_BITS_TO_LE_4BYTE(__pstart, __bitoffset, __bitlen, __val) \
-		*((u32 *)(__pstart)) =				\
-		(						\
-		LE_BITS_CLEARED_TO_4BYTE(__pstart, __bitoffset, __bitlen) | \
-		((((u32)__val) & BIT_LEN_MASK_32(__bitlen)) << (__bitoffset)) \
+		(\
+			*((u32 *)(__pstart)) =				\
+			(						\
+				LE_BITS_CLEARED_TO_4BYTE(__pstart, __bitoffset, __bitlen) | \
+				((((u32)__val) & BIT_LEN_MASK_32(__bitlen)) << (__bitoffset)) \
+			)\
 		)
 
 #define SET_BITS_TO_LE_2BYTE(__pstart, __bitoffset, __bitlen, __val) \
-		*((u16 *)(__pstart)) =				\
-		(					\
-		LE_BITS_CLEARED_TO_2BYTE(__pstart, __bitoffset, __bitlen) | \
-		((((u16)__val) & BIT_LEN_MASK_16(__bitlen)) << (__bitoffset)) \
+		(\
+			*((u16 *)(__pstart)) =				\
+			(					\
+				LE_BITS_CLEARED_TO_2BYTE(__pstart, __bitoffset, __bitlen) | \
+				((((u16)__val) & BIT_LEN_MASK_16(__bitlen)) << (__bitoffset)) \
+			)\
 		);
 
 #define SET_BITS_TO_LE_1BYTE(__pstart, __bitoffset, __bitlen, __val) \
-		*((u8 *)(__pstart)) = EF1BYTE			\
-		(					\
-		LE_BITS_CLEARED_TO_1BYTE(__pstart, __bitoffset, __bitlen) | \
-		((((u8)__val) & BIT_LEN_MASK_8(__bitlen)) << (__bitoffset)) \
+		(\
+			*((u8 *)(__pstart)) = EF1BYTE			\
+			(					\
+				LE_BITS_CLEARED_TO_1BYTE(__pstart, __bitoffset, __bitlen) | \
+				((((u8)__val) & BIT_LEN_MASK_8(__bitlen)) << (__bitoffset)) \
+			)\
 		)
 
 #define LE_BITS_CLEARED_TO_1BYTE_8BIT(__pStart, __BitOffset, __BitLen) \
Signature · 1 line
2.20.1
#9 lore raw

Re: [PATCH 04/15] staging: rtl8723bs: put parentheses on macros with complex values in include/basic_types.h

Quoted 33 lines · Fabio Aiuto

fix the following checkpatch warnings:

ERROR: Macros with complex values should be enclosed in parentheses 154: FILE: drivers/staging/rtl8723bs/include/basic_types.h:154:
+#define SET_BITS_TO_LE_4BYTE(__pstart, __bitoffset, __bitlen, __val) \
--
ERROR: Macros with multiple statements should be enclosed in a do - while loop
161: FILE: drivers/staging/rtl8723bs/include/basic_types.h:161:
+#define SET_BITS_TO_LE_2BYTE(__pstart, __bitoffset, __bitlen, __val) \
--
ERROR: Macros with complex values should be enclosed in parentheses 168: FILE: drivers/staging/rtl8723bs/include/basic_types.h:168:
+#define SET_BITS_TO_LE_1BYTE(__pstart, __bitoffset, __bitlen, __val) \

parentheses solution preferred for all fixes and made macros more readables

---
 .../staging/rtl8723bs/include/basic_types.h   | 30 +++++++++++--------
 1 file changed, 18 insertions(+), 12 deletions(-)
drivers/staging/rtl8723bs/include/basic_types.h +0 -2
index 76304086107a..5054c2e3384c 100644
@@ -152,24 +152,30 @@
 /* 		Set subfield of little-endian 4-byte value to specified value. */
 /*  */
 #define SET_BITS_TO_LE_4BYTE(__pstart, __bitoffset, __bitlen, __val) \
-		*((u32 *)(__pstart)) =				\
-		(						\

drivers/staging/rtl8723bs/include/basic_types.h line 162

Quoted 10 lines
drivers/staging/rtl8723bs/include/basic_types.h +6 -2
-		LE_BITS_CLEARED_TO_4BYTE(__pstart, __bitoffset, __bitlen) | \
-		((((u32)__val) & BIT_LEN_MASK_32(__bitlen)) << (__bitoffset)) \
+		(\
+			*((u32 *)(__pstart)) =				\
+			(						\
+				LE_BITS_CLEARED_TO_4BYTE(__pstart, __bitoffset, __bitlen) | \
+				((((u32)__val) & BIT_LEN_MASK_32(__bitlen)) << (__bitoffset)) \
+			)\
 		)
 

These macros are terrible and this makes it uglier. Better to just ignore checkpatch until we can figure out a way to re-write this properly.

regards,
dan carpenter

#10 lore raw

Re: [PATCH 04/15] staging: rtl8723bs: put parentheses on macros with complex values in include/basic_types.h

Quoted 49 lines · Dan Carpenter
Quoted 33 lines · Fabio Aiuto

fix the following checkpatch warnings:

ERROR: Macros with complex values should be enclosed in parentheses 154: FILE: drivers/staging/rtl8723bs/include/basic_types.h:154:
+#define SET_BITS_TO_LE_4BYTE(__pstart, __bitoffset, __bitlen, __val) \
--
ERROR: Macros with multiple statements should be enclosed in a do - while loop
161: FILE: drivers/staging/rtl8723bs/include/basic_types.h:161:
+#define SET_BITS_TO_LE_2BYTE(__pstart, __bitoffset, __bitlen, __val) \
--
ERROR: Macros with complex values should be enclosed in parentheses 168: FILE: drivers/staging/rtl8723bs/include/basic_types.h:168:
+#define SET_BITS_TO_LE_1BYTE(__pstart, __bitoffset, __bitlen, __val) \

parentheses solution preferred for all fixes and made macros more readables

---
 .../staging/rtl8723bs/include/basic_types.h   | 30 +++++++++++--------
 1 file changed, 18 insertions(+), 12 deletions(-)
drivers/staging/rtl8723bs/include/basic_types.h +0 -2
index 76304086107a..5054c2e3384c 100644
@@ -152,24 +152,30 @@
 /* 		Set subfield of little-endian 4-byte value to specified value. */
 /*  */
 #define SET_BITS_TO_LE_4BYTE(__pstart, __bitoffset, __bitlen, __val) \
-		*((u32 *)(__pstart)) =				\
-		(						\

drivers/staging/rtl8723bs/include/basic_types.h line 162

Quoted 10 lines
drivers/staging/rtl8723bs/include/basic_types.h +6 -2
-		LE_BITS_CLEARED_TO_4BYTE(__pstart, __bitoffset, __bitlen) | \
-		((((u32)__val) & BIT_LEN_MASK_32(__bitlen)) << (__bitoffset)) \
+		(\
+			*((u32 *)(__pstart)) =				\
+			(						\
+				LE_BITS_CLEARED_TO_4BYTE(__pstart, __bitoffset, __bitlen) | \
+				((((u32)__val) & BIT_LEN_MASK_32(__bitlen)) << (__bitoffset)) \
+			)\
 		)
 

These macros are terrible and this makes it uglier. Better to just ignore checkpatch until we can figure out a way to re-write this properly.

Quoted 3 lines

regards,
dan carpenter

I see, will drop the patch for now.

thanks,

fabio

maintainer
#11 lore raw

Re: [PATCH 04/15] staging: rtl8723bs: put parentheses on macros with complex values in include/basic_types.h

Quoted 50 lines · Fabio Aiuto
Quoted 49 lines · Dan Carpenter
Quoted 33 lines · Fabio Aiuto

fix the following checkpatch warnings:

ERROR: Macros with complex values should be enclosed in parentheses 154: FILE: drivers/staging/rtl8723bs/include/basic_types.h:154:
+#define SET_BITS_TO_LE_4BYTE(__pstart, __bitoffset, __bitlen, __val) \
--
ERROR: Macros with multiple statements should be enclosed in a do - while loop
161: FILE: drivers/staging/rtl8723bs/include/basic_types.h:161:
+#define SET_BITS_TO_LE_2BYTE(__pstart, __bitoffset, __bitlen, __val) \
--
ERROR: Macros with complex values should be enclosed in parentheses 168: FILE: drivers/staging/rtl8723bs/include/basic_types.h:168:
+#define SET_BITS_TO_LE_1BYTE(__pstart, __bitoffset, __bitlen, __val) \

parentheses solution preferred for all fixes and made macros more readables

---
 .../staging/rtl8723bs/include/basic_types.h   | 30 +++++++++++--------
 1 file changed, 18 insertions(+), 12 deletions(-)
drivers/staging/rtl8723bs/include/basic_types.h +0 -2
index 76304086107a..5054c2e3384c 100644
@@ -152,24 +152,30 @@
 /* 		Set subfield of little-endian 4-byte value to specified value. */
 /*  */
 #define SET_BITS_TO_LE_4BYTE(__pstart, __bitoffset, __bitlen, __val) \
-		*((u32 *)(__pstart)) =				\
-		(						\

drivers/staging/rtl8723bs/include/basic_types.h line 162

Quoted 10 lines
drivers/staging/rtl8723bs/include/basic_types.h +6 -2
-		LE_BITS_CLEARED_TO_4BYTE(__pstart, __bitoffset, __bitlen) | \
-		((((u32)__val) & BIT_LEN_MASK_32(__bitlen)) << (__bitoffset)) \
+		(\
+			*((u32 *)(__pstart)) =				\
+			(						\
+				LE_BITS_CLEARED_TO_4BYTE(__pstart, __bitoffset, __bitlen) | \
+				((((u32)__val) & BIT_LEN_MASK_32(__bitlen)) << (__bitoffset)) \
+			)\
 		)
 

These macros are terrible and this makes it uglier. Better to just ignore checkpatch until we can figure out a way to re-write this properly.

Quoted 5 lines
Quoted 3 lines

regards,
dan carpenter

I see, will drop the patch for now.

Please resend a v2 set of this series so I know what to apply here...

thanks,

greg k-h

#12 lore raw

PATCH 5/15 staging: rtl8723bs: put parentheses on macros with complex values in include/drv_types.h

In reply to Fabio Aiuto

fix the following checkpatch warning:

ERROR: Macros with complex values should be enclosed in parentheses 279: FILE: drivers/staging/rtl8723bs/include/drv_types.h:279:
+#define KEY_ARG(x) ((u8 *)(x))[0], ((u8 *)(x))[1],
((u8 *)(x))[2], ((u8 *)(x))[3], ((u8 *)(x))[4], ((u8 *)(x))[5], \

---
 drivers/staging/rtl8723bs/include/drv_types.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rtl8723bs/include/drv_types.h +2 -2
index 1658450b386e..ead4cb9c1e5a 100644
@@ -276,9 +276,9 @@ struct cam_entry_cache {
 };
 
 #define KEY_FMT "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x"
-#define KEY_ARG(x) ((u8 *)(x))[0], ((u8 *)(x))[1], ((u8 *)(x))[2], ((u8 *)(x))[3], ((u8 *)(x))[4], ((u8 *)(x))[5], \
+#define KEY_ARG(x) (((u8 *)(x))[0], ((u8 *)(x))[1], ((u8 *)(x))[2], ((u8 *)(x))[3], ((u8 *)(x))[4], ((u8 *)(x))[5], \
 	((u8 *)(x))[6], ((u8 *)(x))[7], ((u8 *)(x))[8], ((u8 *)(x))[9], ((u8 *)(x))[10], ((u8 *)(x))[11], \
-	((u8 *)(x))[12], ((u8 *)(x))[13], ((u8 *)(x))[14], ((u8 *)(x))[15]
+	((u8 *)(x))[12], ((u8 *)(x))[13], ((u8 *)(x))[14], ((u8 *)(x))[15])
 
 struct dvobj_priv {
 	/*-------- below is common data --------*/
Signature · 1 line
2.20.1
#13 lore raw

Re: [PATCH 05/15] staging: rtl8723bs: put parentheses on macros with complex values in include/drv_types.h

Quoted 17 lines · Fabio Aiuto

fix the following checkpatch warning:

ERROR: Macros with complex values should be enclosed in parentheses 279: FILE: drivers/staging/rtl8723bs/include/drv_types.h:279:
+#define KEY_ARG(x) ((u8 *)(x))[0], ((u8 *)(x))[1],
((u8 *)(x))[2], ((u8 *)(x))[3], ((u8 *)(x))[4], ((u8 *)(x))[5], \

---
 drivers/staging/rtl8723bs/include/drv_types.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rtl8723bs/include/drv_types.h +0 -0
index 1658450b386e..ead4cb9c1e5a 100644

drivers/staging/rtl8723bs/include/drv_types.h struct cam_entry_cache { · line 281

Quoted 8 lines
drivers/staging/rtl8723bs/include/drv_types.h +2 -2
@@ -276,9 +276,9 @@ struct cam_entry_cache {
 };
 
 #define KEY_FMT "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x"
-#define KEY_ARG(x) ((u8 *)(x))[0], ((u8 *)(x))[1], ((u8 *)(x))[2], ((u8 *)(x))[3], ((u8 *)(x))[4], ((u8 *)(x))[5], \
+#define KEY_ARG(x) (((u8 *)(x))[0], ((u8 *)(x))[1], ((u8 *)(x))[2], ((u8 *)(x))[3], ((u8 *)(x))[4], ((u8 *)(x))[5], \
 	((u8 *)(x))[6], ((u8 *)(x))[7], ((u8 *)(x))[8], ((u8 *)(x))[9], ((u8 *)(x))[10], ((u8 *)(x))[11], \
-	((u8 *)(x))[12], ((u8 *)(x))[13], ((u8 *)(x))[14], ((u8 *)(x))[15]
+	((u8 *)(x))[12], ((u8 *)(x))[13], ((u8 *)(x))[14], ((u8 *)(x))[15])

KEY_ARG() isn't used anywhere that I can see. Just delete it.

Please take your time when you re-write this series and think about each change clearly and fix the underlying badness instead of just making checkpatch happy. I would really just throw out the patchset and start over from scratch.

regards,
dan carpenter

#14 lore raw

Re: [PATCH 05/15] staging: rtl8723bs: put parentheses on macros with complex values in include/drv_types.h

Quoted 29 lines · Dan Carpenter
Quoted 17 lines · Fabio Aiuto

fix the following checkpatch warning:

ERROR: Macros with complex values should be enclosed in parentheses 279: FILE: drivers/staging/rtl8723bs/include/drv_types.h:279:
+#define KEY_ARG(x) ((u8 *)(x))[0], ((u8 *)(x))[1],
((u8 *)(x))[2], ((u8 *)(x))[3], ((u8 *)(x))[4], ((u8 *)(x))[5], \

---
 drivers/staging/rtl8723bs/include/drv_types.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rtl8723bs/include/drv_types.h +0 -0
index 1658450b386e..ead4cb9c1e5a 100644

drivers/staging/rtl8723bs/include/drv_types.h struct cam_entry_cache { · line 281

Quoted 8 lines
drivers/staging/rtl8723bs/include/drv_types.h +2 -2
@@ -276,9 +276,9 @@ struct cam_entry_cache {
 };
 
 #define KEY_FMT "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x"
-#define KEY_ARG(x) ((u8 *)(x))[0], ((u8 *)(x))[1], ((u8 *)(x))[2], ((u8 *)(x))[3], ((u8 *)(x))[4], ((u8 *)(x))[5], \
+#define KEY_ARG(x) (((u8 *)(x))[0], ((u8 *)(x))[1], ((u8 *)(x))[2], ((u8 *)(x))[3], ((u8 *)(x))[4], ((u8 *)(x))[5], \
 	((u8 *)(x))[6], ((u8 *)(x))[7], ((u8 *)(x))[8], ((u8 *)(x))[9], ((u8 *)(x))[10], ((u8 *)(x))[11], \
-	((u8 *)(x))[12], ((u8 *)(x))[13], ((u8 *)(x))[14], ((u8 *)(x))[15]
+	((u8 *)(x))[12], ((u8 *)(x))[13], ((u8 *)(x))[14], ((u8 *)(x))[15])

KEY_ARG() isn't used anywhere that I can see. Just delete it.

Quoted 8 lines

Please take your time when you re-write this series and think about each change clearly and fix the underlying badness instead of just making checkpatch happy. I would really just throw out the patchset and start over from scratch.

regards,
dan carpenter

Hi Dan,

KEY_FMT is unused as well. I'm rewriting the whole series, will send v2.

thank you,

fabio

#15 lore raw

PATCH 6/15 staging: rtl8723bs: put parentheses on macros with complex values in include/hal_com.h

In reply to Fabio Aiuto

fix the following checkpatch warnings:

ERROR: Macros with complex values should be enclosed in parentheses 187: FILE: drivers/staging/rtl8723bs/include/hal_com.h:187:
+#define PageNum_128(_Len)

		(u32)(((_Len)>>7) + ((_Len)&0x7F ? 1:0))

--
ERROR: Macros with complex values should be enclosed in parentheses 188: FILE: drivers/staging/rtl8723bs/include/hal_com.h:188:
+#define PageNum_256(_Len)

		(u32)(((_Len)>>8) + ((_Len)&0xFF ? 1:0))

--
ERROR: Macros with complex values should be enclosed in parentheses 189: FILE: drivers/staging/rtl8723bs/include/hal_com.h:189:
+#define PageNum_512(_Len)

		(u32)(((_Len)>>9) + ((_Len)&0x1FF ? 1:0))

--
ERROR: Macros with complex values should be enclosed in parentheses 190: FILE: drivers/staging/rtl8723bs/include/hal_com.h:190:
+#define PageNum(_Len, _Size)

		(u32)(((_Len)/(_Size)) + ((_Len)&((_Size) - 1) ? 1:0))
---
 drivers/staging/rtl8723bs/include/hal_com.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/staging/rtl8723bs/include/hal_com.h +4 -4
index 28451385dec3..0bc0e1361765 100644
@@ -184,10 +184,10 @@ enum firmware_source {
 #define TX_SELE_NQ			BIT(2)		/*  Normal Queue */
 #define TX_SELE_EQ			BIT(3)		/*  Extern Queue */
 
-#define PageNum_128(_Len)		(u32)(((_Len)>>7) + ((_Len)&0x7F ? 1:0))
-#define PageNum_256(_Len)		(u32)(((_Len)>>8) + ((_Len)&0xFF ? 1:0))
-#define PageNum_512(_Len)		(u32)(((_Len)>>9) + ((_Len)&0x1FF ? 1:0))
-#define PageNum(_Len, _Size)		(u32)(((_Len)/(_Size)) + ((_Len)&((_Size) - 1) ? 1:0))
+#define PageNum_128(_Len)		((u32)(((_Len)>>7) + ((_Len)&0x7F ? 1:0)))
+#define PageNum_256(_Len)		((u32)(((_Len)>>8) + ((_Len)&0xFF ? 1:0)))
+#define PageNum_512(_Len)		((u32)(((_Len)>>9) + ((_Len)&0x1FF ? 1:0)))
+#define PageNum(_Len, _Size)		((u32)(((_Len)/(_Size)) + ((_Len)&((_Size) - 1) ? 1:0)))
 
 
 u8 rtw_hal_data_init(struct adapter *padapter);
Signature · 1 line
2.20.1
#16 lore raw

PATCH 7/15 staging: rtl8723bs: put parentheses on macros with complex values in include/hal_com_reg.h

In reply to Fabio Aiuto

fix the following checkpatch warnings:

ERROR: Macros with complex values should be enclosed in parentheses 710: FILE: drivers/staging/rtl8723bs/include/hal_com_reg.h:710:
+#define RATE_ALL_CCK

			RATR_1M | RATR_2M | RATR_55M | RATR_11M

--
ERROR: Macros with complex values should be enclosed in parentheses 711: FILE: drivers/staging/rtl8723bs/include/hal_com_reg.h:711:
+#define RATE_ALL_OFDM_AG

		RATR_6M | RATR_9M | RATR_12M | RATR_18M | RATR_24M |\

--
ERROR: Macros with complex values should be enclosed in parentheses 713: FILE: drivers/staging/rtl8723bs/include/hal_com_reg.h:713:
+#define RATE_ALL_OFDM_1SS

		RATR_MCS0 | RATR_MCS1 | RATR_MCS2 | RATR_MCS3 |\

--
ERROR: Macros with complex values should be enclosed in parentheses 715: FILE: drivers/staging/rtl8723bs/include/hal_com_reg.h:715:
+#define RATE_ALL_OFDM_2SS

		RATR_MCS8 | RATR_MCS9 | RATR_MCS10 | RATR_MCS11 |\
---
 drivers/staging/rtl8723bs/include/hal_com_reg.h | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/staging/rtl8723bs/include/hal_com_reg.h +7 -7
index b555826760d0..b5610dedc23e 100644
@@ -707,13 +707,13 @@ Default: 00b.
 
 
 /*  ALL CCK Rate */
-#define	RATE_ALL_CCK				RATR_1M | RATR_2M | RATR_55M | RATR_11M
-#define	RATE_ALL_OFDM_AG			RATR_6M | RATR_9M | RATR_12M | RATR_18M | RATR_24M |\
-						RATR_36M | RATR_48M | RATR_54M
-#define	RATE_ALL_OFDM_1SS			RATR_MCS0 | RATR_MCS1 | RATR_MCS2 | RATR_MCS3 |\
-						RATR_MCS4 | RATR_MCS5 | RATR_MCS6 | RATR_MCS7
-#define	RATE_ALL_OFDM_2SS			RATR_MCS8 | RATR_MCS9 | RATR_MCS10 | RATR_MCS11 |\
-						RATR_MCS12 | RATR_MCS13 | RATR_MCS14 | RATR_MCS15
+#define	RATE_ALL_CCK				(RATR_1M | RATR_2M | RATR_55M | RATR_11M)
+#define	RATE_ALL_OFDM_AG			(RATR_6M | RATR_9M | RATR_12M | RATR_18M | RATR_24M |\
+						RATR_36M | RATR_48M | RATR_54M)
+#define	RATE_ALL_OFDM_1SS			(RATR_MCS0 | RATR_MCS1 | RATR_MCS2 | RATR_MCS3 |\
+						RATR_MCS4 | RATR_MCS5 | RATR_MCS6 | RATR_MCS7)
+#define	RATE_ALL_OFDM_2SS			(RATR_MCS8 | RATR_MCS9 | RATR_MCS10 | RATR_MCS11 |\
+						RATR_MCS12 | RATR_MCS13 | RATR_MCS14 | RATR_MCS15)
 
 #define RATE_BITMAP_ALL			0xFFFFF
 
Signature · 1 line
2.20.1
#17 lore raw

PATCH 8/15 staging: rtl8723bs: put parentheses on macros with complex values in include/hal_data.h

In reply to Fabio Aiuto

fix the following checkpatch warnings:

ERROR: Macros with complex values should be enclosed in parentheses 49: FILE: drivers/staging/rtl8723bs/include/hal_data.h:49:
+#define CHANNEL_MAX_NUMBER

		14+24+21	/*  14 is the max channel number */

--
ERROR: Macros with complex values should be enclosed in parentheses 53: FILE: drivers/staging/rtl8723bs/include/hal_data.h:53:
+#define CHANNEL_GROUP_MAX

		3+9	/*  ch1~3, ch4~9, ch10~14 total three groups */

--
ERROR: Macros with complex values should be enclosed in parentheses 76: FILE: drivers/staging/rtl8723bs/include/hal_data.h:76:
+#define IQK_Matrix_Settings_NUM_92D 1+24+21

---
 drivers/staging/rtl8723bs/include/hal_data.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/rtl8723bs/include/hal_data.h +3 -3
index b5a0be35a6ce..2f73540dd738 100644
@@ -46,11 +46,11 @@ enum rt_ampdu_burst {
 	RT_AMPDU_BURST_8723B	= 7,
 };
 
-#define CHANNEL_MAX_NUMBER		14+24+21	/*  14 is the max channel number */
+#define CHANNEL_MAX_NUMBER		(14+24+21)	/*  14 is the max channel number */
 #define CHANNEL_MAX_NUMBER_2G		14
 #define CHANNEL_MAX_NUMBER_5G		54			/*  Please refer to "phy_GetChnlGroup8812A" and "Hal_ReadTxPowerInfo8812A" */
 #define CHANNEL_MAX_NUMBER_5G_80M	7
-#define CHANNEL_GROUP_MAX		3+9	/*  ch1~3, ch4~9, ch10~14 total three groups */
+#define CHANNEL_GROUP_MAX		(3+9)	/*  ch1~3, ch4~9, ch10~14 total three groups */
 #define MAX_PG_GROUP			13
 
 /*  Tx Power Limit Table Size */
@@ -73,7 +73,7 @@ enum rt_ampdu_burst {
 #define IQK_BB_REG_NUM_92D	10
 #define IQK_BB_REG_NUM_test	6
 
-#define IQK_Matrix_Settings_NUM_92D	1+24+21
+#define IQK_Matrix_Settings_NUM_92D	(1+24+21)
 
 /* define HP_THERMAL_NUM		8 */
 /*  duplicate code, will move to ODM ######### */
Signature · 1 line
2.20.1
#18 lore raw

PATCH 9/15 staging: rtl8723bs: put parentheses on macros with complex values in include/hal_phy.h

In reply to Fabio Aiuto

fix the following checkpatch warning:

ERROR: Macros with complex values should be enclosed in parentheses 27: FILE: drivers/staging/rtl8723bs/include/hal_phy.h:27:
+#define RF6052_MAX_REG \

---
 drivers/staging/rtl8723bs/include/hal_phy.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8723bs/include/hal_phy.h +1 -1
index 90bb5d784674..5aec04f705b1 100644
@@ -25,7 +25,7 @@
 #define	RF6052_MAX_REG_92C			0x7F
 
 #define	RF6052_MAX_REG	\
-		(RF6052_MAX_REG_88E > RF6052_MAX_REG_92C) ? RF6052_MAX_REG_88E : RF6052_MAX_REG_92C
+		((RF6052_MAX_REG_88E > RF6052_MAX_REG_92C) ? RF6052_MAX_REG_88E : RF6052_MAX_REG_92C)
 
 #define GET_RF6052_REAL_MAX_REG(_Adapter)	RF6052_MAX_REG_92C
 
Signature · 1 line
2.20.1
#19 lore raw

PATCH 10/15 staging: rtl8723bs: put parentheses on macros with complex values in include/ieee80211.h

In reply to Fabio Aiuto

fix the following checkpatch warning:

ERROR: Macros with complex values should be enclosed in parentheses 823: FILE: drivers/staging/rtl8723bs/include/ieee80211.h:823:
+#define CHAN_ARG(channel) \

---
 drivers/staging/rtl8723bs/include/ieee80211.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rtl8723bs/include/ieee80211.h +2 -2
index 8a10bca876b8..80df24c1c6ed 100644
@@ -823,8 +823,8 @@ struct rtw_ieee80211_channel {
 #define CHAN_ARG(channel) \
 	/*(channel)->band*/ \
 	/*, (channel)->center_freq*/ \
-	(channel)->hw_value \
-	, (channel)->flags \
+	((channel)->hw_value \
+	, (channel)->flags) \
 	/*, (channel)->max_antenna_gain*/ \
 	/*, (channel)->max_power*/ \
 	/*, (channel)->max_reg_power*/ \
Signature · 1 line
2.20.1
#20 lore raw

PATCH 11/15 staging: rtl8723bs: put parentheses on macros with complex values in include/rtw_debug.h

In reply to Fabio Aiuto

fix the following checkpatch warning:

ERROR: Macros starting with if should be enclosed by a do - while loop to avoid possible if/else logic defects
+ #define RT_PRINT_DATA(_Comp, _Level,

	_TitleString, _HexData, _HexDataLen)			\
---
 drivers/staging/rtl8723bs/include/rtw_debug.h | 28 ++++++++++---------
 1 file changed, 15 insertions(+), 13 deletions(-)
drivers/staging/rtl8723bs/include/rtw_debug.h +15 -13
index d1c557818305..b00f8a6c4312 100644
@@ -236,19 +236,21 @@
 #if	defined(_dbgdump)
 	#undef RT_PRINT_DATA
 	#define RT_PRINT_DATA(_Comp, _Level, _TitleString, _HexData, _HexDataLen)			\
-		if (((_Comp) & GlobalDebugComponents) && (_Level <= GlobalDebugLevel))	\
-		{									\
-			int __i;								\
-			u8 *ptr = (u8 *)_HexData;				\
-			_dbgdump("%s", DRIVER_PREFIX);						\
-			_dbgdump(_TitleString);						\
-			for (__i = 0; __i < (int)_HexDataLen; __i++)				\
-			{								\
-				_dbgdump("%02X%s", ptr[__i], (((__i + 1) % 4) == 0)?"  ":" ");	\
-				if (((__i + 1) % 16) == 0)	_dbgdump("\n");			\
-			}								\
-			_dbgdump("\n");							\
-		}
+		do { \
+			if (((_Comp) & GlobalDebugComponents) && (_Level <= GlobalDebugLevel))	\
+			{									\
+				int __i;								\
+				u8 *ptr = (u8 *)_HexData;				\
+				_dbgdump("%s", DRIVER_PREFIX);						\
+				_dbgdump(_TitleString);						\
+				for (__i = 0; __i < (int)_HexDataLen; __i++)				\
+				{								\
+					_dbgdump("%02X%s", ptr[__i], (((__i + 1) % 4) == 0)?"  ":" ");	\
+					if (((__i + 1) % 16) == 0)	_dbgdump("\n");			\
+				}								\
+				_dbgdump("\n");							\
+			} \
+		} while (0)
 #endif /* defined(_dbgdump) */
 #endif /* DEBUG_RTL871X */
 
Signature · 1 line
2.20.1
#21 lore raw

PATCH 12/15 staging: rtl8723bs: put parentheses on macros with complex values in include/rtw_pwrctrl.h

In reply to Fabio Aiuto

fix the following checkpatch warnings:

ERROR: Macros with complex values should be enclosed in parentheses 92: FILE: drivers/staging/rtl8723bs/include/rtw_pwrctrl.h:92:
+#define LPS_DELAY_TIME 1*HZ /* 1 sec */
--
ERROR: Macros with complex values should be enclosed in parentheses 241: FILE: drivers/staging/rtl8723bs/include/rtw_pwrctrl.h:241:
+#define rtw_get_ips_mode_req(pwrctl) \
--
ERROR: Macros with complex values should be enclosed in parentheses 244: FILE: drivers/staging/rtl8723bs/include/rtw_pwrctrl.h:244:
+#define rtw_ips_mode_req(pwrctl, ips_mode) \

---
 drivers/staging/rtl8723bs/include/rtw_pwrctrl.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/rtl8723bs/include/rtw_pwrctrl.h +3 -3
index cec9fc0cf794..688436cf3610 100644
@@ -89,7 +89,7 @@ struct reportpwrstate_parm {
 	unsigned short rsvd;
 };
 
-#define LPS_DELAY_TIME	1*HZ /*  1 sec */
+#define LPS_DELAY_TIME	(1*HZ) /*  1 sec */
 
 #define EXE_PWR_NONE	0x01
 #define EXE_PWR_IPS		0x02
@@ -239,10 +239,10 @@ struct pwrctrl_priv {
 };
 
 #define rtw_get_ips_mode_req(pwrctl) \
-	(pwrctl)->ips_mode_req
+	((pwrctl)->ips_mode_req)
 
 #define rtw_ips_mode_req(pwrctl, ips_mode) \
-	(pwrctl)->ips_mode_req = (ips_mode)
+	((pwrctl)->ips_mode_req = (ips_mode))
 
 #define RTW_PWR_STATE_CHK_INTERVAL 2000
 
Signature · 1 line
2.20.1
#22 lore raw

PATCH 13/15 staging: rtl8723bs: add spaces around operator in include/rtw_pwrctrl.h

In reply to Fabio Aiuto

fix post-commit hook checkpatch warning:

add a space around that '*'

---
 drivers/staging/rtl8723bs/include/rtw_pwrctrl.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8723bs/include/rtw_pwrctrl.h +1 -1
index 688436cf3610..88e66211e0e3 100644
@@ -89,7 +89,7 @@ struct reportpwrstate_parm {
 	unsigned short rsvd;
 };
 
-#define LPS_DELAY_TIME	(1*HZ) /*  1 sec */
+#define LPS_DELAY_TIME	(1 * HZ) /*  1 sec */
 
 #define EXE_PWR_NONE	0x01
 #define EXE_PWR_IPS		0x02
Signature · 1 line
2.20.1
#23 lore raw

PATCH 14/15 staging: rtl8723bs: put parentheses on macros with complex values in include/sta_info.h

In reply to Fabio Aiuto

fix the following checkpatch warnings:

ERROR: Macros with complex values should be enclosed in parentheses 284: FILE: drivers/staging/rtl8723bs/include/sta_info.h:284:
+#define STA_RX_PKTS_ARG(sta) \
--
ERROR: Macros with complex values should be enclosed in parentheses 289: FILE: drivers/staging/rtl8723bs/include/sta_info.h:289:
+#define STA_LAST_RX_PKTS_ARG(sta) \
--
ERROR: Macros with complex values should be enclosed in parentheses 294: FILE: drivers/staging/rtl8723bs/include/sta_info.h:294:
+#define STA_RX_PKTS_DIFF_ARG(sta) \

---
 drivers/staging/rtl8723bs/include/sta_info.h | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/staging/rtl8723bs/include/sta_info.h +6 -6
index abde3e3df988..1cdf93ec3b66 100644
@@ -282,19 +282,19 @@ struct sta_info {
 	} while (0)
 
 #define STA_RX_PKTS_ARG(sta) \
-	sta->sta_stats.rx_mgnt_pkts \
+	(sta->sta_stats.rx_mgnt_pkts \
 	, sta->sta_stats.rx_ctrl_pkts \
-	, sta->sta_stats.rx_data_pkts
+	, sta->sta_stats.rx_data_pkts)
 
 #define STA_LAST_RX_PKTS_ARG(sta) \
-	sta->sta_stats.last_rx_mgnt_pkts \
+	(sta->sta_stats.last_rx_mgnt_pkts \
 	, sta->sta_stats.last_rx_ctrl_pkts \
-	, sta->sta_stats.last_rx_data_pkts
+	, sta->sta_stats.last_rx_data_pkts)
 
 #define STA_RX_PKTS_DIFF_ARG(sta) \
-	sta->sta_stats.rx_mgnt_pkts - sta->sta_stats.last_rx_mgnt_pkts \
+	(sta->sta_stats.rx_mgnt_pkts - sta->sta_stats.last_rx_mgnt_pkts \
 	, sta->sta_stats.rx_ctrl_pkts - sta->sta_stats.last_rx_ctrl_pkts \
-	, sta->sta_stats.rx_data_pkts - sta->sta_stats.last_rx_data_pkts
+	, sta->sta_stats.rx_data_pkts - sta->sta_stats.last_rx_data_pkts)
 
 #define STA_PKTS_FMT "(m:%llu, c:%llu, d:%llu)"
 
Signature · 1 line
2.20.1
#24 lore raw

RE: [PATCH 14/15] staging: rtl8723bs: put parentheses on macros with complex values in include/sta_info.h

From: Fabio Aiuto

Quoted 27 lines

Sent: 26 March 2021 09:09

fix the following checkpatch warnings:

ERROR: Macros with complex values should be enclosed in parentheses 284: FILE: drivers/staging/rtl8723bs/include/sta_info.h:284:
+#define STA_RX_PKTS_ARG(sta) \
--
ERROR: Macros with complex values should be enclosed in parentheses 289: FILE: drivers/staging/rtl8723bs/include/sta_info.h:289:
+#define STA_LAST_RX_PKTS_ARG(sta) \
--
ERROR: Macros with complex values should be enclosed in parentheses 294: FILE: drivers/staging/rtl8723bs/include/sta_info.h:294:
+#define STA_RX_PKTS_DIFF_ARG(sta) \

---
 drivers/staging/rtl8723bs/include/sta_info.h | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/staging/rtl8723bs/include/sta_info.h +0 -0
index abde3e3df988..1cdf93ec3b66 100644

drivers/staging/rtl8723bs/include/sta_info.h struct sta_info { · line 287

Quoted 8 lines
drivers/staging/rtl8723bs/include/sta_info.h +2 -2
@@ -282,19 +282,19 @@ struct sta_info {
 	} while (0)
 
 #define STA_RX_PKTS_ARG(sta) \
-	sta->sta_stats.rx_mgnt_pkts \
+	(sta->sta_stats.rx_mgnt_pkts \
 	, sta->sta_stats.rx_ctrl_pkts \
-	, sta->sta_stats.rx_data_pkts
+	, sta->sta_stats.rx_data_pkts)

That doesn't look right at all.
You've changed what is (probably) a list of arguments to a function into a comma operator list.

David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)

#25 lore raw

Re: [PATCH 14/15] staging: rtl8723bs: put parentheses on macros with complex values in include/sta_info.h

Quoted 41 lines · David Laight

From: Fabio Aiuto

Quoted 27 lines

Sent: 26 March 2021 09:09

fix the following checkpatch warnings:

ERROR: Macros with complex values should be enclosed in parentheses 284: FILE: drivers/staging/rtl8723bs/include/sta_info.h:284:
+#define STA_RX_PKTS_ARG(sta) \
--
ERROR: Macros with complex values should be enclosed in parentheses 289: FILE: drivers/staging/rtl8723bs/include/sta_info.h:289:
+#define STA_LAST_RX_PKTS_ARG(sta) \
--
ERROR: Macros with complex values should be enclosed in parentheses 294: FILE: drivers/staging/rtl8723bs/include/sta_info.h:294:
+#define STA_RX_PKTS_DIFF_ARG(sta) \

---
 drivers/staging/rtl8723bs/include/sta_info.h | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/staging/rtl8723bs/include/sta_info.h +0 -0
index abde3e3df988..1cdf93ec3b66 100644

drivers/staging/rtl8723bs/include/sta_info.h struct sta_info { · line 287

Quoted 8 lines
drivers/staging/rtl8723bs/include/sta_info.h +2 -2
@@ -282,19 +282,19 @@ struct sta_info {
 	} while (0)
 
 #define STA_RX_PKTS_ARG(sta) \
-	sta->sta_stats.rx_mgnt_pkts \
+	(sta->sta_stats.rx_mgnt_pkts \
 	, sta->sta_stats.rx_ctrl_pkts \
-	, sta->sta_stats.rx_data_pkts
+	, sta->sta_stats.rx_data_pkts)

That doesn't look right at all.
You've changed what is (probably) a list of arguments to a function into a comma operator list.

Quoted 6 lines

David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)

ops, you're right David, thank you and sorry to all for noise.

fabio

#26 lore raw

PATCH 15/15 staging: rtl8723bs: put parentheses on macros with complex values in include/wifi.h

In reply to Fabio Aiuto

fix the following checkpatch warnings:

ERROR: Macros with complex values should be enclosed in parentheses 114: FILE: drivers/staging/rtl8723bs/include/wifi.h:114:
+#define SetToDs(pbuf) \
--
ERROR: Macros with complex values should be enclosed in parentheses 119: FILE: drivers/staging/rtl8723bs/include/wifi.h:119:
+#define ClearToDs(pbuf) \
--
ERROR: Macros with complex values should be enclosed in parentheses 122: FILE: drivers/staging/rtl8723bs/include/wifi.h:122:
+#define SetFrDs(pbuf) \
--
ERROR: Macros with complex values should be enclosed in parentheses 127: FILE: drivers/staging/rtl8723bs/include/wifi.h:127:
+#define ClearFrDs(pbuf) \
--
ERROR: Macros with complex values should be enclosed in parentheses 132: FILE: drivers/staging/rtl8723bs/include/wifi.h:132:
+#define SetMFrag(pbuf) \
--
ERROR: Macros with complex values should be enclosed in parentheses 137: FILE: drivers/staging/rtl8723bs/include/wifi.h:137:
+#define ClearMFrag(pbuf) \
--
ERROR: Macros with complex values should be enclosed in parentheses 140: FILE: drivers/staging/rtl8723bs/include/wifi.h:140:
+#define SetRetry(pbuf) \
--
ERROR: Macros with complex values should be enclosed in parentheses 145: FILE: drivers/staging/rtl8723bs/include/wifi.h:145:
+#define ClearRetry(pbuf) \
--
ERROR: Macros with complex values should be enclosed in parentheses 148: FILE: drivers/staging/rtl8723bs/include/wifi.h:148:
+#define SetPwrMgt(pbuf) \
--
ERROR: Macros with complex values should be enclosed in parentheses 153: FILE: drivers/staging/rtl8723bs/include/wifi.h:153:
+#define ClearPwrMgt(pbuf) \
--
ERROR: Macros with complex values should be enclosed in parentheses 156: FILE: drivers/staging/rtl8723bs/include/wifi.h:156:
+#define SetMData(pbuf) \
--
ERROR: Macros with complex values should be enclosed in parentheses 161: FILE: drivers/staging/rtl8723bs/include/wifi.h:161:
+#define ClearMData(pbuf) \
--
ERROR: Macros with complex values should be enclosed in parentheses 164: FILE: drivers/staging/rtl8723bs/include/wifi.h:164:
+#define SetPrivacy(pbuf) \
--
ERROR: Macros with complex values should be enclosed in parentheses 170: FILE: drivers/staging/rtl8723bs/include/wifi.h:170:
+#define ClearPrivacy(pbuf) \
--
ERROR: Macros with complex values should be enclosed in parentheses 220: FILE: drivers/staging/rtl8723bs/include/wifi.h:220:
+#define SetDuration(pbuf, dur) \
--
ERROR: Macros with complex values should be enclosed in parentheses 224: FILE: drivers/staging/rtl8723bs/include/wifi.h:224:
+#define SetPriority(pbuf, tid) \
--
ERROR: Macros with complex values should be enclosed in parentheses 229: FILE: drivers/staging/rtl8723bs/include/wifi.h:229:
+#define SetEOSP(pbuf, eosp) \
--
ERROR: Macros with complex values should be enclosed in parentheses 232: FILE: drivers/staging/rtl8723bs/include/wifi.h:232:
+#define SetAckpolicy(pbuf, ack) \
--
ERROR: Macros with complex values should be enclosed in parentheses 239: FILE: drivers/staging/rtl8723bs/include/wifi.h:239:
+#define SetAMsdu(pbuf, amsdu) \

---
 drivers/staging/rtl8723bs/include/wifi.h | 38 ++++++++++++------------
 1 file changed, 19 insertions(+), 19 deletions(-)
drivers/staging/rtl8723bs/include/wifi.h +19 -19
index efef549bf811..a9f24fc2bf2f 100644
@@ -112,63 +112,63 @@ enum wifi_reg_domain {
 #define _ORDER_			BIT(15)
 
 #define SetToDs(pbuf)	\
-	*(__le16 *)(pbuf) |= cpu_to_le16(_TO_DS_)
+	(*(__le16 *)(pbuf) |= cpu_to_le16(_TO_DS_))
 
 #define GetToDs(pbuf)	(((*(__le16 *)(pbuf)) & cpu_to_le16(_TO_DS_)) != 0)
 
 #define ClearToDs(pbuf)	\
-	*(__le16 *)(pbuf) &= (~cpu_to_le16(_TO_DS_))
+	(*(__le16 *)(pbuf) &= (~cpu_to_le16(_TO_DS_)))
 
 #define SetFrDs(pbuf)	\
-	*(__le16 *)(pbuf) |= cpu_to_le16(_FROM_DS_)
+	(*(__le16 *)(pbuf) |= cpu_to_le16(_FROM_DS_))
 
 #define GetFrDs(pbuf)	(((*(__le16 *)(pbuf)) & cpu_to_le16(_FROM_DS_)) != 0)
 
 #define ClearFrDs(pbuf)	\
-	*(__le16 *)(pbuf) &= (~cpu_to_le16(_FROM_DS_))
+	(*(__le16 *)(pbuf) &= (~cpu_to_le16(_FROM_DS_)))
 
 #define get_tofr_ds(pframe)	((GetToDs(pframe) << 1) | GetFrDs(pframe))
 
 #define SetMFrag(pbuf)	\
-	*(__le16 *)(pbuf) |= cpu_to_le16(_MORE_FRAG_)
+	(*(__le16 *)(pbuf) |= cpu_to_le16(_MORE_FRAG_))
 
 #define GetMFrag(pbuf)	(((*(__le16 *)(pbuf)) & cpu_to_le16(_MORE_FRAG_)) != 0)
 
 #define ClearMFrag(pbuf)	\
-	*(__le16 *)(pbuf) &= (~cpu_to_le16(_MORE_FRAG_))
+	(*(__le16 *)(pbuf) &= (~cpu_to_le16(_MORE_FRAG_)))
 
 #define SetRetry(pbuf)	\
-	*(__le16 *)(pbuf) |= cpu_to_le16(_RETRY_)
+	(*(__le16 *)(pbuf) |= cpu_to_le16(_RETRY_))
 
 #define GetRetry(pbuf)	(((*(__le16 *)(pbuf)) & cpu_to_le16(_RETRY_)) != 0)
 
 #define ClearRetry(pbuf)	\
-	*(__le16 *)(pbuf) &= (~cpu_to_le16(_RETRY_))
+	(*(__le16 *)(pbuf) &= (~cpu_to_le16(_RETRY_)))
 
 #define SetPwrMgt(pbuf)	\
-	*(__le16 *)(pbuf) |= cpu_to_le16(_PWRMGT_)
+	(*(__le16 *)(pbuf) |= cpu_to_le16(_PWRMGT_))
 
 #define GetPwrMgt(pbuf)	(((*(__le16 *)(pbuf)) & cpu_to_le16(_PWRMGT_)) != 0)
 
 #define ClearPwrMgt(pbuf)	\
-	*(__le16 *)(pbuf) &= (~cpu_to_le16(_PWRMGT_))
+	(*(__le16 *)(pbuf) &= (~cpu_to_le16(_PWRMGT_)))
 
 #define SetMData(pbuf)	\
-	*(__le16 *)(pbuf) |= cpu_to_le16(_MORE_DATA_)
+	(*(__le16 *)(pbuf) |= cpu_to_le16(_MORE_DATA_))
 
 #define GetMData(pbuf)	(((*(__le16 *)(pbuf)) & cpu_to_le16(_MORE_DATA_)) != 0)
 
 #define ClearMData(pbuf)	\
-	*(__le16 *)(pbuf) &= (~cpu_to_le16(_MORE_DATA_))
+	(*(__le16 *)(pbuf) &= (~cpu_to_le16(_MORE_DATA_)))
 
 #define SetPrivacy(pbuf)	\
-	*(__le16 *)(pbuf) |= cpu_to_le16(_PRIVACY_)
+	(*(__le16 *)(pbuf) |= cpu_to_le16(_PRIVACY_))
 
 #define GetPrivacy(pbuf)					\
 	(((*(__le16 *)(pbuf)) & cpu_to_le16(_PRIVACY_)) != 0)
 
 #define ClearPrivacy(pbuf)	\
-	*(__le16 *)(pbuf) &= (~cpu_to_le16(_PRIVACY_))
+	(*(__le16 *)(pbuf) &= (~cpu_to_le16(_PRIVACY_)))
 
 
 #define GetOrder(pbuf)					\
@@ -218,26 +218,26 @@ enum wifi_reg_domain {
 	} while (0)
 
 #define SetDuration(pbuf, dur) \
-	*(__le16 *)((size_t)(pbuf) + 2) = cpu_to_le16(0xffff & (dur))
+	(*(__le16 *)((size_t)(pbuf) + 2) = cpu_to_le16(0xffff & (dur)))
 
 
 #define SetPriority(pbuf, tid)	\
-	*(__le16 *)(pbuf) |= cpu_to_le16(tid & 0xf)
+	(*(__le16 *)(pbuf) |= cpu_to_le16(tid & 0xf))
 
 #define GetPriority(pbuf)	((le16_to_cpu(*(__le16 *)(pbuf))) & 0xf)
 
 #define SetEOSP(pbuf, eosp)	\
-		*(__le16 *)(pbuf) |= cpu_to_le16((eosp & 1) << 4)
+		(*(__le16 *)(pbuf) |= cpu_to_le16((eosp & 1) << 4))
 
 #define SetAckpolicy(pbuf, ack)	\
-	*(__le16 *)(pbuf) |= cpu_to_le16((ack & 3) << 5)
+	(*(__le16 *)(pbuf) |= cpu_to_le16((ack & 3) << 5))
 
 #define GetAckpolicy(pbuf) (((le16_to_cpu(*(__le16 *)pbuf)) >> 5) & 0x3)
 
 #define GetAMsdu(pbuf) (((le16_to_cpu(*(__le16 *)pbuf)) >> 7) & 0x1)
 
 #define SetAMsdu(pbuf, amsdu)	\
-	*(__le16 *)(pbuf) |= cpu_to_le16((amsdu & 1) << 7)
+	(*(__le16 *)(pbuf) |= cpu_to_le16((amsdu & 1) << 7))
 
 #define GetAid(pbuf)	(le16_to_cpu(*(__le16 *)((size_t)(pbuf) + 2)) & 0x3fff)
 
Signature · 1 line
2.20.1