summaryrefslogtreecommitdiff
path: root/drivers/staging/rtl8723bs
diff options
context:
space:
mode:
authorMichael Straube <straube.linux@gmail.com>2018-07-12 13:36:07 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-07-13 12:41:52 +0300
commitc53578cd0ba8251304560c818c558b32a23217aa (patch)
treec1a3fd2a81218cffe76ca341f76601ab62ff4f6b /drivers/staging/rtl8723bs
parent5e53b6c871520376edad8bcfc423c2181f13e169 (diff)
downloadlinux-c53578cd0ba8251304560c818c558b32a23217aa.tar.xz
staging: rtl8723bs: refactor rtw_is_cckrates_included()
Refactor rtw_is_cckrates_included() to improve readability and slightly reduce object file size. Suggested-by: Joe Perches <joe@perches.com> Signed-off-by: Michael Straube <straube.linux@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8723bs')
-rw-r--r--drivers/staging/rtl8723bs/core/rtw_ieee80211.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
index 3f1c7bb0eb9f..3adb58759d5f 100644
--- a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
+++ b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
@@ -68,13 +68,12 @@ int rtw_get_bit_value_from_ieee_value(u8 val)
uint rtw_is_cckrates_included(u8 *rate)
{
- u32 i = 0;
+ while (*rate) {
+ u8 r = *rate & 0x7f;
- while (rate[i] != 0) {
- if ((((rate[i]) & 0x7f) == 2) || (((rate[i]) & 0x7f) == 4) ||
- (((rate[i]) & 0x7f) == 11) || (((rate[i]) & 0x7f) == 22))
+ if (r == 2 || r == 4 || r == 11 || r == 22)
return true;
- i++;
+ rate++;
}
return false;