[PATCH] staging: rtl8723bs: Fix multiple checkpatch warnings in rtl8723b_cmd.c

From: Ignacio Peña
Date: Wed Jul 16 2025 - 00:12:51 EST


Fix the following checkpatch warnings:
- Comparisons should place the constant on the right side
- Braces {} are not necessary for single statement blocks
- Block comments should align the * on each line
- No space before tabs

These are coding style fixes that improve code readability.

Signed-off-by: Ignacio Peña <ignacio.pena87@xxxxxxxxx>
---
drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c | 40 ++++++++++----------
1 file changed, 19 insertions(+), 21 deletions(-)

diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c b/drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c
index 56526056d..4f33f4f0c 100644
--- a/drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c
+++ b/drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c
@@ -24,9 +24,8 @@ static u8 _is_fw_read_cmd_down(struct adapter *padapter, u8 msgbox_num)

do {
valid = rtw_read8(padapter, REG_HMETFR) & BIT(msgbox_num);
- if (0 == valid) {
+ if (valid == 0)
read_down = true;
- }
} while ((!read_down) && (retry_cnts--));

return read_down;
@@ -35,13 +34,13 @@ static u8 _is_fw_read_cmd_down(struct adapter *padapter, u8 msgbox_num)


/*****************************************
-* H2C Msg format :
-*| 31 - 8 |7-5 | 4 - 0 |
-*| h2c_msg |Class |CMD_ID |
-*| 31-0 |
-*| Ext msg |
-*
-******************************************/
+ * H2C Msg format :
+ * | 31 - 8 |7-5 | 4 - 0 |
+ * | h2c_msg |Class |CMD_ID |
+ * | 31-0 |
+ * | Ext msg |
+ *
+ ******************************************/
s32 FillH2CCmd8723B(struct adapter *padapter, u8 ElementID, u32 CmdLen, u8 *pCmdBuffer)
{
u8 h2c_box_num;
@@ -57,13 +56,11 @@ s32 FillH2CCmd8723B(struct adapter *padapter, u8 ElementID, u32 CmdLen, u8 *pCmd
if (mutex_lock_interruptible(&(adapter_to_dvobj(padapter)->h2c_fwcmd_mutex)))
return ret;

- if (!pCmdBuffer) {
+ if (!pCmdBuffer)
goto exit;
- }

- if (CmdLen > RTL8723B_MAX_CMD_LEN) {
+ if (CmdLen > RTL8723B_MAX_CMD_LEN)
goto exit;
- }

if (padapter->bSurpriseRemoved)
goto exit;
@@ -80,7 +77,7 @@ s32 FillH2CCmd8723B(struct adapter *padapter, u8 ElementID, u32 CmdLen, u8 *pCmd
else {
memcpy((u8 *)(&h2c_cmd)+1, pCmdBuffer, 3);
memcpy((u8 *)(&h2c_cmd_ex), pCmdBuffer+3, CmdLen-3);
-/* *(u8 *)(&h2c_cmd) |= BIT(7); */
+/* *(u8 *)(&h2c_cmd) |= BIT(7); */
}

*(u8 *)(&h2c_cmd) |= ElementID;
@@ -438,13 +435,14 @@ void rtl8723b_set_FwPwrMode_cmd(struct adapter *padapter, u8 psmode)

}

-/* offload to FW if fw version > v15.10
- pmlmeext->DrvBcnEarly = 0;
- pmlmeext->DrvBcnTimeOut =7;
-
- if ((pmlmeext->DrvBcnEarly!= 0Xff) && (pmlmeext->DrvBcnTimeOut!= 0xff))
- u1H2CPwrModeParm[H2C_PWRMODE_LEN-1] = BIT(0) | ((pmlmeext->DrvBcnEarly<<1)&0x0E) |((pmlmeext->DrvBcnTimeOut<<4)&0xf0) ;
-*/
+/*
+ * offload to FW if fw version > v15.10
+ * pmlmeext->DrvBcnEarly = 0;
+ * pmlmeext->DrvBcnTimeOut =7;
+ *
+ * if ((pmlmeext->DrvBcnEarly!= 0Xff) && (pmlmeext->DrvBcnTimeOut!= 0xff))
+ * u1H2CPwrModeParm[H2C_PWRMODE_LEN-1] = BIT(0) | ((pmlmeext->DrvBcnEarly<<1)&0x0E) |((pmlmeext->DrvBcnTimeOut<<4)&0xf0) ;
+ */

}

--
2.39.5 (Apple Git-154)