Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 02049ce2 authored by Gustavo A. R. Silva's avatar Gustavo A. R. Silva Committed by Johannes Berg
Browse files

mac80211: mark expected switch fall-throughs



In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

Notice that in some cases I replaced "fall through on else" and
"otherwise fall through" comments with just a "fall through" comment,
which is what GCC is expecting to find.

Signed-off-by: default avatarGustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 51e18a45
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -573,10 +573,12 @@ static int ieee80211_get_key(struct wiphy *wiphy, struct net_device *dev,
	case WLAN_CIPHER_SUITE_BIP_CMAC_256:
	case WLAN_CIPHER_SUITE_BIP_CMAC_256:
		BUILD_BUG_ON(offsetof(typeof(kseq), ccmp) !=
		BUILD_BUG_ON(offsetof(typeof(kseq), ccmp) !=
			     offsetof(typeof(kseq), aes_cmac));
			     offsetof(typeof(kseq), aes_cmac));
		/* fall through */
	case WLAN_CIPHER_SUITE_BIP_GMAC_128:
	case WLAN_CIPHER_SUITE_BIP_GMAC_128:
	case WLAN_CIPHER_SUITE_BIP_GMAC_256:
	case WLAN_CIPHER_SUITE_BIP_GMAC_256:
		BUILD_BUG_ON(offsetof(typeof(kseq), ccmp) !=
		BUILD_BUG_ON(offsetof(typeof(kseq), ccmp) !=
			     offsetof(typeof(kseq), aes_gmac));
			     offsetof(typeof(kseq), aes_gmac));
		/* fall through */
	case WLAN_CIPHER_SUITE_GCMP:
	case WLAN_CIPHER_SUITE_GCMP:
	case WLAN_CIPHER_SUITE_GCMP_256:
	case WLAN_CIPHER_SUITE_GCMP_256:
		BUILD_BUG_ON(offsetof(typeof(kseq), ccmp) !=
		BUILD_BUG_ON(offsetof(typeof(kseq), ccmp) !=
@@ -2205,6 +2207,7 @@ static int ieee80211_scan(struct wiphy *wiphy,
		 * for now fall through to allow scanning only when
		 * for now fall through to allow scanning only when
		 * beaconing hasn't been configured yet
		 * beaconing hasn't been configured yet
		 */
		 */
		/* fall through */
	case NL80211_IFTYPE_AP:
	case NL80211_IFTYPE_AP:
		/*
		/*
		 * If the scan has been forced (and the driver supports
		 * If the scan has been forced (and the driver supports
+1 −0
Original line number Original line Diff line number Diff line
@@ -493,6 +493,7 @@ int ieee80211_send_smps_action(struct ieee80211_sub_if_data *sdata,
	case IEEE80211_SMPS_AUTOMATIC:
	case IEEE80211_SMPS_AUTOMATIC:
	case IEEE80211_SMPS_NUM_MODES:
	case IEEE80211_SMPS_NUM_MODES:
		WARN_ON(1);
		WARN_ON(1);
		/* fall through */
	case IEEE80211_SMPS_OFF:
	case IEEE80211_SMPS_OFF:
		action_frame->u.action.u.ht_smps.smps_control =
		action_frame->u.action.u.ht_smps.smps_control =
				WLAN_HT_SMPS_CONTROL_DISABLED;
				WLAN_HT_SMPS_CONTROL_DISABLED;
+1 −1
Original line number Original line Diff line number Diff line
@@ -1633,7 +1633,7 @@ static void ieee80211_assign_perm_addr(struct ieee80211_local *local,
				goto out_unlock;
				goto out_unlock;
			}
			}
		}
		}
		/* otherwise fall through */
		/* fall through */
	default:
	default:
		/* assign a new address if possible -- try n_addresses first */
		/* assign a new address if possible -- try n_addresses first */
		for (i = 0; i < local->hw.wiphy->n_addresses; i++) {
		for (i = 0; i < local->hw.wiphy->n_addresses; i++) {
+2 −0
Original line number Original line Diff line number Diff line
@@ -989,8 +989,10 @@ ieee80211_mesh_process_chnswitch(struct ieee80211_sub_if_data *sdata,
	switch (sdata->vif.bss_conf.chandef.width) {
	switch (sdata->vif.bss_conf.chandef.width) {
	case NL80211_CHAN_WIDTH_20_NOHT:
	case NL80211_CHAN_WIDTH_20_NOHT:
		sta_flags |= IEEE80211_STA_DISABLE_HT;
		sta_flags |= IEEE80211_STA_DISABLE_HT;
		/* fall through */
	case NL80211_CHAN_WIDTH_20:
	case NL80211_CHAN_WIDTH_20:
		sta_flags |= IEEE80211_STA_DISABLE_40MHZ;
		sta_flags |= IEEE80211_STA_DISABLE_40MHZ;
		/* fall through */
	case NL80211_CHAN_WIDTH_40:
	case NL80211_CHAN_WIDTH_40:
		sta_flags |= IEEE80211_STA_DISABLE_VHT;
		sta_flags |= IEEE80211_STA_DISABLE_VHT;
		break;
		break;
+1 −0
Original line number Original line Diff line number Diff line
@@ -1250,6 +1250,7 @@ void mesh_path_tx_root_frame(struct ieee80211_sub_if_data *sdata)
		break;
		break;
	case IEEE80211_PROACTIVE_PREQ_WITH_PREP:
	case IEEE80211_PROACTIVE_PREQ_WITH_PREP:
		flags |= IEEE80211_PREQ_PROACTIVE_PREP_FLAG;
		flags |= IEEE80211_PREQ_PROACTIVE_PREP_FLAG;
		/* fall through */
	case IEEE80211_PROACTIVE_PREQ_NO_PREP:
	case IEEE80211_PROACTIVE_PREQ_NO_PREP:
		interval = ifmsh->mshcfg.dot11MeshHWMPactivePathToRootTimeout;
		interval = ifmsh->mshcfg.dot11MeshHWMPactivePathToRootTimeout;
		target_flags |= IEEE80211_PREQ_TO_FLAG |
		target_flags |= IEEE80211_PREQ_TO_FLAG |
Loading