diff options
author | Phillip Potter <phil@philpotter.co.uk> | 2022-02-16 04:07:06 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-02-17 18:00:36 +0300 |
commit | fee26e2257c58b390b813f668a3982049e8d19ff (patch) | |
tree | d7f6cc14b3875ef19c499afe56fdaf6009d8500e /drivers/staging/r8188eu/core/rtw_ieee80211.c | |
parent | db381acc41b43e03cbb2beb2abc89ba665d86a44 (diff) | |
download | linux-fee26e2257c58b390b813f668a3982049e8d19ff.tar.xz |
staging: r8188eu: fix lines modified by DBG_88E cleanup
A number of style problems were left behind by the DBG_88E cleanup:
(1) Empty if/else blocks.
(2) Parenthesised if/while statements containing only one line.
(3) Entire blocks which server zero purpose after removal of DBG_88E.
(4) Various warnings about whitespace, and constant comparison order.
(5) Use of __constant_htons instead when htons should be used.
Fix up these issues across the driver in any file touched by the
previous cleanup. Long line warnings will be addresses in a later
patch.
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20220216010709.791-13-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/r8188eu/core/rtw_ieee80211.c')
-rw-r--r-- | drivers/staging/r8188eu/core/rtw_ieee80211.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/drivers/staging/r8188eu/core/rtw_ieee80211.c b/drivers/staging/r8188eu/core/rtw_ieee80211.c index c8998cb276be..62354c3194bd 100644 --- a/drivers/staging/r8188eu/core/rtw_ieee80211.c +++ b/drivers/staging/r8188eu/core/rtw_ieee80211.c @@ -653,11 +653,8 @@ static int rtw_ieee802_11_parse_vendor_specific(u8 *pos, uint elen, /* first 3 bytes in vendor specific information element are the IEEE * OUI of the vendor. The following byte is used a vendor specific * sub-type. */ - if (elen < 4) { - if (show_errors) { - } + if (elen < 4) return -1; - } oui = RTW_GET_BE24(pos); switch (oui) { @@ -672,9 +669,8 @@ static int rtw_ieee802_11_parse_vendor_specific(u8 *pos, uint elen, elems->wpa_ie_len = elen; break; case WME_OUI_TYPE: /* this is a Wi-Fi WME info. element */ - if (elen < 5) { + if (elen < 5) return -1; - } switch (pos[4]) { case WME_OUI_SUBTYPE_INFORMATION_ELEMENT: case WME_OUI_SUBTYPE_PARAMETER_ELEMENT: @@ -740,11 +736,8 @@ enum parse_res rtw_ieee802_11_parse_elems(u8 *start, uint len, elen = *pos++; left -= 2; - if (elen > left) { - if (show_errors) { - } + if (elen > left) return ParseFailed; - } switch (id) { case WLAN_EID_SSID: @@ -825,8 +818,6 @@ enum parse_res rtw_ieee802_11_parse_elems(u8 *start, uint len, break; default: unknown++; - if (!show_errors) - break; break; } left -= elen; @@ -874,9 +865,8 @@ void rtw_macaddr_cfg(u8 *mac_addr) ether_addr_copy(mac, mac_addr); } - if (is_broadcast_ether_addr(mac) || is_zero_ether_addr(mac)) { + if (is_broadcast_ether_addr(mac) || is_zero_ether_addr(mac)) eth_random_addr(mac_addr); - } } /** |