[PATCH 6/9] staging: rtl8723bs: fix Yoda conditions and == false comparisons

Marc Finkelbaum
2026-04-14T09:59:01Z

Replace reversed comparisons with natural-order equivalents:
- '0xFF == hw_channel_plan' -> 'hw_channel_plan == 0xFF'
- 'false == pHalData->bDisableSWChannelPlan' -> '!pHalData->...'
- 'is_supported_24g(...) == false' -> '!is_supported_24g(...)'

The multi-line if condition around bDisableSWChannelPlan is also
reformatted to standard kernel one-line style.

No functional change.

Signed-off-by: Marc Finkelbaum <regpacy@gmail.com>
---
drivers/staging/rtl8723bs/hal/hal_com.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8723bs/hal/hal_com.c b/drivers/staging/rtl8723bs/hal/hal_com.c
index fcfcdfd079da..dc5e6a58fd9d 100644
--- a/drivers/staging/rtl8723bs/hal/hal_com.c
+++ b/drivers/staging/rtl8723bs/hal/hal_com.c
@@ -105,7 +105,7 @@ u8 hal_com_config_channel_plan(
pHalData->bDisableSWChannelPlan = false;
chnlPlan = def_channel_plan;

- if (0xFF == hw_channel_plan)
+ if (hw_channel_plan == 0xFF)
AutoLoadFail = true;

if (!AutoLoadFail) {
@@ -120,10 +120,8 @@ u8 hal_com_config_channel_plan(
}
}

- if (
- (false == pHalData->bDisableSWChannelPlan) &&
- rtw_is_channel_plan_valid(sw_channel_plan)
- )
+ if ((!pHalData->bDisableSWChannelPlan) &&
+ rtw_is_channel_plan_valid(sw_channel_plan))
chnlPlan = sw_channel_plan;

return chnlPlan;
@@ -134,7 +132,7 @@ bool HAL_IsLegalChannel(struct adapter *adapter, u32 Channel)
bool bLegalChannel = true;

if ((Channel <= 14) && (Channel >= 1)) {
- if (is_supported_24g(adapter->registrypriv.wireless_mode) == false)
+ if (!is_supported_24g(adapter->registrypriv.wireless_mode))
bLegalChannel = false;
} else {
bLegalChannel = false;
--
2.53.0