[PATCH 1/2] staging: rtl8723bs: fix coding style issues in core:rtw_wlan_util.c
From: Marcos Andrade
Date: Wed Mar 25 2026 - 21:52:47 EST
The 'enable' parameter in Switch_DM_Func() is of type u8. Explicitly
comparing it to 'true' (which evaluates to 1) is error-prone. If the
function is ever called with any non-zero value other than 1, the
condition will evaluate to false, incorrectly clearing the hardware
register instead of setting it.
Evaluate the condition implicitly to ensure that any non-zero value
correctly triggers the set operation.
This change also resolves the following check reported by
checkpatch.pl.
Signed-off-by: Marcos Andrade <marcosandrade95963@xxxxxxxxx>
---
drivers/staging/rtl8723bs/core/rtw_wlan_util.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/rtl8723bs/core/rtw_wlan_util.c b/drivers/staging/rtl8723bs/core/rtw_wlan_util.c
index 3242978da36c..41868dda3838 100644
--- a/drivers/staging/rtl8723bs/core/rtw_wlan_util.c
+++ b/drivers/staging/rtl8723bs/core/rtw_wlan_util.c
@@ -236,7 +236,7 @@ void Restore_DM_Func_Flag(struct adapter *padapter)
void Switch_DM_Func(struct adapter *padapter, u32 mode, u8 enable)
{
- if (enable == true)
+ if (enable)
rtw_hal_set_hwreg(padapter, HW_VAR_DM_FUNC_SET, (u8 *)(&mode));
else
rtw_hal_set_hwreg(padapter, HW_VAR_DM_FUNC_CLR, (u8 *)(&mode));
--
2.53.0