[PATCH] staging: rtl8192u: Fix assignment in if condition

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxx>
---
 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





[Index of Archives]     [Linux Driver Development]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux