From: Michael Straube Date: Sat, 7 Jul 2018 11:22:50 +0000 (+0200) Subject: staging: rtl8188eu: replace while with shorter for loop X-Git-Tag: v5.15~8191^2~586 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e17f46c6715448dace0e6300ac48f9052a3ca613;p=platform%2Fkernel%2Flinux-starfive.git 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. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/rtl8188eu/core/rtw_ieee80211.c b/drivers/staging/rtl8188eu/core/rtw_ieee80211.c index e47927b..711ebb0 100644 --- a/drivers/staging/rtl8188eu/core/rtw_ieee80211.c +++ b/drivers/staging/rtl8188eu/core/rtw_ieee80211.c @@ -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; }