Skip to contentSkip to conversation

Staging: r8188eu: core: Comparisons should place the constant on the right side of the test

PATCH In review Leonardo Araujo 2 participants 2 messages Feb 9, 2022 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Staging: r8188eu: core: Comparisons should place the constant on the right side of the test

This patch fixes the following checkpatch.pl warning:

WARNING: Comparisons should place the constant on the right side of the test

---
 drivers/staging/r8188eu/core/rtw_cmd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/r8188eu/core/rtw_cmd.c +1 -1
index a9a5453aa1cc..e236316188c1 100644
@@ -618,7 +618,7 @@ u8 rtw_disassoc_cmd(struct adapter *padapter, u32 deauth_timeout_ms, bool enqueu
 		res = rtw_enqueue_cmd(cmdpriv, cmdobj);
 	} else {
 		/* no need to enqueue, do the cmd hdl directly and free cmd parameter */
-		if (H2C_SUCCESS != disconnect_hdl(padapter, (u8 *)param))
+		if (disconnect_hdl(padapter, (u8 *)param) != H2C_SUCCESS)
 			res = _FAIL;
 		kfree(param);
 	}
Signature · 1 line
2.29.0
#1 lore raw

Hi Leonardo,

Quoted 14 lines · Leonardo Araujo

This patch fixes the following checkpatch.pl warning:

WARNING: Comparisons should place the constant on the right side of the test

---
  drivers/staging/r8188eu/core/rtw_cmd.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/r8188eu/core/rtw_cmd.c +0 -0
index a9a5453aa1cc..e236316188c1 100644

drivers/staging/r8188eu/core/rtw_cmd.c u8 rtw_disassoc_cmd(struct adapter *padapter, u32 deauth_timeout_ms, bool enqueu · line 621

Quoted 5 lines
drivers/staging/r8188eu/core/rtw_cmd.c +1 -1
@@ -618,7 +618,7 @@ u8 rtw_disassoc_cmd(struct adapter *padapter, u32 deauth_timeout_ms, bool enqueu
  		res = rtw_enqueue_cmd(cmdpriv, cmdobj);
  	} else {
  		/* no need to enqueue, do the cmd hdl directly and free cmd parameter */
-		if (H2C_SUCCESS != disconnect_hdl(padapter, (u8 *)param))
+		if (disconnect_hdl(padapter, (u8 *)param) != H2C_SUCCESS)

Actually disconnect_hdl() always return H2C_SUCCESS. Looks like this check can be dropped completely

Unfortunately, we can't make it return void, since it's used as part of wlancmds array :(

With regards,
Pavel Skripkin