Skip to contentSkip to conversation

staging: rtl8723bs: fix coding style issues and improve readability

PATCH Superseded Ali Nasrolahi 2 participants 5 messages Jul 20, 2025 – Jul 21, 2025 Staging

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover staging: rtl8723bs: fix coding style issues and improve readability

This patch series addresses several coding style and comment formatting issues in the rtl8723bs staging driver as reported by checkpatch.pl.

Changes include:
- Fixing block comment markers and alignment
- Improving function declaration readability
- Replacing unnamed parameters with named ones
- Removing redundant semicolons and excess spacing

No functional changes are introduced in this series.

Ali Nasrolahi (3):
staging: rtl8723bs: fix comment style and formatting in osdep_service.c
staging: rtl8723bs: fix comment formatting in basic_types.h
staging: rtl8723bs: replace unnamed parameters in hal_btcoex.h for consistency

 drivers/staging/rtl8723bs/include/basic_types.h  | 15 +++++++--------
 drivers/staging/rtl8723bs/include/hal_btcoex.h   |  8 ++++----
 drivers/staging/rtl8723bs/os_dep/osdep_service.c | 11 ++++++-----
 3 files changed, 17 insertions(+), 17 deletions(-)

--
2.50.1

#1 lore raw

PATCH v2 1/3 staging: rtl8723bs: fix comment style and formatting in osdep_service.c

This patch fixes minor coding style issues reported by checkpatch:
- Corrected comment block formatting
- Removed redundant blank line
- Improved variable assignment readability

---
 drivers/staging/rtl8723bs/os_dep/osdep_service.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
drivers/staging/rtl8723bs/os_dep/osdep_service.c +6 -5
index a00f9f0c85c..60c3da009a5 100644
@@ -7,9 +7,9 @@
 #include <drv_types.h>
 
 /*
-* Translate the OS dependent @param error_code to OS independent RTW_STATUS_CODE
-* @return: one of RTW_STATUS_CODE
-*/
+ * Translate the OS dependent @param error_code to OS independent RTW_STATUS_CODE
+ * @return: one of RTW_STATUS_CODE
+ */
 inline int RTW_STATUS_CODE(int error_code)
 {
 	if (error_code >= 0)
@@ -152,7 +152,6 @@ void rtw_buf_update(u8 **buf, u32 *buf_len, u8 *src, u32 src_len)
 		kfree(ori);
 }
 
-
 /**
  * rtw_cbuf_full - test if cbuf is full
  * @cbuf: pointer of struct rtw_cbuf
@@ -204,6 +203,7 @@ bool rtw_cbuf_push(struct rtw_cbuf *cbuf, void *buf)
 void *rtw_cbuf_pop(struct rtw_cbuf *cbuf)
 {
 	void *buf;
+
 	if (rtw_cbuf_empty(cbuf))
 		return NULL;
 
@@ -226,7 +226,8 @@ struct rtw_cbuf *rtw_cbuf_alloc(u32 size)
 	cbuf = rtw_malloc(struct_size(cbuf, bufs, size));
 
 	if (cbuf) {
-		cbuf->write = cbuf->read = 0;
+		cbuf->read = 0;
+		cbuf->write = 0;
 		cbuf->size = size;
 	}
 
Signature · 1 line
2.50.1
#2 lore raw

PATCH v2 2/3 staging: rtl8723bs: fix comment formatting in basic_types.h

In reply to Ali Nasrolahi

Fix coding style issues reported by checkpatch.pl:
- Adjusted block comment trailing markers
- Unified comment spacing and indentation
- Removed redundant semicolon from macro definition

---
 drivers/staging/rtl8723bs/include/basic_types.h | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)
drivers/staging/rtl8723bs/include/basic_types.h +7 -8
index 57bb717327c..640db1e79e7 100644
@@ -26,7 +26,7 @@
  *	1. Read/write packet content.
  *	2. Before write integer to IO.
  *	3. After read integer from IO.
-*/
+ */
 
 /*  */
 /*  Byte Swapping routine. */
@@ -94,7 +94,7 @@
 #define BIT_OFFSET_LEN_MASK_8(__bitoffset, __bitlen) \
 	(BIT_LEN_MASK_8(__bitlen) << (__bitoffset))
 
-/*Description:
+/* Description:
  * Return 4-byte value in host byte ordering from
  * 4-byte pointer in little-endian system.
  */
@@ -105,11 +105,10 @@
 #define LE_P1BYTE_TO_HOST_1BYTE(__pstart) \
 	(EF1BYTE(*((u8 *)(__pstart))))
 
-/*  */
-/* 	Description: */
-/* 		Translate subfield (continuous bits in little-endian) of 4-byte value in litten byte to */
-/* 		4-byte value in host byte ordering. */
-/*  */
+/* Description:
+ *	Translate subfield (continuous bits in little-endian) of 4-byte value in litten byte to
+ *	4-byte value in host byte ordering.
+ */
 #define LE_BITS_TO_4BYTE(__pstart, __bitoffset, __bitlen) \
 	(\
 		(LE_P4BYTE_TO_HOST_4BYTE(__pstart) >> (__bitoffset))  & \
@@ -163,7 +162,7 @@
 		(					\
 		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			\
Signature · 1 line
2.50.1
#4 lore raw

PATCH v2 3/3 staging: rtl8723bs: replace unnamed parameters in hal_btcoex.h for consistency

In reply to Ali Nasrolahi

Update unnamed parameters in function declarations with explicit names to be consistent with the rest of the functions in hal_btcoex.h file.

---
 drivers/staging/rtl8723bs/include/hal_btcoex.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/staging/rtl8723bs/include/hal_btcoex.h +4 -4
index 525cce3574f..df58b11605f 100644
@@ -22,7 +22,7 @@ struct bt_coexist {
 
 void hal_btcoex_SetBTCoexist(struct adapter *padapter, u8 bBtExist);
 bool hal_btcoex_IsBtExist(struct adapter *padapter);
-bool hal_btcoex_IsBtDisabled(struct adapter *);
+bool hal_btcoex_IsBtDisabled(struct adapter *padapter);
 void hal_btcoex_SetPgAntNum(struct adapter *padapter, u8 antNum);
 void hal_btcoex_SetSingleAntPath(struct adapter *padapter, u8 singleAntPath);
 
@@ -46,9 +46,9 @@ void hal_btcoex_Handler(struct adapter *padapter);
 s32 hal_btcoex_IsBTCoexCtrlAMPDUSize(struct adapter *padapter);
 bool hal_btcoex_IsBtControlLps(struct adapter *padapter);
 bool hal_btcoex_IsLpsOn(struct adapter *padapter);
-u8 hal_btcoex_RpwmVal(struct adapter *);
-u8 hal_btcoex_LpsVal(struct adapter *);
-u32 hal_btcoex_GetRaMask(struct adapter *);
+u8 hal_btcoex_RpwmVal(struct adapter *padapter);
+u8 hal_btcoex_LpsVal(struct adapter *padapter);
+u32 hal_btcoex_GetRaMask(struct adapter *padapter);
 void hal_btcoex_RecordPwrMode(struct adapter *padapter, u8 *pCmdBuf, u8 cmdLen);
 
 #endif /*  !__HAL_BTCOEX_H__ */
Signature · 1 line
2.50.1
maintainer
#3 lore raw

Re: [PATCH v2 2/3] staging: rtl8723bs: fix comment formatting in basic_types.h

In reply to Ali Nasrolahi
Quoted 3 lines · Ali Nasrolahi

Fix coding style issues reported by checkpatch.pl:
- Adjusted block comment trailing markers
- Unified comment spacing and indentation

These two are fine, but:

Quoted 1 line

- Removed redundant semicolon from macro definition

This needs to be a separate patch.

Again, each patch needs to do only one "logical" thing. And that logical thing can not be "fix a bunch of coding style issues that are of different types", sorry.

Please fix up for this patch, and the 3/3 patch and submit an updated series.

thanks,

greg k-h