Commit 7a158635 authored by Kyle Kuffermann's avatar Kyle Kuffermann Committed by Greg Kroah-Hartman

rtl8188eu: Add spaces around arithmetic operators

This fixes the checkpatch.pl issue: CHECK: spaces preferred around that '+'
Signed-off-by: default avatarKyle Kuffermann <kyle.kuffermann@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 0f94b0af
...@@ -207,8 +207,8 @@ inline u8 *rtw_set_ie_mesh_ch_switch_parm(u8 *buf, u32 *buf_len, u8 ttl, ...@@ -207,8 +207,8 @@ inline u8 *rtw_set_ie_mesh_ch_switch_parm(u8 *buf, u32 *buf_len, u8 ttl,
ie_data[0] = ttl; ie_data[0] = ttl;
ie_data[1] = flags; ie_data[1] = flags;
*(u16 *)(ie_data+2) = cpu_to_le16(reason); *(u16 *)(ie_data + 2) = cpu_to_le16(reason);
*(u16 *)(ie_data+4) = cpu_to_le16(precedence); *(u16 *)(ie_data + 4) = cpu_to_le16(precedence);
return rtw_set_ie(buf, 0x118, 6, ie_data, buf_len); return rtw_set_ie(buf, 0x118, 6, ie_data, buf_len);
} }
...@@ -268,18 +268,18 @@ u8 *rtw_get_ie_ex(u8 *in_ie, uint in_len, u8 eid, u8 *oui, u8 oui_len, u8 *ie, u ...@@ -268,18 +268,18 @@ u8 *rtw_get_ie_ex(u8 *in_ie, uint in_len, u8 eid, u8 *oui, u8 oui_len, u8 *ie, u
cnt = 0; cnt = 0;
while (cnt < in_len) { while (cnt < in_len) {
if (eid == in_ie[cnt] && (!oui || !memcmp(&in_ie[cnt+2], oui, oui_len))) { if (eid == in_ie[cnt] && (!oui || !memcmp(&in_ie[cnt + 2], oui, oui_len))) {
target_ie = &in_ie[cnt]; target_ie = &in_ie[cnt];
if (ie) if (ie)
memcpy(ie, &in_ie[cnt], in_ie[cnt+1]+2); memcpy(ie, &in_ie[cnt], in_ie[cnt + 1] + 2);
if (ielen) if (ielen)
*ielen = in_ie[cnt+1]+2; *ielen = in_ie[cnt + 1] + 2;
break; break;
} else { } else {
cnt += in_ie[cnt+1]+2; /* goto next */ cnt += in_ie[cnt + 1] + 2; /* goto next */
} }
} }
return target_ie; return target_ie;
...@@ -530,8 +530,8 @@ int rtw_parse_wpa_ie(u8 *wpa_ie, int wpa_ie_len, int *group_cipher, int *pairwis ...@@ -530,8 +530,8 @@ int rtw_parse_wpa_ie(u8 *wpa_ie, int wpa_ie_len, int *group_cipher, int *pairwis
} }
if ((*wpa_ie != _WPA_IE_ID_) || (*(wpa_ie+1) != (u8)(wpa_ie_len - 2)) || if ((*wpa_ie != _WPA_IE_ID_) || (*(wpa_ie + 1) != (u8)(wpa_ie_len - 2)) ||
(memcmp(wpa_ie+2, RTW_WPA_OUI_TYPE, WPA_SELECTOR_LEN))) (memcmp(wpa_ie + 2, RTW_WPA_OUI_TYPE, WPA_SELECTOR_LEN)))
return _FAIL; return _FAIL;
pos = wpa_ie; pos = wpa_ie;
...@@ -599,7 +599,7 @@ int rtw_parse_wpa2_ie(u8 *rsn_ie, int rsn_ie_len, int *group_cipher, int *pairwi ...@@ -599,7 +599,7 @@ int rtw_parse_wpa2_ie(u8 *rsn_ie, int rsn_ie_len, int *group_cipher, int *pairwi
} }
if ((*rsn_ie != _WPA2_IE_ID_) || (*(rsn_ie+1) != (u8)(rsn_ie_len - 2))) if ((*rsn_ie != _WPA2_IE_ID_) || (*(rsn_ie + 1) != (u8)(rsn_ie_len - 2)))
return _FAIL; return _FAIL;
pos = rsn_ie; pos = rsn_ie;
...@@ -671,45 +671,45 @@ int rtw_get_sec_ie(u8 *in_ie, uint in_len, u8 *rsn_ie, u16 *rsn_len, u8 *wpa_ie, ...@@ -671,45 +671,45 @@ int rtw_get_sec_ie(u8 *in_ie, uint in_len, u8 *rsn_ie, u16 *rsn_len, u8 *wpa_ie,
while (cnt < in_len) { while (cnt < in_len) {
authmode = in_ie[cnt]; authmode = in_ie[cnt];
if ((authmode == _WPA_IE_ID_) && (!memcmp(&in_ie[cnt+2], &wpa_oui[0], 4))) { if ((authmode == _WPA_IE_ID_) && (!memcmp(&in_ie[cnt + 2], &wpa_oui[0], 4))) {
RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_,
("\n rtw_get_wpa_ie: sec_idx =%d in_ie[cnt+1]+2 =%d\n", ("\n rtw_get_wpa_ie: sec_idx =%d in_ie[cnt+1]+2 =%d\n",
sec_idx, in_ie[cnt+1]+2)); sec_idx, in_ie[cnt + 1] + 2));
if (wpa_ie) { if (wpa_ie) {
memcpy(wpa_ie, &in_ie[cnt], in_ie[cnt+1]+2); memcpy(wpa_ie, &in_ie[cnt], in_ie[cnt + 1] + 2);
for (i = 0; i < (in_ie[cnt+1]+2); i += 8) { for (i = 0; i < (in_ie[cnt + 1] + 2); i += 8) {
RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_,
("\n %2x,%2x,%2x,%2x,%2x,%2x,%2x,%2x\n", ("\n %2x,%2x,%2x,%2x,%2x,%2x,%2x,%2x\n",
wpa_ie[i], wpa_ie[i+1], wpa_ie[i+2], wpa_ie[i+3], wpa_ie[i+4], wpa_ie[i], wpa_ie[i + 1], wpa_ie[i + 2], wpa_ie[i + 3], wpa_ie[i + 4],
wpa_ie[i+5], wpa_ie[i+6], wpa_ie[i+7])); wpa_ie[i + 5], wpa_ie[i + 6], wpa_ie[i + 7]));
} }
} }
*wpa_len = in_ie[cnt+1]+2; *wpa_len = in_ie[cnt + 1] + 2;
cnt += in_ie[cnt+1]+2; /* get next */ cnt += in_ie[cnt + 1] + 2; /* get next */
} else { } else {
if (authmode == _WPA2_IE_ID_) { if (authmode == _WPA2_IE_ID_) {
RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_,
("\n get_rsn_ie: sec_idx =%d in_ie[cnt+1]+2 =%d\n", ("\n get_rsn_ie: sec_idx =%d in_ie[cnt+1]+2 =%d\n",
sec_idx, in_ie[cnt+1]+2)); sec_idx, in_ie[cnt + 1] + 2));
if (rsn_ie) { if (rsn_ie) {
memcpy(rsn_ie, &in_ie[cnt], in_ie[cnt+1]+2); memcpy(rsn_ie, &in_ie[cnt], in_ie[cnt + 1] + 2);
for (i = 0; i < (in_ie[cnt+1]+2); i += 8) { for (i = 0; i < (in_ie[cnt + 1] + 2); i += 8) {
RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_,
("\n %2x,%2x,%2x,%2x,%2x,%2x,%2x,%2x\n", ("\n %2x,%2x,%2x,%2x,%2x,%2x,%2x,%2x\n",
rsn_ie[i], rsn_ie[i+1], rsn_ie[i+2], rsn_ie[i+3], rsn_ie[i+4], rsn_ie[i], rsn_ie[i + 1], rsn_ie[i + 2], rsn_ie[i + 3], rsn_ie[i + 4],
rsn_ie[i+5], rsn_ie[i+6], rsn_ie[i+7])); rsn_ie[i + 5], rsn_ie[i + 6], rsn_ie[i + 7]));
} }
} }
*rsn_len = in_ie[cnt+1]+2; *rsn_len = in_ie[cnt + 1] + 2;
cnt += in_ie[cnt+1]+2; /* get next */ cnt += in_ie[cnt + 1] + 2; /* get next */
} else { } else {
cnt += in_ie[cnt+1]+2; /* get next */ cnt += in_ie[cnt + 1] + 2; /* get next */
} }
} }
} }
...@@ -729,7 +729,7 @@ u8 rtw_is_wps_ie(u8 *ie_ptr, uint *wps_ielen) ...@@ -729,7 +729,7 @@ u8 rtw_is_wps_ie(u8 *ie_ptr, uint *wps_ielen)
eid = ie_ptr[0]; eid = ie_ptr[0];
if ((eid == _WPA_IE_ID_) && (!memcmp(&ie_ptr[2], wps_oui, 4))) { if ((eid == _WPA_IE_ID_) && (!memcmp(&ie_ptr[2], wps_oui, 4))) {
*wps_ielen = ie_ptr[1]+2; *wps_ielen = ie_ptr[1] + 2;
match = true; match = true;
} }
return match; return match;
...@@ -761,20 +761,20 @@ u8 *rtw_get_wps_ie(u8 *in_ie, uint in_len, u8 *wps_ie, uint *wps_ielen) ...@@ -761,20 +761,20 @@ u8 *rtw_get_wps_ie(u8 *in_ie, uint in_len, u8 *wps_ie, uint *wps_ielen)
while (cnt < in_len) { while (cnt < in_len) {
eid = in_ie[cnt]; eid = in_ie[cnt];
if ((eid == _WPA_IE_ID_) && (!memcmp(&in_ie[cnt+2], wps_oui, 4))) { if ((eid == _WPA_IE_ID_) && (!memcmp(&in_ie[cnt + 2], wps_oui, 4))) {
wpsie_ptr = &in_ie[cnt]; wpsie_ptr = &in_ie[cnt];
if (wps_ie) if (wps_ie)
memcpy(wps_ie, &in_ie[cnt], in_ie[cnt+1]+2); memcpy(wps_ie, &in_ie[cnt], in_ie[cnt + 1] + 2);
if (wps_ielen) if (wps_ielen)
*wps_ielen = in_ie[cnt+1]+2; *wps_ielen = in_ie[cnt + 1] + 2;
cnt += in_ie[cnt+1]+2; cnt += in_ie[cnt + 1] + 2;
break; break;
} else { } else {
cnt += in_ie[cnt+1]+2; /* goto next */ cnt += in_ie[cnt + 1] + 2; /* goto next */
} }
} }
return wpsie_ptr; return wpsie_ptr;
...@@ -848,12 +848,12 @@ u8 *rtw_get_wps_attr_content(u8 *wps_ie, uint wps_ielen, u16 target_attr_id, u8 ...@@ -848,12 +848,12 @@ u8 *rtw_get_wps_attr_content(u8 *wps_ie, uint wps_ielen, u16 target_attr_id, u8
if (attr_ptr && attr_len) { if (attr_ptr && attr_len) {
if (buf_content) if (buf_content)
memcpy(buf_content, attr_ptr+4, attr_len-4); memcpy(buf_content, attr_ptr + 4, attr_len - 4);
if (len_content) if (len_content)
*len_content = attr_len-4; *len_content = attr_len - 4;
return attr_ptr+4; return attr_ptr + 4;
} }
return NULL; return NULL;
...@@ -1106,9 +1106,9 @@ void dump_ies(u8 *buf, u32 buf_len) ...@@ -1106,9 +1106,9 @@ void dump_ies(u8 *buf, u32 buf_len)
u8 *pos = buf; u8 *pos = buf;
u8 id, len; u8 id, len;
while (pos-buf <= buf_len) { while (pos - buf <= buf_len) {
id = *pos; id = *pos;
len = *(pos+1); len = *(pos + 1);
DBG_88E("%s ID:%u, LEN:%u\n", __func__, id, len); DBG_88E("%s ID:%u, LEN:%u\n", __func__, id, len);
dump_wps_ie(pos, len); dump_wps_ie(pos, len);
...@@ -1130,11 +1130,11 @@ void dump_wps_ie(u8 *ie, u32 ie_len) ...@@ -1130,11 +1130,11 @@ void dump_wps_ie(u8 *ie, u32 ie_len)
return; return;
pos += 6; pos += 6;
while (pos-ie < ie_len) { while (pos - ie < ie_len) {
id = get_unaligned_be16(pos); id = get_unaligned_be16(pos);
len = get_unaligned_be16(pos + 2); len = get_unaligned_be16(pos + 2);
DBG_88E("%s ID:0x%04x, LEN:%u\n", __func__, id, len); DBG_88E("%s ID:0x%04x, LEN:%u\n", __func__, id, len);
pos += (4+len); pos += (4 + len);
} }
} }
...@@ -1188,11 +1188,11 @@ static int rtw_get_cipher_info(struct wlan_network *pnetwork) ...@@ -1188,11 +1188,11 @@ static int rtw_get_cipher_info(struct wlan_network *pnetwork)
unsigned char *pbuf; unsigned char *pbuf;
int group_cipher = 0, pairwise_cipher = 0, is8021x = 0; int group_cipher = 0, pairwise_cipher = 0, is8021x = 0;
int ret = _FAIL; int ret = _FAIL;
pbuf = rtw_get_wpa_ie(&pnetwork->network.IEs[12], &wpa_ielen, pnetwork->network.IELength-12); pbuf = rtw_get_wpa_ie(&pnetwork->network.IEs[12], &wpa_ielen, pnetwork->network.IELength - 12);
if (pbuf && (wpa_ielen > 0)) { if (pbuf && (wpa_ielen > 0)) {
RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("rtw_get_cipher_info: wpa_ielen: %d", wpa_ielen)); RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("rtw_get_cipher_info: wpa_ielen: %d", wpa_ielen));
if (_SUCCESS == rtw_parse_wpa_ie(pbuf, wpa_ielen+2, &group_cipher, &pairwise_cipher, &is8021x)) { if (_SUCCESS == rtw_parse_wpa_ie(pbuf, wpa_ielen + 2, &group_cipher, &pairwise_cipher, &is8021x)) {
pnetwork->BcnInfo.pairwise_cipher = pairwise_cipher; pnetwork->BcnInfo.pairwise_cipher = pairwise_cipher;
pnetwork->BcnInfo.group_cipher = group_cipher; pnetwork->BcnInfo.group_cipher = group_cipher;
pnetwork->BcnInfo.is_8021x = is8021x; pnetwork->BcnInfo.is_8021x = is8021x;
...@@ -1201,11 +1201,11 @@ static int rtw_get_cipher_info(struct wlan_network *pnetwork) ...@@ -1201,11 +1201,11 @@ static int rtw_get_cipher_info(struct wlan_network *pnetwork)
ret = _SUCCESS; ret = _SUCCESS;
} }
} else { } else {
pbuf = rtw_get_wpa2_ie(&pnetwork->network.IEs[12], &wpa_ielen, pnetwork->network.IELength-12); pbuf = rtw_get_wpa2_ie(&pnetwork->network.IEs[12], &wpa_ielen, pnetwork->network.IELength - 12);
if (pbuf && (wpa_ielen > 0)) { if (pbuf && (wpa_ielen > 0)) {
RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("get RSN IE\n")); RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("get RSN IE\n"));
if (_SUCCESS == rtw_parse_wpa2_ie(pbuf, wpa_ielen+2, &group_cipher, &pairwise_cipher, &is8021x)) { if (_SUCCESS == rtw_parse_wpa2_ie(pbuf, wpa_ielen + 2, &group_cipher, &pairwise_cipher, &is8021x)) {
RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("get RSN IE OK!!!\n")); RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("get RSN IE OK!!!\n"));
pnetwork->BcnInfo.pairwise_cipher = pairwise_cipher; pnetwork->BcnInfo.pairwise_cipher = pairwise_cipher;
pnetwork->BcnInfo.group_cipher = group_cipher; pnetwork->BcnInfo.group_cipher = group_cipher;
...@@ -1349,8 +1349,8 @@ int rtw_action_frame_parse(const u8 *frame, u32 frame_len, u8 *category, u8 *act ...@@ -1349,8 +1349,8 @@ int rtw_action_frame_parse(const u8 *frame, u32 frame_len, u8 *category, u8 *act
fc = le16_to_cpu(((struct rtw_ieee80211_hdr_3addr *)frame)->frame_ctl); fc = le16_to_cpu(((struct rtw_ieee80211_hdr_3addr *)frame)->frame_ctl);
if ((fc & (RTW_IEEE80211_FCTL_FTYPE|RTW_IEEE80211_FCTL_STYPE)) != if ((fc & (RTW_IEEE80211_FCTL_FTYPE | RTW_IEEE80211_FCTL_STYPE)) !=
(RTW_IEEE80211_FTYPE_MGMT|RTW_IEEE80211_STYPE_ACTION)) (RTW_IEEE80211_FTYPE_MGMT | RTW_IEEE80211_STYPE_ACTION))
return false; return false;
c = frame_body[0]; c = frame_body[0];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment