[PATCH] staging: rtl8723bs: fix YODA condition warnings

Mariyam Shahid posted 1 patch 1 month, 2 weeks ago
drivers/staging/rtl8723bs/core/rtw_security.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
[PATCH] staging: rtl8723bs: fix YODA condition warnings
Posted by Mariyam Shahid 1 month, 2 weeks ago
Place the constants on right side of the comparison in rtw_security.c
to follow kernel coding style. This resolves a checkpatch warning.

Signed-off-by: Mariyam Shahid <mariyam.shahid135@gmail.com>
---
 drivers/staging/rtl8723bs/core/rtw_security.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_security.c b/drivers/staging/rtl8723bs/core/rtw_security.c
index 8ee5bed252bf..601178dafcc7 100644
--- a/drivers/staging/rtl8723bs/core/rtw_security.c
+++ b/drivers/staging/rtl8723bs/core/rtw_security.c
@@ -1488,7 +1488,8 @@ void rtw_sec_restore_wep_key(struct adapter *adapter)
 	struct security_priv *securitypriv = &(adapter->securitypriv);
 	signed int keyid;
 
-	if ((_WEP40_ == securitypriv->dot11PrivacyAlgrthm) || (_WEP104_ == securitypriv->dot11PrivacyAlgrthm)) {
+	if ((securitypriv->dot11PrivacyAlgrthm == _WEP40_) ||
+	    (securitypriv->dot11PrivacyAlgrthm == _WEP104_)) {
 		for (keyid = 0; keyid < 4; keyid++) {
 			if (securitypriv->key_mask & BIT(keyid)) {
 				if (keyid == securitypriv->dot11PrivacyKeyIndex)
-- 
2.43.0
Re: [PATCH] staging: rtl8723bs: fix YODA condition warnings
Posted by Dan Carpenter 1 month, 2 weeks ago
On Wed, Feb 11, 2026 at 06:57:31PM +0500, Mariyam Shahid wrote:
> Place the constants on right side of the comparison in rtw_security.c
> to follow kernel coding style. This resolves a checkpatch warning.
> 
> Signed-off-by: Mariyam Shahid <mariyam.shahid135@gmail.com>
> ---

Someone already did this.  You need to work against the latest tree.

regards,
dan carpenter
Re: [PATCH] staging: rtl8723bs: fix YODA condition warnings
Posted by Mariyam Shahid 1 month, 2 weeks ago
On Wed, Feb 11, 2026 at 8:09 PM Dan Carpenter <dan.carpenter@linaro.org> wrote:
>
> On Wed, Feb 11, 2026 at 06:57:31PM +0500, Mariyam Shahid wrote:
> > Place the constants on right side of the comparison in rtw_security.c
> > to follow kernel coding style. This resolves a checkpatch warning.
> >
> > Signed-off-by: Mariyam Shahid <mariyam.shahid135@gmail.com>
> > ---
>
> Someone already did this.  You need to work against the latest tree.
>
> regards,
> dan carpenter
>

Thank you for letting me know!