public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: rtl8188eu: replace while with shorter for loop
@ 2018-07-07 11:22 Michael Straube
  2018-07-07 14:36 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Straube @ 2018-07-07 11:22 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. Also replace tabs with spaces in
the definition line.

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

diff --git a/drivers/staging/rtl8188eu/core/rtw_ieee80211.c b/drivers/staging/rtl8188eu/core/rtw_ieee80211.c
index e47927b9c3b8..711ebb0ad640 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;
 }
 
-- 
2.18.0


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

* Re: [PATCH] staging: rtl8188eu: replace while with shorter for loop
  2018-07-07 11:22 [PATCH] staging: rtl8188eu: replace while with shorter for loop Michael Straube
@ 2018-07-07 14:36 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2018-07-07 14:36 UTC (permalink / raw)
  To: Michael Straube; +Cc: devel, linux-kernel

On Sat, Jul 07, 2018 at 01:22:50PM +0200, Michael Straube wrote:
> 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

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

end of thread, other threads:[~2018-07-07 14:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-07 11:22 [PATCH] staging: rtl8188eu: replace while with shorter for loop Michael Straube
2018-07-07 14:36 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox