All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/6] staging: rtl8723bs: replace while with shorter for loop
@ 2018-07-08 10:38 Michael Straube
  2018-07-08 10:38 ` [PATCH 2/6] staging: rtl8723bs: replace tab with space Michael Straube
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Michael Straube @ 2018-07-08 10:38 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel, Michael Straube

Simplify rtw_get_rateset_len() by replacing the while loop
with a shorter for loop.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
---
 drivers/staging/rtl8723bs/core/rtw_ieee80211.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
index 8e0025e1ff14..9b60e0214bd8 100644
--- a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
+++ b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
@@ -298,17 +298,11 @@ void rtw_set_supported_rate(u8 *SupportedRates, uint mode)
 
 uint	rtw_get_rateset_len(u8 *rateset)
 {
-	uint i = 0;
+	uint i;
 
-	while (1) {
-		if ((rateset[i]) == 0)
-			break;
-
-		if (i > 12)
+	for (i = 0; i < 13; i++)
+		if (rateset[i] == 0)
 			break;
-
-		i++;
-	}
 	return i;
 }
 
-- 
2.18.0


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

end of thread, other threads:[~2018-07-11 19:17 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-08 10:38 [PATCH 1/6] staging: rtl8723bs: replace while with shorter for loop Michael Straube
2018-07-08 10:38 ` [PATCH 2/6] staging: rtl8723bs: replace tab with space Michael Straube
2018-07-08 10:38 ` [PATCH 3/6] staging: rtl8723bs: fix indentation Michael Straube
2018-07-08 16:46   ` Joe Perches
2018-07-08 17:36     ` Michael Straube
2018-07-11 13:57       ` Michael Straube
2018-07-11 16:03         ` Joe Perches
2018-07-11 19:17           ` Michael Straube
2018-07-08 10:38 ` [PATCH 4/6] staging: rtl8723bs: remove blank lines Michael Straube
2018-07-08 10:38 ` [PATCH 5/6] staging: rtl8723bs: add missing " Michael Straube
2018-07-08 10:38 ` [PATCH 6/6] staging: rtl8723bs: remove braces from single if statement Michael Straube

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.