public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] staging: rtl8188eu: simplify loop in rtl88eu_phy_iq_calibrate()
@ 2018-12-07 20:55 Michael Straube
  2018-12-07 20:55 ` [PATCH 2/2] staging: rtl8188eu: reuse Hal_GetChnlGroup88E() Michael Straube
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Straube @ 2018-12-07 20:55 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel, Michael Straube

Zeroing the array result[m][n] and setting only the values at
even 'n's simplifies the code and slightly reduces object file
size.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
---
 drivers/staging/rtl8188eu/hal/phy.c | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/rtl8188eu/hal/phy.c b/drivers/staging/rtl8188eu/hal/phy.c
index 482d48e003b7..051cfbab78b1 100644
--- a/drivers/staging/rtl8188eu/hal/phy.c
+++ b/drivers/staging/rtl8188eu/hal/phy.c
@@ -1225,15 +1225,10 @@ void rtl88eu_phy_iq_calibrate(struct adapter *adapt, bool recovery)
 		return;
 	}
 
-	for (i = 0; i < 8; i++) {
-		result[0][i] = 0;
-		result[1][i] = 0;
-		result[2][i] = 0;
-		if ((i == 0) || (i == 2) || (i == 4)  || (i == 6))
-			result[3][i] = 0x100;
-		else
-			result[3][i] = 0;
-	}
+	memset(result, 0, sizeof(result));
+	for (i = 0; i < 8; i += 2)
+		result[3][i] = 0x100;
+
 	final = 0xff;
 	pathaok = false;
 	pathbok = false;
-- 
2.19.2


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

end of thread, other threads:[~2018-12-07 20:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-07 20:55 [PATCH 1/2] staging: rtl8188eu: simplify loop in rtl88eu_phy_iq_calibrate() Michael Straube
2018-12-07 20:55 ` [PATCH 2/2] staging: rtl8188eu: reuse Hal_GetChnlGroup88E() Michael Straube

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox