mwifiex: Fix fall-through warnings for Clang
Subsystems (3)
PATCH 1/1 mwifiex: Fix fall-through warnings for Clang
In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding multiple break statements instead of letting the code fall through to the next case.
--- drivers/net/wireless/marvell/mwifiex/sta_cmdresp.c | 2 ++ drivers/net/wireless/marvell/mwifiex/sta_event.c | 1 + drivers/net/wireless/marvell/mwifiex/uap_cmd.c | 1 + drivers/net/wireless/marvell/mwifiex/wmm.c | 1 + 4 files changed, 5 insertions(+)
drivers/net/wireless/marvell/mwifiex/sta_cmdresp.c +2 -0
@@ -201,6 +201,7 @@ static int mwifiex_ret_802_11_snmp_mib(struct mwifiex_private *priv,mwifiex_dbg (priv->adapter,INFO ,"info: SNMP_RESP: DTIM period=%u\n" , ul_temp); +break ;default :break ; }
@@ -1393,6 +1394,7 @@ int mwifiex_process_sta_cmdresp(struct mwifiex_private *priv, u16 cmdresp_no,break ;case HostCmd_CMD_TDLS_OPER: ret =mwifiex_ret_tdls_oper (priv, resp); +break ;case HostCmd_CMD_MC_POLICY:break ;case HostCmd_CMD_CHAN_REPORT_REQUEST:
drivers/net/wireless/marvell/mwifiex/sta_event.c +1 -0
@@ -99,6 +99,7 @@ static int mwifiex_check_ibss_peer_capabilities(struct mwifiex_private *priv,case IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_3895 : sta_ptr->max_amsdu =MWIFIEX_TX_DATA_BUF_SIZE_4K ; +break ;default :break ; }
drivers/net/wireless/marvell/mwifiex/uap_cmd.c +1 -0
@@ -108,6 +108,7 @@ int mwifiex_set_secure_params(struct mwifiex_private *priv,if (params->crypto.wpa_versions &NL80211_WPA_VERSION_2 ) bss_config->wpa_cfg.pairwise_cipher_wpa2 |=CIPHER_AES_CCMP ; +break ;default :break ; }
drivers/net/wireless/marvell/mwifiex/wmm.c +1 -0
@@ -1396,6 +1396,7 @@ mwifiex_send_processed_packet(struct mwifiex_private *priv,break ;case 0 :mwifiex_write_data_complete (adapter, skb,0 , ret); +break ;default :break ; }
Signature · 1 line
2.27.0
Quoted 3 lines · Gustavo A. R. Silva
In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding multiple break statements instead of letting the code fall through to the next case.
Thanks Gustavo.
I think this is better style than the gcc allowed
undescribed fallthrough to break;
gcc developers disagree though:
Quoted 5 lines · Joe Perches
Quoted 3 lines · Gustavo A. R. Silva
In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding multiple break statements instead of letting the code fall through to the next case.
Quoted 8 lines
Thanks Gustavo.
I think this is better style than the gcc allowed
undescribed fallthrough to break;gcc developers disagree though:
Yeah; I mention that in this[1] changelog text, together with the reasons why we think the Clang approach is safer. which is exactly the same information contained in the link[2] included in the changelog text for this commit.
--
Gustavo
[1] https://git.kernel.org/linus/4169e889e5889405d54cec27d6e9f7f0ce3c7096
[2] https://github.com/KSPP/linux/issues/115
Quoted 6 lines · Gustavo A. R. Silva
In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding multiple break statements instead of letting the code fall through to the next case.
Patch applied to wireless-drivers-next.git, thanks.
003317581372 mwifiex: Fix fall-through warnings for Clang
Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/patch/20201117160958.GA18807@embeddedor/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
Quoted 6 lines · Kalle Valo
Quoted 4 lines · Gustavo A. R. Silva
In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding multiple break statements instead of letting the code fall through to the next case.
Quoted 6 lines
Quoted 2 lines
Patch applied to wireless-drivers-next.git, thanks.
003317581372 mwifiex: Fix fall-through warnings for Clang
Thank you, Kalle.
--
Gustavo