aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging
diff options
context:
space:
mode:
authorIvan Safonov <insafonov@gmail.com>2015-10-27 22:23:57 +0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-10-29 09:09:08 +0900
commit628bd1c057157a67f40a5acb6dd58278ade018bf (patch)
treec82d065b140b5444dc51f2de818336dfaaffb0f9 /drivers/staging
parentstaging: rtl8188eu: unused MIN macro removed (diff)
downloadlinux-dev-628bd1c057157a67f40a5acb6dd58278ade018bf.tar.xz
linux-dev-628bd1c057157a67f40a5acb6dd58278ade018bf.zip
staging: rtl8188eu: while loop replaced by for loop in rtw_restruct_wmm_ie
This patch replaces while loop with for loop, because the initial condition and the increment clearly and briefly defined for this loop. Signed-off-by: Ivan Safonov <insafonov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/rtl8188eu/core/rtw_mlme.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme.c b/drivers/staging/rtl8188eu/core/rtw_mlme.c
index 2b917a18e228..c1b82f71b682 100644
--- a/drivers/staging/rtl8188eu/core/rtw_mlme.c
+++ b/drivers/staging/rtl8188eu/core/rtw_mlme.c
@@ -1709,8 +1709,8 @@ int rtw_restruct_wmm_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie, uint in_
unsigned int ielength = 0;
unsigned int i, j;
- i = 12; /* after the fixed IE */
- while (i < in_len) {
+ /* i = 12; after the fixed IE */
+ for (i = 12; i < in_len; i += (in_ie[i + 1] + 2) /* to the next IE element */) {
ielength = initial_out_len;
if (in_ie[i] == 0xDD && in_ie[i+2] == 0x00 && in_ie[i+3] == 0x50 && in_ie[i+4] == 0xF2 && in_ie[i+5] == 0x02 && i+5 < in_len) {
@@ -1726,7 +1726,6 @@ int rtw_restruct_wmm_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie, uint in_
out_ie[initial_out_len + 8] = 0x00;
break;
}
- i += (in_ie[i+1]+2); /* to the next IE element */
}
return ielength;
}