netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][next] mwifiex: Fix fall-through warnings for Clang
@ 2020-11-17 16:09 Gustavo A. R. Silva
  2020-11-17 16:15 ` Joe Perches
  2020-11-24 15:06 ` Kalle Valo
  0 siblings, 2 replies; 5+ messages in thread
From: Gustavo A. R. Silva @ 2020-11-17 16:09 UTC (permalink / raw)
  To: Amitkumar Karwar, Ganapathi Bhat, Xinming Hu, 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 explicitly adding multiple break statements instead of
letting the code fall through to the next case.

Link: https://github.com/KSPP/linux/issues/115
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
---
 drivers/net/wireless/marvell/mwifiex/sta_cmdresp.c | 2 ++
 drivers/net/wireless/marvell/mwifiex/sta_event.c   | 1 +
 drivers/net/wireless/marvell/mwifiex/uap_cmd.c     | 1 +
 drivers/net/wireless/marvell/mwifiex/wmm.c         | 1 +
 4 files changed, 5 insertions(+)

diff --git a/drivers/net/wireless/marvell/mwifiex/sta_cmdresp.c b/drivers/net/wireless/marvell/mwifiex/sta_cmdresp.c
index 119ccacd1fcc..6b5d35d9e69f 100644
--- a/drivers/net/wireless/marvell/mwifiex/sta_cmdresp.c
+++ b/drivers/net/wireless/marvell/mwifiex/sta_cmdresp.c
@@ -201,6 +201,7 @@ static int mwifiex_ret_802_11_snmp_mib(struct mwifiex_private *priv,
 			mwifiex_dbg(priv->adapter, INFO,
 				    "info: SNMP_RESP: DTIM period=%u\n",
 				    ul_temp);
+			break;
 		default:
 			break;
 		}
@@ -1393,6 +1394,7 @@ int mwifiex_process_sta_cmdresp(struct mwifiex_private *priv, u16 cmdresp_no,
 		break;
 	case HostCmd_CMD_TDLS_OPER:
 		ret = mwifiex_ret_tdls_oper(priv, resp);
+		break;
 	case HostCmd_CMD_MC_POLICY:
 		break;
 	case HostCmd_CMD_CHAN_REPORT_REQUEST:
diff --git a/drivers/net/wireless/marvell/mwifiex/sta_event.c b/drivers/net/wireless/marvell/mwifiex/sta_event.c
index bc79ca4cb803..68c63268e2e6 100644
--- a/drivers/net/wireless/marvell/mwifiex/sta_event.c
+++ b/drivers/net/wireless/marvell/mwifiex/sta_event.c
@@ -99,6 +99,7 @@ static int mwifiex_check_ibss_peer_capabilities(struct mwifiex_private *priv,
 			case IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_3895:
 				sta_ptr->max_amsdu =
 					MWIFIEX_TX_DATA_BUF_SIZE_4K;
+				break;
 			default:
 				break;
 			}
diff --git a/drivers/net/wireless/marvell/mwifiex/uap_cmd.c b/drivers/net/wireless/marvell/mwifiex/uap_cmd.c
index b48a85d791f6..18e89777b784 100644
--- a/drivers/net/wireless/marvell/mwifiex/uap_cmd.c
+++ b/drivers/net/wireless/marvell/mwifiex/uap_cmd.c
@@ -108,6 +108,7 @@ int mwifiex_set_secure_params(struct mwifiex_private *priv,
 			if (params->crypto.wpa_versions & NL80211_WPA_VERSION_2)
 				bss_config->wpa_cfg.pairwise_cipher_wpa2 |=
 								CIPHER_AES_CCMP;
+			break;
 		default:
 			break;
 		}
diff --git a/drivers/net/wireless/marvell/mwifiex/wmm.c b/drivers/net/wireless/marvell/mwifiex/wmm.c
index b8f19ca73414..0b375608df7d 100644
--- a/drivers/net/wireless/marvell/mwifiex/wmm.c
+++ b/drivers/net/wireless/marvell/mwifiex/wmm.c
@@ -1396,6 +1396,7 @@ mwifiex_send_processed_packet(struct mwifiex_private *priv,
 		break;
 	case 0:
 		mwifiex_write_data_complete(adapter, skb, 0, ret);
+		break;
 	default:
 		break;
 	}
-- 
2.27.0


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

* Re: [PATCH][next] mwifiex: Fix fall-through warnings for Clang
  2020-11-17 16:09 [PATCH][next] mwifiex: Fix fall-through warnings for Clang Gustavo A. R. Silva
@ 2020-11-17 16:15 ` Joe Perches
  2020-11-17 16:32   ` Gustavo A. R. Silva
  2020-11-24 15:06 ` Kalle Valo
  1 sibling, 1 reply; 5+ messages in thread
From: Joe Perches @ 2020-11-17 16:15 UTC (permalink / raw)
  To: Gustavo A. R. Silva, Amitkumar Karwar, Ganapathi Bhat,
	Xinming Hu, Kalle Valo, David S. Miller, Jakub Kicinski
  Cc: linux-wireless, netdev, linux-kernel, linux-hardening

On Tue, 2020-11-17 at 10:09 -0600, Gustavo A. R. Silva wrote:
> In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple
> warnings by explicitly adding multiple break statements instead of
> letting the code fall through to the next case.

Thanks Gustavo.

I think this is better style than the gcc allowed
undescribed fallthrough to break;

gcc developers disagree though:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91432



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

* Re: [PATCH][next] mwifiex: Fix fall-through warnings for Clang
  2020-11-17 16:15 ` Joe Perches
@ 2020-11-17 16:32   ` Gustavo A. R. Silva
  0 siblings, 0 replies; 5+ messages in thread
From: Gustavo A. R. Silva @ 2020-11-17 16:32 UTC (permalink / raw)
  To: Joe Perches
  Cc: Amitkumar Karwar, Ganapathi Bhat, Xinming Hu, Kalle Valo,
	David S. Miller, Jakub Kicinski, linux-wireless, netdev,
	linux-kernel, linux-hardening

On Tue, Nov 17, 2020 at 08:15:59AM -0800, Joe Perches wrote:
> On Tue, 2020-11-17 at 10:09 -0600, Gustavo A. R. Silva wrote:
> > In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple
> > warnings by explicitly adding multiple break statements instead of
> > letting the code fall through to the next case.
> 
> Thanks Gustavo.
> 
> I think this is better style than the gcc allowed
> undescribed fallthrough to break;
> 
> gcc developers disagree though:
> 
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91432

Yeah; I mention that in this[1] changelog text, together with the
reasons why we think the Clang approach is safer. which is exactly
the same information contained in the link[2] included in the changelog
text for this commit.

--
Gustavo

[1] https://git.kernel.org/linus/4169e889e5889405d54cec27d6e9f7f0ce3c7096
[2] https://github.com/KSPP/linux/issues/115

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

* Re: [PATCH][next] mwifiex: Fix fall-through warnings for Clang
  2020-11-17 16:09 [PATCH][next] mwifiex: Fix fall-through warnings for Clang Gustavo A. R. Silva
  2020-11-17 16:15 ` Joe Perches
@ 2020-11-24 15:06 ` Kalle Valo
  2020-11-24 15:22   ` Gustavo A. R. Silva
  1 sibling, 1 reply; 5+ messages in thread
From: Kalle Valo @ 2020-11-24 15:06 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: Amitkumar Karwar, Ganapathi Bhat, Xinming Hu, David S. Miller,
	Jakub Kicinski, linux-wireless, netdev, linux-kernel,
	Gustavo A. R. Silva, linux-hardening

"Gustavo A. R. Silva" <gustavoars@kernel.org> wrote:

> In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple
> warnings by explicitly adding multiple break statements instead of
> letting the code fall through to the next case.
> 
> Link: https://github.com/KSPP/linux/issues/115
> Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>

Patch applied to wireless-drivers-next.git, thanks.

003317581372 mwifiex: Fix fall-through warnings for Clang

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20201117160958.GA18807@embeddedor/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


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

* Re: [PATCH][next] mwifiex: Fix fall-through warnings for Clang
  2020-11-24 15:06 ` Kalle Valo
@ 2020-11-24 15:22   ` Gustavo A. R. Silva
  0 siblings, 0 replies; 5+ messages in thread
From: Gustavo A. R. Silva @ 2020-11-24 15:22 UTC (permalink / raw)
  To: Kalle Valo
  Cc: Amitkumar Karwar, Ganapathi Bhat, Xinming Hu, David S. Miller,
	Jakub Kicinski, linux-wireless, netdev, linux-kernel,
	linux-hardening

On Tue, Nov 24, 2020 at 03:06:14PM +0000, Kalle Valo wrote:
> "Gustavo A. R. Silva" <gustavoars@kernel.org> wrote:
> 
> > In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple
> > warnings by explicitly adding multiple break statements instead of
> > letting the code fall through to the next case.
> > 
> > Link: https://github.com/KSPP/linux/issues/115
> > Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
> 
> Patch applied to wireless-drivers-next.git, thanks.
> 
> 003317581372 mwifiex: Fix fall-through warnings for Clang

Thank you, Kalle.
--
Gustavo

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

end of thread, other threads:[~2020-11-24 15:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-17 16:09 [PATCH][next] mwifiex: Fix fall-through warnings for Clang Gustavo A. R. Silva
2020-11-17 16:15 ` Joe Perches
2020-11-17 16:32   ` Gustavo A. R. Silva
2020-11-24 15:06 ` Kalle Valo
2020-11-24 15:22   ` Gustavo A. R. Silva

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).