Skip to content

Commit

Permalink
net: rtl8192cu: Fix implicit fallthrough warnings
Browse files Browse the repository at this point in the history
These warnings appear with GCC 7.3.0 from toolchains.bootlin.com:

../drivers/net/wireless/realtek/rtl8192cu/core/rtw_mlme_ext.c: In function ‘mgt_dispatcher’:
../drivers/net/wireless/realtek/rtl8192cu/core/rtw_mlme_ext.c:734:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
    if(check_fwstate(pmlmepriv, WIFI_AP_STATE) == _TRUE)
      ^
../drivers/net/wireless/realtek/rtl8192cu/core/rtw_mlme_ext.c:739:3: note: here
   case WIFI_ASSOCREQ:
   ^~~~
../drivers/net/wireless/realtek/rtl8192cu/hal/rtl8192c/rtl8192c_phycfg.c: In function ‘phy_TxPwrIdxToDbm’:
../drivers/net/wireless/realtek/rtl8192cu/hal/rtl8192c/rtl8192c_phycfg.c:2365:10: warning: this statement may fall through [-Wimplicit-fallthrough=]
   Offset = -8;
   ~~~~~~~^~~~
../drivers/net/wireless/realtek/rtl8192cu/hal/rtl8192c/rtl8192c_phycfg.c:2366:2: note: here
  default:
  ^~~~~~~
../drivers/net/wireless/realtek/rtl8192cu/hal/rtl8192c/usb/usb_halinit.c: In function ‘GetHwReg8192CU’:
../drivers/net/wireless/realtek/rtl8192cu/hal/rtl8192c/usb/usb_halinit.c:5694:20: warning: this statement may fall through [-Wimplicit-fallthrough=]
    *((u16 *)(val)) = pHalData->BasicRateSet;
    ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
../drivers/net/wireless/realtek/rtl8192cu/hal/rtl8192c/usb/usb_halinit.c:5695:3: note: here
   case HW_VAR_TXPAUSE:
   ^~~~
../drivers/net/wireless/realtek/rtl8192cu/os_dep/linux/ioctl_linux.c: In function ‘set_group_key’:
../drivers/net/wireless/realtek/rtl8192cu/os_dep/linux/ioctl_linux.c:7383:11: warning: this statement may fall through [-Wimplicit-fallthrough=]
    keylen = 16;
    ~~~~~~~^~~~
../drivers/net/wireless/realtek/rtl8192cu/os_dep/linux/ioctl_linux.c:7384:3: note: here
   default:
   ^~~~~~~
../drivers/net/wireless/realtek/rtl8192cu/os_dep/linux/ioctl_cfg80211.c: In function ‘set_group_key’:
../drivers/net/wireless/realtek/rtl8192cu/os_dep/linux/ioctl_cfg80211.c:822:11: warning: this statement may fall through [-Wimplicit-fallthrough=]
    keylen = 16;
    ~~~~~~~^~~~
../drivers/net/wireless/realtek/rtl8192cu/os_dep/linux/ioctl_cfg80211.c:823:3: note: here
   default:
   ^~~~~~~

They all appear to be fall positives, label them as such.

Signed-off-by: Nathan Chancellor <[email protected]>
  • Loading branch information
nathanchance committed Mar 5, 2018
1 parent d70667d commit 9a0d088
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 12 deletions.
3 changes: 2 additions & 1 deletion drivers/net/wireless/realtek/rtl8192cu/core/rtw_mlme_ext.c
Original file line number Diff line number Diff line change
Expand Up @@ -733,9 +733,10 @@ void mgt_dispatcher(_adapter *padapter, union recv_frame *precv_frame)
case WIFI_AUTH:
if(check_fwstate(pmlmepriv, WIFI_AP_STATE) == _TRUE)
ptable->func = &OnAuth;
/* falls through */
else
ptable->func = &OnAuthClient;
//pass through
/* falls through */
case WIFI_ASSOCREQ:
case WIFI_REASSOCREQ:
_mgt_dispatcher(padapter, ptable, precv_frame);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2360,9 +2360,6 @@ phy_TxPwrIdxToDbm(
Offset = -7;
break;

case WIRELESS_MODE_G:
case WIRELESS_MODE_N_24G:
Offset = -8;
default:
Offset = -8;
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5692,6 +5692,7 @@ _func_enter_;
{
case HW_VAR_BASIC_RATE:
*((u16 *)(val)) = pHalData->BasicRateSet;
/* falls through */
case HW_VAR_TXPAUSE:
val[0] = rtw_read8(Adapter, REG_TXPAUSE);
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -816,12 +816,9 @@ static int set_group_key(_adapter *padapter, u8 *key, u8 alg, int keyid)
case _WEP104_:
keylen = 13;
break;
case _TKIP_:
case _TKIP_WTMIC_:
case _AES_:
keylen = 16;
default:
keylen = 16;
break;
}

_rtw_memcpy(&(psetkeyparm->key[0]), key, keylen);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7377,10 +7377,6 @@ static int set_group_key(_adapter *padapter, u8 *key, u8 alg, int keyid)
case _WEP104_:
keylen = 13;
break;
case _TKIP_:
case _TKIP_WTMIC_:
case _AES_:
keylen = 16;
default:
keylen = 16;
}
Expand Down

0 comments on commit 9a0d088

Please sign in to comment.