From: Elise Lennion <elise.lennion@gmail.com>
To: gregkh@linuxfoundation.org, outreachy-kernel@googlegroups.com
Subject: [PATCH] staging: rtl8192u: ieee80211: Move assignment out of the if.
Date: Wed, 19 Oct 2016 19:56:41 -0200 [thread overview]
Message-ID: <20161019215641.GA309@lennorien.com> (raw)
Assignments inside of if statements confuse the reader and should be
avoided, so it was moved out before the if.
Found with Coccinelle, semantic patch:
@@
expression e1, e2;
statement S;
position p;
@@
+ e1 = e2;
if (<+...
- (e1 = e2)
@p
+ e1
...+>)
S
Signed-off-by: Elise Lennion <elise.lennion@gmail.com>
---
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
index 89cbc07..0d81b3a 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
@@ -1145,8 +1145,8 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
/* skb: hdr + (possibly fragmented, possibly encrypted) payload */
- if (ieee->host_decrypt && (fc & IEEE80211_FCTL_WEP) &&
- (keyidx = ieee80211_rx_frame_decrypt(ieee, skb, crypt)) < 0)
+ keyidx = ieee80211_rx_frame_decrypt(ieee, skb, crypt);
+ if (ieee->host_decrypt && (fc & IEEE80211_FCTL_WEP) && keyidx < 0)
{
printk("decrypt frame error\n");
goto rx_dropped;
--
2.7.4
next reply other threads:[~2016-10-19 21:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-19 21:56 Elise Lennion [this message]
2016-10-20 9:03 ` [Outreachy kernel] [PATCH] staging: rtl8192u: ieee80211: Move assignment out of the if Julia Lawall
-- strict thread matches above, loose matches on Subject: below --
2016-10-19 22:13 Elise Lennion
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161019215641.GA309@lennorien.com \
--to=elise.lennion@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=outreachy-kernel@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.