mac80211_hwsim: mark expected switch fall-through [Linux 5.2]

mac80211_hwsim: mark expected switch fall-through [Linux 5.2]

This Linux kernel change "mac80211_hwsim: mark expected switch fall-through" is included in the Linux 5.2 release. This change is authored by Gustavo A. R. Silva <gustavo [at]> on Mon Apr 29 13:19:50 2019 -0500. The commit for this change in Linux stable tree is 85a55ff (patch).

mac80211_hwsim: mark expected switch fall-through

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

This patch fixes the following warning:

drivers/net/wireless/mac80211_hwsim.c: In function ‘init_mac80211_hwsim’:
drivers/net/wireless/mac80211_hwsim.c:3853:21: warning: this statement may fall through [-Wimplicit-fallthrough=]
    param.reg_strict = true;
drivers/net/wireless/mac80211_hwsim.c:3854:3: note: here

Warning level 3 was used: -Wimplicit-fallthrough=3

This patch is part of the ongoing efforts to enable

Signed-off-by: Gustavo A. R. Silva <[email protected]>
Signed-off-by: Johannes Berg <[email protected]>

There is one line of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 drivers/net/wireless/mac80211_hwsim.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index 60ca13e..b5274d1 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -3851,6 +3851,7 @@ static int __init init_mac80211_hwsim(void)
            param.reg_strict = true;
+           /* fall through */
            param.reg_alpha2 = hwsim_alpha2s[0];

Leave a Reply

Your email address will not be published. Required fields are marked *