Commit 59c5a7c6 authored by Mahak Gupta's avatar Mahak Gupta Committed by Greg Kroah-Hartman

staging: r8188eu: remove else after return and break statements

Else is not necessary after return and break statements, hence remove
it.

Reported by checkpatch:

WARNING: else is not generally useful after a break or return
Signed-off-by: default avatarMahak Gupta <mahak_g@cs.iitr.ac.in>
Link: https://lore.kernel.org/r/20220413052759.4859-1-mahak_g@cs.iitr.ac.inSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 143b67f1
...@@ -97,16 +97,15 @@ bool rtw_is_cckratesonly_included(u8 *rate) ...@@ -97,16 +97,15 @@ bool rtw_is_cckratesonly_included(u8 *rate)
int rtw_check_network_type(unsigned char *rate, int ratelen, int channel) int rtw_check_network_type(unsigned char *rate, int ratelen, int channel)
{ {
if (channel > 14) { if (channel > 14)
return WIRELESS_INVALID; return WIRELESS_INVALID;
} else { /* could be pure B, pure G, or B/G */ /* could be pure B, pure G, or B/G */
if (rtw_is_cckratesonly_included(rate)) if (rtw_is_cckratesonly_included(rate))
return WIRELESS_11B; return WIRELESS_11B;
else if (rtw_is_cckrates_included(rate)) else if (rtw_is_cckrates_included(rate))
return WIRELESS_11BG; return WIRELESS_11BG;
else else
return WIRELESS_11G; return WIRELESS_11G;
}
} }
u8 *rtw_set_fixed_ie(unsigned char *pbuf, unsigned int len, unsigned char *source, u8 *rtw_set_fixed_ie(unsigned char *pbuf, unsigned int len, unsigned char *source,
...@@ -160,11 +159,10 @@ u8 *rtw_get_ie(u8 *pbuf, int index, int *len, int limit) ...@@ -160,11 +159,10 @@ u8 *rtw_get_ie(u8 *pbuf, int index, int *len, int limit)
if (*p == index) { if (*p == index) {
*len = *(p + 1); *len = *(p + 1);
return p; return p;
} else { }
tmp = *(p + 1); tmp = *(p + 1);
p += (tmp + 2); p += (tmp + 2);
i += (tmp + 2); i += (tmp + 2);
}
if (i >= limit) if (i >= limit)
break; break;
} }
...@@ -295,10 +293,9 @@ unsigned char *rtw_get_wpa_ie(unsigned char *pie, int *wpa_ie_len, int limit) ...@@ -295,10 +293,9 @@ unsigned char *rtw_get_wpa_ie(unsigned char *pie, int *wpa_ie_len, int limit)
goto check_next_ie; goto check_next_ie;
*wpa_ie_len = *(pbuf + 1); *wpa_ie_len = *(pbuf + 1);
return pbuf; return pbuf;
} else { }
*wpa_ie_len = 0; *wpa_ie_len = 0;
return NULL; return NULL;
}
check_next_ie: check_next_ie:
limit_new = limit - (pbuf - pie) - 2 - len; limit_new = limit - (pbuf - pie) - 2 - len;
...@@ -558,9 +555,8 @@ u8 *rtw_get_wps_ie(u8 *in_ie, uint in_len, u8 *wps_ie, uint *wps_ielen) ...@@ -558,9 +555,8 @@ u8 *rtw_get_wps_ie(u8 *in_ie, uint in_len, u8 *wps_ie, uint *wps_ielen)
cnt += in_ie[cnt + 1] + 2; cnt += in_ie[cnt + 1] + 2;
break; break;
} else {
cnt += in_ie[cnt + 1] + 2; /* goto next */
} }
cnt += in_ie[cnt + 1] + 2; /* goto next */
} }
return wpsie_ptr; return wpsie_ptr;
} }
...@@ -604,9 +600,8 @@ u8 *rtw_get_wps_attr(u8 *wps_ie, uint wps_ielen, u16 target_attr_id, u8 *buf_att ...@@ -604,9 +600,8 @@ u8 *rtw_get_wps_attr(u8 *wps_ie, uint wps_ielen, u16 target_attr_id, u8 *buf_att
if (len_attr) if (len_attr)
*len_attr = attr_len; *len_attr = attr_len;
break; break;
} else {
attr_ptr += attr_len; /* goto next */
} }
attr_ptr += attr_len; /* goto next */
} }
return target_attr_ptr; return target_attr_ptr;
} }
...@@ -901,9 +896,8 @@ u8 *rtw_get_p2p_ie(u8 *in_ie, int in_len, u8 *p2p_ie, uint *p2p_ielen) ...@@ -901,9 +896,8 @@ u8 *rtw_get_p2p_ie(u8 *in_ie, int in_len, u8 *p2p_ie, uint *p2p_ielen)
if (p2p_ielen) if (p2p_ielen)
*p2p_ielen = in_ie[cnt + 1] + 2; *p2p_ielen = in_ie[cnt + 1] + 2;
return p2p_ie_ptr; return p2p_ie_ptr;
} else {
cnt += in_ie[cnt + 1] + 2; /* goto next */
} }
cnt += in_ie[cnt + 1] + 2; /* goto next */
} }
return NULL; return NULL;
} }
...@@ -948,9 +942,8 @@ u8 *rtw_get_p2p_attr(u8 *p2p_ie, uint p2p_ielen, u8 target_attr_id, u8 *buf_attr ...@@ -948,9 +942,8 @@ u8 *rtw_get_p2p_attr(u8 *p2p_ie, uint p2p_ielen, u8 target_attr_id, u8 *buf_attr
if (len_attr) if (len_attr)
*len_attr = attr_len; *len_attr = attr_len;
break; break;
} else {
attr_ptr += attr_len; /* goto next */
} }
attr_ptr += attr_len; /* goto next */
} }
return target_attr_ptr; return target_attr_ptr;
} }
......
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