Skip to contentSkip to conversation

iwlwifi: dvm: Fix fall-through warnings for Clang

PATCH In review Gustavo A. R. Silva 2 participants 2 messages Nov 17, 2020 – Dec 11, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iwlwifi: dvm: 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.

---
 drivers/net/wireless/intel/iwlwifi/dvm/mac80211.c | 2 +-
 drivers/net/wireless/intel/iwlwifi/dvm/rx.c       | 6 +++---
 drivers/net/wireless/intel/iwlwifi/dvm/scan.c     | 2 +-
 drivers/net/wireless/intel/iwlwifi/dvm/sta.c      | 2 +-
 drivers/net/wireless/intel/iwlwifi/dvm/tx.c       | 2 +-
 5 files changed, 7 insertions(+), 7 deletions(-)
drivers/net/wireless/intel/iwlwifi/dvm/mac80211.c +1 -1
index 423d3c396b2d..75e7665773c5 100644
@@ -619,7 +619,7 @@ static int iwlagn_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
 	switch (key->cipher) {
 	case WLAN_CIPHER_SUITE_TKIP:
 		key->flags |= IEEE80211_KEY_FLAG_GENERATE_MMIC;
-		/* fall through */
+		fallthrough;
 	case WLAN_CIPHER_SUITE_CCMP:
 		key->flags |= IEEE80211_KEY_FLAG_GENERATE_IV;
 		break;
drivers/net/wireless/intel/iwlwifi/dvm/rx.c +3 -3
index 9d55ece05020..dd251190f68e 100644
@@ -582,7 +582,7 @@ static int iwlagn_set_decrypted_flag(struct iwl_priv *priv,
 		if ((decrypt_res & RX_RES_STATUS_DECRYPT_TYPE_MSK) ==
 		    RX_RES_STATUS_BAD_KEY_TTAK)
 			break;
-		/* fall through */
+		fallthrough;
 	case RX_RES_STATUS_SEC_TYPE_WEP:
 		if ((decrypt_res & RX_RES_STATUS_DECRYPT_TYPE_MSK) ==
 		    RX_RES_STATUS_BAD_ICV_MIC) {
@@ -591,7 +591,7 @@ static int iwlagn_set_decrypted_flag(struct iwl_priv *priv,
 			IWL_DEBUG_RX(priv, "Packet destroyed\n");
 			return -1;
 		}
-		/* fall through */
+		fallthrough;
 	case RX_RES_STATUS_SEC_TYPE_CCMP:
 		if ((decrypt_res & RX_RES_STATUS_DECRYPT_TYPE_MSK) ==
 		    RX_RES_STATUS_DECRYPT_OK) {
@@ -720,7 +720,7 @@ static u32 iwlagn_translate_rx_status(struct iwl_priv *priv, u32 decrypt_in)
 			decrypt_out |= RX_RES_STATUS_BAD_KEY_TTAK;
 			break;
 		}
-		/* fall through */
+		fallthrough;
 	default:
 		if (!(decrypt_in & RX_MPDU_RES_STATUS_ICV_OK))
 			decrypt_out |= RX_RES_STATUS_BAD_ICV_MIC;
drivers/net/wireless/intel/iwlwifi/dvm/scan.c +1 -1
index 832fcbb787e9..c4ecf6ed2186 100644
@@ -405,7 +405,7 @@ static u16 iwl_limit_dwell(struct iwl_priv *priv, u16 dwell_time)
 		limit = (limits[1] * 98) / 100 - IWL_CHANNEL_TUNE_TIME * 2;
 		limit /= 2;
 		dwell_time = min(limit, dwell_time);
-		/* fall through */
+		fallthrough;
 	case 1:
 		limit = (limits[0] * 98) / 100 - IWL_CHANNEL_TUNE_TIME * 2;
 		limit /= n_active;
drivers/net/wireless/intel/iwlwifi/dvm/sta.c +1 -1
index e622948661fa..ddc14059b07d 100644
@@ -1109,7 +1109,7 @@ static int iwlagn_send_sta_key(struct iwl_priv *priv,
 		break;
 	case WLAN_CIPHER_SUITE_WEP104:
 		key_flags |= STA_KEY_FLG_KEY_SIZE_MSK;
-		/* fall through */
+		fallthrough;
 	case WLAN_CIPHER_SUITE_WEP40:
 		key_flags |= STA_KEY_FLG_WEP;
 		memcpy(&sta_cmd.key.key[3], keyconf->key, keyconf->keylen);
drivers/net/wireless/intel/iwlwifi/dvm/tx.c +1 -1
index e3962bb52328..847b8e07f81c 100644
@@ -210,7 +210,7 @@ static void iwlagn_tx_cmd_build_hwcrypto(struct iwl_priv *priv,
 
 	case WLAN_CIPHER_SUITE_WEP104:
 		tx_cmd->sec_ctl |= TX_CMD_SEC_KEY128;
-		/* fall through */
+		fallthrough;
 	case WLAN_CIPHER_SUITE_WEP40:
 		tx_cmd->sec_ctl |= (TX_CMD_SEC_WEP |
 			(keyconf->keyidx & TX_CMD_SEC_MSK) << TX_CMD_SEC_SHIFT);
Signature · 1 line
2.27.0
#1 lore raw
Quoted 9 lines · Gustavo A. R. Silva

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.

Patch applied to wireless-drivers-next.git, thanks.

ff08b5368ce5 iwlwifi: dvm: Fix fall-through warnings for Clang

Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/patch/20201117155904.GA14551@embeddedor/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches