]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
mac80211: mark expected switch fall-throughs
authorGustavo A. R. Silva <garsilva@embeddedor.com>
Tue, 17 Oct 2017 23:14:50 +0000 (18:14 -0500)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 11 Dec 2017 11:16:04 +0000 (12:16 +0100)
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: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/cfg.c
net/mac80211/ht.c
net/mac80211/iface.c
net/mac80211/mesh.c
net/mac80211/mesh_hwmp.c
net/mac80211/mesh_plink.c
net/mac80211/mlme.c
net/mac80211/offchannel.c
net/mac80211/tdls.c
net/mac80211/wme.c

index fb15d3b97cb214078f1533f880350fe280b57c69..b77ee342b5f8ea367f477de7cf9888ced3fa4e57 100644 (file)
@@ -573,10 +573,12 @@ static int ieee80211_get_key(struct wiphy *wiphy, struct net_device *dev,
        case WLAN_CIPHER_SUITE_BIP_CMAC_256:
                BUILD_BUG_ON(offsetof(typeof(kseq), ccmp) !=
                             offsetof(typeof(kseq), aes_cmac));
+               /* fall through */
        case WLAN_CIPHER_SUITE_BIP_GMAC_128:
        case WLAN_CIPHER_SUITE_BIP_GMAC_256:
                BUILD_BUG_ON(offsetof(typeof(kseq), ccmp) !=
                             offsetof(typeof(kseq), aes_gmac));
+               /* fall through */
        case WLAN_CIPHER_SUITE_GCMP:
        case WLAN_CIPHER_SUITE_GCMP_256:
                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
                 * beaconing hasn't been configured yet
                 */
+               /* fall through */
        case NL80211_IFTYPE_AP:
                /*
                 * If the scan has been forced (and the driver supports
index 167f83b853e6bd391256e15ef99439b792e18cdc..cb0860d751fd4e470d3c5ed18e7081957a7c50b8 100644 (file)
@@ -493,6 +493,7 @@ int ieee80211_send_smps_action(struct ieee80211_sub_if_data *sdata,
        case IEEE80211_SMPS_AUTOMATIC:
        case IEEE80211_SMPS_NUM_MODES:
                WARN_ON(1);
+               /* fall through */
        case IEEE80211_SMPS_OFF:
                action_frame->u.action.u.ht_smps.smps_control =
                                WLAN_HT_SMPS_CONTROL_DISABLED;
index 13b16f90e1cf4efcd3dab8366a553cdd1b6598bd..435e7358004c4f612b927d058ab14ef44119fe13 100644 (file)
@@ -1633,7 +1633,7 @@ static void ieee80211_assign_perm_addr(struct ieee80211_local *local,
                                goto out_unlock;
                        }
                }
-               /* otherwise fall through */
+               /* fall through */
        default:
                /* assign a new address if possible -- try n_addresses first */
                for (i = 0; i < local->hw.wiphy->n_addresses; i++) {
index 5e27364e10acf3420e8f192b09488ab4bc252d09..73ac607beb5d704b3c74845baade196d0f66888b 100644 (file)
@@ -989,8 +989,10 @@ ieee80211_mesh_process_chnswitch(struct ieee80211_sub_if_data *sdata,
        switch (sdata->vif.bss_conf.chandef.width) {
        case NL80211_CHAN_WIDTH_20_NOHT:
                sta_flags |= IEEE80211_STA_DISABLE_HT;
+               /* fall through */
        case NL80211_CHAN_WIDTH_20:
                sta_flags |= IEEE80211_STA_DISABLE_40MHZ;
+               /* fall through */
        case NL80211_CHAN_WIDTH_40:
                sta_flags |= IEEE80211_STA_DISABLE_VHT;
                break;
index 4394463a0c2e6a4b8623c80da2c10729996a2b8d..35ad3983ae4b6b26fb13f6718b692c9b9b0d6e98 100644 (file)
@@ -1250,6 +1250,7 @@ void mesh_path_tx_root_frame(struct ieee80211_sub_if_data *sdata)
                break;
        case IEEE80211_PROACTIVE_PREQ_WITH_PREP:
                flags |= IEEE80211_PREQ_PROACTIVE_PREP_FLAG;
+               /* fall through */
        case IEEE80211_PROACTIVE_PREQ_NO_PREP:
                interval = ifmsh->mshcfg.dot11MeshHWMPactivePathToRootTimeout;
                target_flags |= IEEE80211_PREQ_TO_FLAG |
index e2d00cce3c17448f07d882d8d9cf9a98307aa661..0f6c9ca590628ccfaff872ec89c7e5bc9149424e 100644 (file)
@@ -672,7 +672,7 @@ void mesh_plink_timer(struct timer_list *t)
                        break;
                }
                reason = WLAN_REASON_MESH_MAX_RETRIES;
-               /* fall through on else */
+               /* fall through */
        case NL80211_PLINK_CNF_RCVD:
                /* confirm timer */
                if (!reason)
index c244691deab9c6dcae91305e429092dd6e23f1e2..fa0f96c74898235d8415c09a741faa69f68d7211 100644 (file)
@@ -473,6 +473,7 @@ static void ieee80211_add_ht_ie(struct ieee80211_sub_if_data *sdata,
        case IEEE80211_SMPS_AUTOMATIC:
        case IEEE80211_SMPS_NUM_MODES:
                WARN_ON(1);
+               /* fall through */
        case IEEE80211_SMPS_OFF:
                cap |= WLAN_HT_CAP_SM_PS_DISABLED <<
                        IEEE80211_HT_CAP_SM_PS_SHIFT;
index faf4f60550001df531bd6b808fbafc8b74a28d30..f1d40b6645ff2777713885bef12936860f5ec9c8 100644 (file)
@@ -801,14 +801,14 @@ int ieee80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
        case NL80211_IFTYPE_ADHOC:
                if (!sdata->vif.bss_conf.ibss_joined)
                        need_offchan = true;
-               /* fall through */
 #ifdef CONFIG_MAC80211_MESH
+               /* fall through */
        case NL80211_IFTYPE_MESH_POINT:
                if (ieee80211_vif_is_mesh(&sdata->vif) &&
                    !sdata->u.mesh.mesh_id_len)
                        need_offchan = true;
-               /* fall through */
 #endif
+               /* fall through */
        case NL80211_IFTYPE_AP:
        case NL80211_IFTYPE_AP_VLAN:
        case NL80211_IFTYPE_P2P_GO:
index 91093d4a2f841bb3f1987cde6d9237dd406d1f02..96d4fb998e33e62616876388d19dab73b3867a7d 100644 (file)
@@ -236,6 +236,7 @@ static enum ieee80211_ac_numbers ieee80211_ac_from_wmm(int ac)
        switch (ac) {
        default:
                WARN_ON_ONCE(1);
+               /* fall through */
        case 0:
                return IEEE80211_AC_BE;
        case 1:
index 3e3d3014e9ab6d026a13232ce6cb930b9fc87093..5f7c96368b11915f1a1c6037267b7b03b9957aa8 100644 (file)
@@ -165,6 +165,7 @@ u16 ieee80211_select_queue(struct ieee80211_sub_if_data *sdata,
                        qos = sta->sta.wme;
                        break;
                }
+               /* fall through */
        case NL80211_IFTYPE_AP:
                ra = skb->data;
                break;