Commit 5a2abdca authored by Gustavo A. R. Silva's avatar Gustavo A. R. Silva Committed by Kalle Valo

iwlwifi: mvm: Fix fall-through warnings for Clang

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple
warnings by explicitly using the fallthrough pseudo-keyword as a
replacement for a number of "fall through" markings.

Notice that Clang doesn't recognize "fall through" comments as
implicit fall-through.

Link: https://github.com/KSPP/linux/issues/115Signed-off-by: default avatarGustavo A. R. Silva <gustavoars@kernel.org>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20201117135053.GA13248@embeddedor
parent c42d492c
...@@ -58,7 +58,7 @@ int iwl_mvm_leds_init(struct iwl_mvm *mvm) ...@@ -58,7 +58,7 @@ int iwl_mvm_leds_init(struct iwl_mvm *mvm)
switch (mode) { switch (mode) {
case IWL_LED_BLINK: case IWL_LED_BLINK:
IWL_ERR(mvm, "Blink led mode not supported, used default\n"); IWL_ERR(mvm, "Blink led mode not supported, used default\n");
/* fall through */ fallthrough;
case IWL_LED_DEFAULT: case IWL_LED_DEFAULT:
case IWL_LED_RF_STATE: case IWL_LED_RF_STATE:
mode = IWL_LED_RF_STATE; mode = IWL_LED_RF_STATE;
......
...@@ -232,7 +232,7 @@ int iwl_mvm_mac_ctxt_init(struct iwl_mvm *mvm, struct ieee80211_vif *vif) ...@@ -232,7 +232,7 @@ int iwl_mvm_mac_ctxt_init(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
case NL80211_IFTYPE_STATION: case NL80211_IFTYPE_STATION:
if (!vif->p2p) if (!vif->p2p)
break; break;
/* fall through */ fallthrough;
default: default:
__clear_bit(0, data.available_mac_ids); __clear_bit(0, data.available_mac_ids);
} }
......
...@@ -4047,7 +4047,7 @@ static int __iwl_mvm_assign_vif_chanctx(struct iwl_mvm *mvm, ...@@ -4047,7 +4047,7 @@ static int __iwl_mvm_assign_vif_chanctx(struct iwl_mvm *mvm,
mvmvif->ap_ibss_active = true; mvmvif->ap_ibss_active = true;
break; break;
} }
/* fall through */ fallthrough;
case NL80211_IFTYPE_ADHOC: case NL80211_IFTYPE_ADHOC:
/* /*
* The AP binding flow is handled as part of the start_ap flow * The AP binding flow is handled as part of the start_ap flow
......
...@@ -52,7 +52,7 @@ u8 iwl_mvm_get_ctrl_pos(struct cfg80211_chan_def *chandef) ...@@ -52,7 +52,7 @@ u8 iwl_mvm_get_ctrl_pos(struct cfg80211_chan_def *chandef)
return PHY_VHT_CTRL_POS_4_ABOVE; return PHY_VHT_CTRL_POS_4_ABOVE;
default: default:
WARN(1, "Invalid channel definition"); WARN(1, "Invalid channel definition");
/* fall through */ fallthrough;
case 0: case 0:
/* /*
* The FW is expected to check the control channel position only * The FW is expected to check the control channel position only
......
...@@ -170,7 +170,7 @@ static u32 iwl_mvm_set_mac80211_rx_flag(struct iwl_mvm *mvm, ...@@ -170,7 +170,7 @@ static u32 iwl_mvm_set_mac80211_rx_flag(struct iwl_mvm *mvm,
!(rx_pkt_status & RX_MPDU_RES_STATUS_TTAK_OK)) !(rx_pkt_status & RX_MPDU_RES_STATUS_TTAK_OK))
return 0; return 0;
*crypt_len = IEEE80211_TKIP_IV_LEN; *crypt_len = IEEE80211_TKIP_IV_LEN;
/* fall through */ fallthrough;
case RX_MPDU_RES_STATUS_SEC_WEP_ENC: case RX_MPDU_RES_STATUS_SEC_WEP_ENC:
if (!(rx_pkt_status & RX_MPDU_RES_STATUS_ICV_OK)) if (!(rx_pkt_status & RX_MPDU_RES_STATUS_ICV_OK))
......
...@@ -323,7 +323,7 @@ static int iwl_mvm_rx_crypto(struct iwl_mvm *mvm, struct ieee80211_hdr *hdr, ...@@ -323,7 +323,7 @@ static int iwl_mvm_rx_crypto(struct iwl_mvm *mvm, struct ieee80211_hdr *hdr,
stats->flag |= RX_FLAG_MMIC_ERROR; stats->flag |= RX_FLAG_MMIC_ERROR;
*crypt_len = IEEE80211_TKIP_IV_LEN; *crypt_len = IEEE80211_TKIP_IV_LEN;
/* fall through */ fallthrough;
case IWL_RX_MPDU_STATUS_SEC_WEP: case IWL_RX_MPDU_STATUS_SEC_WEP:
if (!(status & IWL_RX_MPDU_STATUS_ICV_OK)) if (!(status & IWL_RX_MPDU_STATUS_ICV_OK))
return -1; return -1;
...@@ -1282,7 +1282,7 @@ static void iwl_mvm_decode_he_phy_data(struct iwl_mvm *mvm, ...@@ -1282,7 +1282,7 @@ static void iwl_mvm_decode_he_phy_data(struct iwl_mvm *mvm,
he->data4 |= le16_encode_bits(le32_get_bits(phy_data->d2, he->data4 |= le16_encode_bits(le32_get_bits(phy_data->d2,
IWL_RX_PHY_DATA2_HE_TB_EXT_SPTL_REUSE4), IWL_RX_PHY_DATA2_HE_TB_EXT_SPTL_REUSE4),
IEEE80211_RADIOTAP_HE_DATA4_TB_SPTL_REUSE4); IEEE80211_RADIOTAP_HE_DATA4_TB_SPTL_REUSE4);
/* fall through */ fallthrough;
case IWL_RX_PHY_INFO_TYPE_HE_SU: case IWL_RX_PHY_INFO_TYPE_HE_SU:
case IWL_RX_PHY_INFO_TYPE_HE_MU: case IWL_RX_PHY_INFO_TYPE_HE_MU:
case IWL_RX_PHY_INFO_TYPE_HE_MU_EXT: case IWL_RX_PHY_INFO_TYPE_HE_MU_EXT:
...@@ -1355,7 +1355,7 @@ static void iwl_mvm_decode_he_phy_data(struct iwl_mvm *mvm, ...@@ -1355,7 +1355,7 @@ static void iwl_mvm_decode_he_phy_data(struct iwl_mvm *mvm,
IWL_RX_PHY_DATA4_HE_MU_EXT_PREAMBLE_PUNC_TYPE_MASK), IWL_RX_PHY_DATA4_HE_MU_EXT_PREAMBLE_PUNC_TYPE_MASK),
IEEE80211_RADIOTAP_HE_MU_FLAGS2_PUNC_FROM_SIG_A_BW); IEEE80211_RADIOTAP_HE_MU_FLAGS2_PUNC_FROM_SIG_A_BW);
iwl_mvm_decode_he_mu_ext(mvm, phy_data, rate_n_flags, he_mu); iwl_mvm_decode_he_mu_ext(mvm, phy_data, rate_n_flags, he_mu);
/* fall through */ fallthrough;
case IWL_RX_PHY_INFO_TYPE_HE_MU: case IWL_RX_PHY_INFO_TYPE_HE_MU:
he_mu->flags2 |= he_mu->flags2 |=
le16_encode_bits(le32_get_bits(phy_data->d1, le16_encode_bits(le32_get_bits(phy_data->d1,
...@@ -1365,7 +1365,7 @@ static void iwl_mvm_decode_he_phy_data(struct iwl_mvm *mvm, ...@@ -1365,7 +1365,7 @@ static void iwl_mvm_decode_he_phy_data(struct iwl_mvm *mvm,
le16_encode_bits(le32_get_bits(phy_data->d1, le16_encode_bits(le32_get_bits(phy_data->d1,
IWL_RX_PHY_DATA1_HE_MU_SIGB_COMPRESSION), IWL_RX_PHY_DATA1_HE_MU_SIGB_COMPRESSION),
IEEE80211_RADIOTAP_HE_MU_FLAGS2_SIG_B_COMP); IEEE80211_RADIOTAP_HE_MU_FLAGS2_SIG_B_COMP);
/* fall through */ fallthrough;
case IWL_RX_PHY_INFO_TYPE_HE_TB: case IWL_RX_PHY_INFO_TYPE_HE_TB:
case IWL_RX_PHY_INFO_TYPE_HE_TB_EXT: case IWL_RX_PHY_INFO_TYPE_HE_TB_EXT:
iwl_mvm_decode_he_phy_ru_alloc(phy_data, rate_n_flags, iwl_mvm_decode_he_phy_ru_alloc(phy_data, rate_n_flags,
......
...@@ -2341,7 +2341,7 @@ static int iwl_mvm_check_running_scans(struct iwl_mvm *mvm, int type) ...@@ -2341,7 +2341,7 @@ static int iwl_mvm_check_running_scans(struct iwl_mvm *mvm, int type)
/* Something is wrong if no scan was running but we /* Something is wrong if no scan was running but we
* ran out of scans. * ran out of scans.
*/ */
/* fall through */ fallthrough;
default: default:
WARN_ON(1); WARN_ON(1);
break; break;
......
...@@ -89,13 +89,13 @@ int iwl_mvm_sta_send_to_fw(struct iwl_mvm *mvm, struct ieee80211_sta *sta, ...@@ -89,13 +89,13 @@ int iwl_mvm_sta_send_to_fw(struct iwl_mvm *mvm, struct ieee80211_sta *sta,
switch (sta->bandwidth) { switch (sta->bandwidth) {
case IEEE80211_STA_RX_BW_160: case IEEE80211_STA_RX_BW_160:
add_sta_cmd.station_flags |= cpu_to_le32(STA_FLG_FAT_EN_160MHZ); add_sta_cmd.station_flags |= cpu_to_le32(STA_FLG_FAT_EN_160MHZ);
/* fall through */ fallthrough;
case IEEE80211_STA_RX_BW_80: case IEEE80211_STA_RX_BW_80:
add_sta_cmd.station_flags |= cpu_to_le32(STA_FLG_FAT_EN_80MHZ); add_sta_cmd.station_flags |= cpu_to_le32(STA_FLG_FAT_EN_80MHZ);
/* fall through */ fallthrough;
case IEEE80211_STA_RX_BW_40: case IEEE80211_STA_RX_BW_40:
add_sta_cmd.station_flags |= cpu_to_le32(STA_FLG_FAT_EN_40MHZ); add_sta_cmd.station_flags |= cpu_to_le32(STA_FLG_FAT_EN_40MHZ);
/* fall through */ fallthrough;
case IEEE80211_STA_RX_BW_20: case IEEE80211_STA_RX_BW_20:
if (sta->ht_cap.ht_supported) if (sta->ht_cap.ht_supported)
add_sta_cmd.station_flags |= add_sta_cmd.station_flags |=
...@@ -3240,14 +3240,14 @@ static int iwl_mvm_send_sta_key(struct iwl_mvm *mvm, ...@@ -3240,14 +3240,14 @@ static int iwl_mvm_send_sta_key(struct iwl_mvm *mvm,
break; break;
case WLAN_CIPHER_SUITE_WEP104: case WLAN_CIPHER_SUITE_WEP104:
key_flags |= cpu_to_le16(STA_KEY_FLG_WEP_13BYTES); key_flags |= cpu_to_le16(STA_KEY_FLG_WEP_13BYTES);
/* fall through */ fallthrough;
case WLAN_CIPHER_SUITE_WEP40: case WLAN_CIPHER_SUITE_WEP40:
key_flags |= cpu_to_le16(STA_KEY_FLG_WEP); key_flags |= cpu_to_le16(STA_KEY_FLG_WEP);
memcpy(u.cmd.common.key + 3, key->key, key->keylen); memcpy(u.cmd.common.key + 3, key->key, key->keylen);
break; break;
case WLAN_CIPHER_SUITE_GCMP_256: case WLAN_CIPHER_SUITE_GCMP_256:
key_flags |= cpu_to_le16(STA_KEY_FLG_KEY_32BYTES); key_flags |= cpu_to_le16(STA_KEY_FLG_KEY_32BYTES);
/* fall through */ fallthrough;
case WLAN_CIPHER_SUITE_GCMP: case WLAN_CIPHER_SUITE_GCMP:
key_flags |= cpu_to_le16(STA_KEY_FLG_GCMP); key_flags |= cpu_to_le16(STA_KEY_FLG_GCMP);
memcpy(u.cmd.common.key, key->key, key->keylen); memcpy(u.cmd.common.key, key->key, key->keylen);
......
...@@ -399,7 +399,7 @@ static void iwl_mvm_set_tx_cmd_crypto(struct iwl_mvm *mvm, ...@@ -399,7 +399,7 @@ static void iwl_mvm_set_tx_cmd_crypto(struct iwl_mvm *mvm,
case WLAN_CIPHER_SUITE_WEP104: case WLAN_CIPHER_SUITE_WEP104:
tx_cmd->sec_ctl |= TX_CMD_SEC_KEY128; tx_cmd->sec_ctl |= TX_CMD_SEC_KEY128;
/* fall through */ fallthrough;
case WLAN_CIPHER_SUITE_WEP40: case WLAN_CIPHER_SUITE_WEP40:
tx_cmd->sec_ctl |= TX_CMD_SEC_WEP | tx_cmd->sec_ctl |= TX_CMD_SEC_WEP |
((keyconf->keyidx << TX_CMD_SEC_WEP_KEY_IDX_POS) & ((keyconf->keyidx << TX_CMD_SEC_WEP_KEY_IDX_POS) &
...@@ -410,7 +410,7 @@ static void iwl_mvm_set_tx_cmd_crypto(struct iwl_mvm *mvm, ...@@ -410,7 +410,7 @@ static void iwl_mvm_set_tx_cmd_crypto(struct iwl_mvm *mvm,
case WLAN_CIPHER_SUITE_GCMP: case WLAN_CIPHER_SUITE_GCMP:
case WLAN_CIPHER_SUITE_GCMP_256: case WLAN_CIPHER_SUITE_GCMP_256:
type = TX_CMD_SEC_GCMP; type = TX_CMD_SEC_GCMP;
/* Fall through */ fallthrough;
case WLAN_CIPHER_SUITE_CCMP_256: case WLAN_CIPHER_SUITE_CCMP_256:
/* TODO: Taking the key from the table might introduce a race /* TODO: Taking the key from the table might introduce a race
* when PTK rekeying is done, having an old packets with a PN * when PTK rekeying is done, having an old packets with a PN
......
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