Re: [PATCH 6/9] staging: rtl8723bs: fix Yoda conditions and == false comparisons
From: Luka Gejak
Date: Tue Apr 14 2026 - 14:32:44 EST
On Tue Apr 14, 2026 at 2:21 PM CEST, Andy Shevchenko wrote:
> On Tue, Apr 14, 2026 at 12:58:30PM +0300, Marc Finkelbaum wrote:
>> 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.
>
> ...
>
>> - if (
>> - (false == pHalData->bDisableSWChannelPlan) &&
>> - rtw_is_channel_plan_valid(sw_channel_plan)
>> - )
>> + if ((!pHalData->bDisableSWChannelPlan) &&
>
> Too many parentheses.
Also does too many things at once(reversing yoda style, simplifying
boolean expresions) therefore should be splited to 2 patches addressing
2 different types of cleanups.
Best regards,
Luka Gejak
>
>> + rtw_is_channel_plan_valid(sw_channel_plan))
>> chnlPlan = sw_channel_plan;