Skip to contentSkip to conversation

staging: rtl8723bs: place constant on right side of equality operator

PATCH In review Prithvi Tambewagh 2 participants 5 messages Mar 21 – Mar 23 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: rtl8723bs: place constant on right side of equality operator

Place constant 0xFF on right side of equality operator when checking value of hw_channel_plan to fix checkpatch.pl warning and conform with the Linux Kernel coding style.

---
 drivers/staging/rtl8723bs/hal/hal_com.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8723bs/hal/hal_com.c +1 -1
index 31b3e880ae6a..597ba3d283c1 100644
@@ -107,7 +107,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) {

base-commit: 42bddab0563fe67882b2722620a66dd98c8dbf33

Signature · 1 line
2.34.1
#1 lore raw
Quoted 3 lines · Prithvi Tambewagh

Place constant 0xFF on right side of equality operator when checking value of hw_channel_plan to fix checkpatch.pl warning and conform with the Linux Kernel coding style.

First of all, in the very same function there are more of a such. And hence the Q: have you checked the entire driver? Please do.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
author
#2 lore raw
Quoted 13 lines · Andy Shevchenko
Quoted 3 lines · Prithvi Tambewagh

Place constant 0xFF on right side of equality operator when checking value of hw_channel_plan to fix checkpatch.pl warning and conform with the Linux Kernel coding style.

First of all, in the very same function there are more of a such. And hence the Q: have you checked the entire driver? Please do.

Signature · 2 lines
With Best Regards,
Andy Shevchenko

Hello Andy,

Thanks for the correction...While checking out other places requiring similar change, I observed the other place in the function where constant is on left side of equality operator:

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

Here, the formatting of if statement can be improved and we can also replace

	(false == pHalData->bDisableSWChannelPlan) with :

	!pHalData->bDisableSWChannelPlan

Would it be alright to add these changes to v2 of this patch itself since they are related to the code having constant on left side of == operator?

Thanks,
Prithvi

#3 lore raw
Quoted 19 lines · Prithvi
Quoted 7 lines · Andy Shevchenko
Quoted 3 lines · Prithvi Tambewagh

Place constant 0xFF on right side of equality operator when checking value of hw_channel_plan to fix checkpatch.pl warning and conform with the Linux Kernel coding style.

First of all, in the very same function there are more of a such. And hence the Q: have you checked the entire driver? Please do.

Thanks for the correction...While checking out other places requiring similar change, I observed the other place in the function where constant is on left side of equality operator:

	if (
		(false == pHalData->bDisableSWChannelPlan) &&
		rtw_is_channel_plan_valid(sw_channel_plan)
	)
		chnlPlan = sw_channel_plan;
Quoted 7 lines

Here, the formatting of if statement can be improved and we can also replace

	(false == pHalData->bDisableSWChannelPlan) with :

	!pHalData->bDisableSWChannelPlan

Would it be alright to add these changes to v2 of this patch itself since they are related to the code having constant on left side of == operator?

Yes, but I also meant to go through more files in this driver for the same style issue.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
author
#4 lore raw
Quoted 23 lines · Andy Shevchenko
Quoted 22 lines · Prithvi
Quoted 7 lines · Andy Shevchenko
Quoted 3 lines · Prithvi Tambewagh

Place constant 0xFF on right side of equality operator when checking value of hw_channel_plan to fix checkpatch.pl warning and conform with the Linux Kernel coding style.

First of all, in the very same function there are more of a such. And hence the Q: have you checked the entire driver? Please do.

Thanks for the correction...While checking out other places requiring similar change, I observed the other place in the function where constant is on left side of equality operator:

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

Here, the formatting of if statement can be improved and we can also replace

	(false == pHalData->bDisableSWChannelPlan) with :
Quoted 13 lines
Quoted 4 lines
	!pHalData->bDisableSWChannelPlan

Would it be alright to add these changes to v2 of this patch itself since they are related to the code having constant on left side of == operator?

Yes, but I also meant to go through more files in this driver for the same style issue.

Signature · 2 lines
With Best Regards,
Andy Shevchenko

Sure...sorry didn't get it earlier. I will check for checkpatch warnings related to constant being on left side of test in the driver and send a v2 patch.

Best Regards,
Prithvi