All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RESEND][next] rtl8xxxu: Fix fall-through warnings for Clang
@ 2021-03-05  9:48 Gustavo A. R. Silva
  2021-03-05 13:40 ` Kalle Valo
                   ` (3 more replies)
  0 siblings, 4 replies; 18+ messages in thread
From: Gustavo A. R. Silva @ 2021-03-05  9:48 UTC (permalink / raw)
  To: Jes Sorensen, Kalle Valo, David S. Miller, Jakub Kicinski
  Cc: linux-wireless, netdev, linux-kernel, Gustavo A. R. Silva,
	linux-hardening

In preparation to enable -Wimplicit-fallthrough for Clang, fix
multiple warnings by replacing /* fall through */ comments with
the new pseudo-keyword macro fallthrough; instead of letting the
code fall through to the next case.

Notice that Clang doesn't recognize /* fall through */ comments as
implicit fall-through markings.

Link: https://github.com/KSPP/linux/issues/115
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
---
 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
index 5cd7ef3625c5..afc97958fa4d 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
@@ -1145,7 +1145,7 @@ void rtl8xxxu_gen1_config_channel(struct ieee80211_hw *hw)
 	switch (hw->conf.chandef.width) {
 	case NL80211_CHAN_WIDTH_20_NOHT:
 		ht = false;
-		/* fall through */
+		fallthrough;
 	case NL80211_CHAN_WIDTH_20:
 		opmode |= BW_OPMODE_20MHZ;
 		rtl8xxxu_write8(priv, REG_BW_OPMODE, opmode);
@@ -1272,7 +1272,7 @@ void rtl8xxxu_gen2_config_channel(struct ieee80211_hw *hw)
 	switch (hw->conf.chandef.width) {
 	case NL80211_CHAN_WIDTH_20_NOHT:
 		ht = false;
-		/* fall through */
+		fallthrough;
 	case NL80211_CHAN_WIDTH_20:
 		rf_mode_bw |= WMAC_TRXPTCL_CTL_BW_20;
 		subchannel = 0;
@@ -1741,11 +1741,11 @@ static int rtl8xxxu_identify_chip(struct rtl8xxxu_priv *priv)
 		case 3:
 			priv->ep_tx_low_queue = 1;
 			priv->ep_tx_count++;
-			/* fall through */
+			fallthrough;
 		case 2:
 			priv->ep_tx_normal_queue = 1;
 			priv->ep_tx_count++;
-			/* fall through */
+			fallthrough;
 		case 1:
 			priv->ep_tx_high_queue = 1;
 			priv->ep_tx_count++;
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2021-04-19 23:47 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-05  9:48 [PATCH RESEND][next] rtl8xxxu: Fix fall-through warnings for Clang Gustavo A. R. Silva
2021-03-05 13:40 ` Kalle Valo
2021-03-05 16:49   ` Gustavo A. R. Silva
2021-03-10 19:14   ` Kees Cook
2021-03-10 19:31     ` Jes Sorensen
2021-03-10 19:45       ` Kees Cook
2021-03-10 19:51         ` Jes Sorensen
2021-03-10 20:59           ` Kees Cook
2021-04-17 18:29             ` Jes Sorensen
2021-04-17 19:24               ` Gustavo A. R. Silva
2021-04-19 11:58                 ` Jes Sorensen
2021-03-11  7:00     ` Kalle Valo
2021-03-11  7:16       ` Gustavo A. R. Silva
2021-04-17 17:52 ` Kalle Valo
     [not found] ` <20210417175201.2D5A7C433F1@smtp.codeaurora.org>
2021-04-17 18:30   ` Jes Sorensen
2021-04-18  0:09     ` Joe Perches
2021-04-19 11:56       ` Jes Sorensen
     [not found] ` <20210417175201.280F9C4338A@smtp.codeaurora.org>
2021-04-19 22:58   ` Gustavo A. R. Silva

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.