Skip to contentSkip to conversation

staging: rtl8188eu: replace while with shorter for loop

PATCH In review Michael Straube 2 participants 2 messages Jul 7, 2018 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: rtl8188eu: replace while with shorter for loop

Simplify rtw_get_rateset_len() by replacing the while loop with a shorter for loop. Also replace tabs with spaces in the definition line.

---
 drivers/staging/rtl8188eu/core/rtw_ieee80211.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)
drivers/staging/rtl8188eu/core/rtw_ieee80211.c +4 -8
index e47927b9c3b8..711ebb0ad640 100644
@@ -200,17 +200,13 @@ void rtw_set_supported_rate(u8 *SupportedRates, uint mode)
 	}
 }
 
-uint	rtw_get_rateset_len(u8	*rateset)
+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;
 }
 
Signature · 1 line
2.18.0
maintainer
#1 lore raw
Quoted 3 lines · Michael Straube

Simplify rtw_get_rateset_len() by replacing the while loop with a shorter for loop. Also replace tabs with spaces in the definition line.

Normally I will insist that this be two separate patches, as you are doing two different things. But it's a nice summer day out, I don't like to argue...

greg k-h