]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
staging: rtl8188eu: replace while with shorter for loop
authorMichael Straube <straube.linux@gmail.com>
Sat, 7 Jul 2018 11:22:50 +0000 (13:22 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 7 Jul 2018 14:48:24 +0000 (16:48 +0200)
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 <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8188eu/core/rtw_ieee80211.c

index e47927b9c3b84c0d1f22c059e1fb8417cfce6ca4..711ebb0ad6406403f92244baeccf5487535a3326 100644 (file)
@@ -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;
                        break;
-               i++;
-       }
        return i;
 }
 
        return i;
 }