linux-staging.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging: rtl8192u: Fix assignment in if condition
@ 2023-07-04 12:15 wangjinchao
  2023-07-04 12:31 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 2+ messages in thread
From: wangjinchao @ 2023-07-04 12:15 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-staging@lists.linux.dev,
	linux-kernel@vger.kernel.org, outreachy@lists.linux.dev
  Cc: xulei

I just participated in Outreachy of KernelNewbies and fixed one 
'ERROR: do not use assignment in if condition' issue reported by 
checkpatch.pl on drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c.

Signed-off-by: Wang Jinchao <wangjinchao@xfusion.com>
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
index ca09367005e1..52ff9e62ec08 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
@@ -1121,8 +1121,9 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
 
 	/* skb: hdr + (possibly fragmented, possibly encrypted) payload */
 
+	keyidx = ieee80211_rx_frame_decrypt(ieee, skb, crypt);
 	if (ieee->host_decrypt && (fc & IEEE80211_FCTL_WEP) &&
-	    (keyidx = ieee80211_rx_frame_decrypt(ieee, skb, crypt)) < 0) {
+	    keyidx < 0) {
 		netdev_dbg(ieee->dev, "decrypt frame error\n");
 		goto rx_dropped;
 	}
-- 
2.40.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-07-04 12:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-04 12:15 [PATCH] staging: rtl8192u: Fix assignment in if condition wangjinchao
2023-07-04 12:31 ` Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).