From: Michael Straube <straube.linux@gmail.com>
To: gregkh@linuxfoundation.org
Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
Michael Straube <straube.linux@gmail.com>
Subject: [PATCH 1/6] staging: rtl8723bs: replace while with shorter for loop
Date: Sun, 8 Jul 2018 12:38:50 +0200 [thread overview]
Message-ID: <20180708103855.12473-1-straube.linux@gmail.com> (raw)
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
next reply other threads:[~2018-07-08 10:39 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-08 10:38 Michael Straube [this message]
2018-07-08 10:38 ` [PATCH 2/6] staging: rtl8723bs: replace tab with space Michael Straube
2018-07-08 10:38 ` [PATCH 3/6] staging: rtl8723bs: fix indentation Michael Straube
2018-07-08 16:46 ` Joe Perches
2018-07-08 17:36 ` Michael Straube
2018-07-11 13:57 ` Michael Straube
2018-07-11 16:03 ` Joe Perches
2018-07-11 19:17 ` Michael Straube
2018-07-08 10:38 ` [PATCH 4/6] staging: rtl8723bs: remove blank lines Michael Straube
2018-07-08 10:38 ` [PATCH 5/6] staging: rtl8723bs: add missing " Michael Straube
2018-07-08 10:38 ` [PATCH 6/6] staging: rtl8723bs: remove braces from single if statement Michael Straube
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180708103855.12473-1-straube.linux@gmail.com \
--to=straube.linux@gmail.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.