Commit 925b5978 authored by Luca Coelho's avatar Luca Coelho Committed by Johannes Berg

cfg80211: add some missing fall through annotations

There are talks about enabling -Wimplicit-fallthrough warnings in the
mainline and it is already enabled in linux-next.  Add all the
missing annotations to prevent warnings when this happens.

And in one case, remove the extra text from the annotation so that the
compiler recognizes it.
Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 30db641e
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
* *
* Copyright 2009 Johannes Berg <johannes@sipsolutions.net> * Copyright 2009 Johannes Berg <johannes@sipsolutions.net>
* Copyright 2013-2014 Intel Mobile Communications GmbH * Copyright 2013-2014 Intel Mobile Communications GmbH
* Copyright 2018 Intel Corporation
*/ */
#include <linux/export.h> #include <linux/export.h>
...@@ -747,6 +748,7 @@ bool cfg80211_chandef_usable(struct wiphy *wiphy, ...@@ -747,6 +748,7 @@ bool cfg80211_chandef_usable(struct wiphy *wiphy,
case NL80211_CHAN_WIDTH_20: case NL80211_CHAN_WIDTH_20:
if (!ht_cap->ht_supported) if (!ht_cap->ht_supported)
return false; return false;
/* fall through */
case NL80211_CHAN_WIDTH_20_NOHT: case NL80211_CHAN_WIDTH_20_NOHT:
prohibited_flags |= IEEE80211_CHAN_NO_20MHZ; prohibited_flags |= IEEE80211_CHAN_NO_20MHZ;
width = 20; width = 20;
...@@ -769,6 +771,7 @@ bool cfg80211_chandef_usable(struct wiphy *wiphy, ...@@ -769,6 +771,7 @@ bool cfg80211_chandef_usable(struct wiphy *wiphy,
cap = vht_cap->cap & IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK; cap = vht_cap->cap & IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK;
if (cap != IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ) if (cap != IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ)
return false; return false;
/* fall through */
case NL80211_CHAN_WIDTH_80: case NL80211_CHAN_WIDTH_80:
if (!vht_cap->vht_supported) if (!vht_cap->vht_supported)
return false; return false;
......
...@@ -1851,6 +1851,7 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *rdev, ...@@ -1851,6 +1851,7 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *rdev,
state->split_start++; state->split_start++;
if (state->split) if (state->split)
break; break;
/* fall through */
case 1: case 1:
if (nla_put(msg, NL80211_ATTR_CIPHER_SUITES, if (nla_put(msg, NL80211_ATTR_CIPHER_SUITES,
sizeof(u32) * rdev->wiphy.n_cipher_suites, sizeof(u32) * rdev->wiphy.n_cipher_suites,
...@@ -1897,6 +1898,7 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *rdev, ...@@ -1897,6 +1898,7 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *rdev,
state->split_start++; state->split_start++;
if (state->split) if (state->split)
break; break;
/* fall through */
case 2: case 2:
if (nl80211_put_iftypes(msg, NL80211_ATTR_SUPPORTED_IFTYPES, if (nl80211_put_iftypes(msg, NL80211_ATTR_SUPPORTED_IFTYPES,
rdev->wiphy.interface_modes)) rdev->wiphy.interface_modes))
...@@ -1904,6 +1906,7 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *rdev, ...@@ -1904,6 +1906,7 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *rdev,
state->split_start++; state->split_start++;
if (state->split) if (state->split)
break; break;
/* fall through */
case 3: case 3:
nl_bands = nla_nest_start(msg, NL80211_ATTR_WIPHY_BANDS); nl_bands = nla_nest_start(msg, NL80211_ATTR_WIPHY_BANDS);
if (!nl_bands) if (!nl_bands)
...@@ -1929,6 +1932,7 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *rdev, ...@@ -1929,6 +1932,7 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *rdev,
state->chan_start++; state->chan_start++;
if (state->split) if (state->split)
break; break;
/* fall through */
default: default:
/* add frequencies */ /* add frequencies */
nl_freqs = nla_nest_start( nl_freqs = nla_nest_start(
...@@ -1982,6 +1986,7 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *rdev, ...@@ -1982,6 +1986,7 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *rdev,
state->split_start++; state->split_start++;
if (state->split) if (state->split)
break; break;
/* fall through */
case 4: case 4:
nl_cmds = nla_nest_start(msg, NL80211_ATTR_SUPPORTED_COMMANDS); nl_cmds = nla_nest_start(msg, NL80211_ATTR_SUPPORTED_COMMANDS);
if (!nl_cmds) if (!nl_cmds)
...@@ -2008,6 +2013,7 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *rdev, ...@@ -2008,6 +2013,7 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *rdev,
state->split_start++; state->split_start++;
if (state->split) if (state->split)
break; break;
/* fall through */
case 5: case 5:
if (rdev->ops->remain_on_channel && if (rdev->ops->remain_on_channel &&
(rdev->wiphy.flags & WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL) && (rdev->wiphy.flags & WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL) &&
...@@ -2025,6 +2031,7 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *rdev, ...@@ -2025,6 +2031,7 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *rdev,
state->split_start++; state->split_start++;
if (state->split) if (state->split)
break; break;
/* fall through */
case 6: case 6:
#ifdef CONFIG_PM #ifdef CONFIG_PM
if (nl80211_send_wowlan(msg, rdev, state->split)) if (nl80211_send_wowlan(msg, rdev, state->split))
...@@ -2035,6 +2042,7 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *rdev, ...@@ -2035,6 +2042,7 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *rdev,
#else #else
state->split_start++; state->split_start++;
#endif #endif
/* fall through */
case 7: case 7:
if (nl80211_put_iftypes(msg, NL80211_ATTR_SOFTWARE_IFTYPES, if (nl80211_put_iftypes(msg, NL80211_ATTR_SOFTWARE_IFTYPES,
rdev->wiphy.software_iftypes)) rdev->wiphy.software_iftypes))
...@@ -2047,6 +2055,7 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *rdev, ...@@ -2047,6 +2055,7 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *rdev,
state->split_start++; state->split_start++;
if (state->split) if (state->split)
break; break;
/* fall through */
case 8: case 8:
if ((rdev->wiphy.flags & WIPHY_FLAG_HAVE_AP_SME) && if ((rdev->wiphy.flags & WIPHY_FLAG_HAVE_AP_SME) &&
nla_put_u32(msg, NL80211_ATTR_DEVICE_AP_SME, nla_put_u32(msg, NL80211_ATTR_DEVICE_AP_SME,
......
...@@ -1183,7 +1183,7 @@ cfg80211_inform_bss_data(struct wiphy *wiphy, ...@@ -1183,7 +1183,7 @@ cfg80211_inform_bss_data(struct wiphy *wiphy,
switch (ftype) { switch (ftype) {
case CFG80211_BSS_FTYPE_BEACON: case CFG80211_BSS_FTYPE_BEACON:
ies->from_beacon = true; ies->from_beacon = true;
/* fall through to assign */ /* fall through */
case CFG80211_BSS_FTYPE_UNKNOWN: case CFG80211_BSS_FTYPE_UNKNOWN:
rcu_assign_pointer(tmp.pub.beacon_ies, ies); rcu_assign_pointer(tmp.pub.beacon_ies, ies);
break; break;
......
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