Re: [PATCH v2 4/6] staging: r8188eu: place constants on the right side of tests

From: Fabio M. De Francesco
Date: Fri Apr 15 2022 - 01:07:17 EST


On venerdì 15 aprile 2022 04:48:35 CEST Jaehee Park wrote:
> To comply with the linux coding style, place constants on the right
> side of the test in comparisons. Issue found with checkpatch.
> WARNING: Comparisons should place the constant on the right side of
> the test.
>
> Signed-off-by: Jaehee Park <jhpark1013@xxxxxxxxx>
> ---
> drivers/staging/r8188eu/core/rtw_mlme.c | 13 +++++++------
> 1 file changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/staging/r8188eu/core/rtw_mlme.c b/drivers/staging/
r8188eu/core/rtw_mlme.c
> index bb9d595a90b9..d57f2ffa069e 100644
> --- a/drivers/staging/r8188eu/core/rtw_mlme.c
> +++ b/drivers/staging/r8188eu/core/rtw_mlme.c
> @@ -715,7 +715,7 @@ void rtw_surveydone_event_callback(struct adapter
*adapter, u8 *pbuf)
> set_fwstate(pmlmepriv, _FW_UNDER_LINKING);
> pmlmepriv->to_join = false;
> s_ret =
rtw_select_and_join_from_scanned_queue(pmlmepriv);
> - if (_SUCCESS == s_ret) {
> + if (s_ret == _SUCCESS) {
> _set_timer(&pmlmepriv->assoc_timer,
MAX_JOIN_TIMEOUT);
> } else if (s_ret == 2) { /* there is no need
to wait for join */
> _clr_fwstate_(pmlmepriv,
_FW_UNDER_LINKING);

As Pavel pointed out, "s_ret" can not ever be equal to '2'; this could have
been an opportunity to remove a couple of lines of dead code and add one
more patch to your series.

Thanks,

Fabio