Re: [PATCH v2] staging: rtl8723bs: fix constant on left side of test checkpatch warnings

From: Andy Shevchenko

Date: Mon Mar 23 2026 - 14:09:21 EST


On Mon, Mar 23, 2026 at 09:59:01PM +0530, Prithvi Tambewagh wrote:
> In all types of comparison/test (using ==, !=, >=, <=, >, <
> operators) ensure that the constant lies to the right side of the test,
> thus fixing checkpatch warnings : comparisons should place the constant
> on the right side of the test, throughout the rtl8723bs driver.

...

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

This entire piece can be replaced with something from iopoll.h.

...

> - if (WIFI_CTRL_TYPE == GetFrameType(pframe))
> + if (GetFrameType(pframe) == WIFI_CTRL_TYPE)
> return true;
> else
> return false;

Just

return GetFrameType(pframe) == WIFI_CTRL_TYPE;

--
With Best Regards,
Andy Shevchenko