staging: rtl8723bs: remove recurring counter increment

The code:
	cnt += in_ie[cnt + 1] + 2;   /* get next */
is in both the "if" and "else" branches.

Remove this repetition, which will simplify the code and
improve readability.

Signed-off-by: Nikolay Kulikov <nikolayof23@gmail.com>
Link: https://patch.msgid.link/20260224164445.18316-1-nikolayof23@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Nikolay Kulikov 2026-02-24 19:43:19 +03:00 committed by Greg Kroah-Hartman
parent 0c038cb19a
commit 9bf1804229

View File

@ -589,10 +589,9 @@ int rtw_get_wapi_ie(u8 *in_ie, uint in_len, u8 *wapi_ie, u16 *wapi_len)
if (wapi_len)
*wapi_len = in_ie[cnt + 1] + 2;
cnt += in_ie[cnt + 1] + 2; /* get next */
} else {
cnt += in_ie[cnt + 1] + 2; /* get next */
}
cnt += in_ie[cnt + 1] + 2; /* get next */
}
if (wapi_len)
@ -620,18 +619,14 @@ void rtw_get_sec_ie(u8 *in_ie, uint in_len, u8 *rsn_ie, u16 *rsn_len, u8 *wpa_ie
memcpy(wpa_ie, &in_ie[cnt], in_ie[cnt + 1] + 2);
*wpa_len = in_ie[cnt + 1] + 2;
cnt += in_ie[cnt + 1] + 2; /* get next */
} else {
if (authmode == WLAN_EID_RSN) {
if (rsn_ie)
memcpy(rsn_ie, &in_ie[cnt], in_ie[cnt + 1] + 2);
} else if (authmode == WLAN_EID_RSN) {
if (rsn_ie)
memcpy(rsn_ie, &in_ie[cnt], in_ie[cnt + 1] + 2);
*rsn_len = in_ie[cnt + 1] + 2;
cnt += in_ie[cnt + 1] + 2; /* get next */
} else {
cnt += in_ie[cnt + 1] + 2; /* get next */
}
*rsn_len = in_ie[cnt + 1] + 2;
}
cnt += in_ie[cnt + 1] + 2; /* get next */
}
}