From: Vatika Harlalka <vatikaharlalka@gmail.com>
To: outreachy-kernel@googlegroups.com
Subject: [PATCH] Staging: rtl8188eu: Refactor loop to increase compactness
Date: Fri, 27 Feb 2015 23:37:28 +0530 [thread overview]
Message-ID: <20150227180728.GA22813@gmail.com> (raw)
The variables tmp1 and tmp2 are assigned the same values
in the nested else and the outer else. They can be
assigned without nesting to increase readability.
Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
---
drivers/staging/rtl8188eu/hal/phy.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/drivers/staging/rtl8188eu/hal/phy.c b/drivers/staging/rtl8188eu/hal/phy.c
index 3d0e447..05379be 100644
--- a/drivers/staging/rtl8188eu/hal/phy.c
+++ b/drivers/staging/rtl8188eu/hal/phy.c
@@ -1039,18 +1039,12 @@ static bool simularity_compare(struct adapter *adapt, s32 resulta[][8],
for (i = 0; i < bound; i++) {
if (i%2 == 1) {
+ tmp1 = resulta[c1][i];
+ tmp2 = resulta[c2][i];
if ((resulta[c1][i] & 0x00000200) != 0)
tmp1 = resulta[c1][i] | 0xFFFFFC00;
- else
- tmp1 = resulta[c1][i];
-
if ((resulta[c2][i] & 0x00000200) != 0)
tmp2 = resulta[c2][i] | 0xFFFFFC00;
- else
- tmp2 = resulta[c2][i];
- } else {
- tmp1 = resulta[c1][i];
- tmp2 = resulta[c2][i];
}
diff = (tmp1 > tmp2) ? (tmp1 - tmp2) : (tmp2 - tmp1);
--
1.9.1
next reply other threads:[~2015-02-27 18:07 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-27 18:07 Vatika Harlalka [this message]
2015-02-27 18:14 ` [Outreachy kernel] [PATCH] Staging: rtl8188eu: Refactor loop to increase compactness Julia Lawall
2015-02-27 18:23 ` Vatika Harlalka
2015-02-27 18:27 ` Julia Lawall
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=20150227180728.GA22813@gmail.com \
--to=vatikaharlalka@gmail.com \
--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.