lkml.org 
[lkml]   [2018]   [Jul]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/6] staging: rtl8723bs: replace while with shorter for loop
Date
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
\
 
 \ /
  Last update: 2018-07-08 12:40    [W:0.039 / U:4.652 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site