All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Staging: rtl8188eu: Refactor loop to increase compactness
@ 2015-02-27 18:07 Vatika Harlalka
  2015-02-27 18:14 ` [Outreachy kernel] " Julia Lawall
  0 siblings, 1 reply; 4+ messages in thread
From: Vatika Harlalka @ 2015-02-27 18:07 UTC (permalink / raw)
  To: outreachy-kernel

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



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

end of thread, other threads:[~2015-02-27 18:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-27 18:07 [PATCH] Staging: rtl8188eu: Refactor loop to increase compactness Vatika Harlalka
2015-02-27 18:14 ` [Outreachy kernel] " Julia Lawall
2015-02-27 18:23   ` Vatika Harlalka
2015-02-27 18:27     ` Julia Lawall

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.