linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/20] mark expected switch fall-throughs
@ 2017-10-12 16:15 Gustavo A. R. Silva
  2017-10-12 16:15 ` [PATCH 01/20] staging: ks7010: ks_wlan_net: " Gustavo A. R. Silva
                   ` (20 more replies)
  0 siblings, 21 replies; 34+ messages in thread
From: Gustavo A. R. Silva @ 2017-10-12 16:15 UTC (permalink / raw)
  To: linux-rpi-kernel, linux-arm-kernel, lustre-devel, devel, linux-kernel
  Cc: Oleg Drokin, Andreas Dilger, James Simmons, Greg Kroah-Hartman,
	Ian Abbott, H Hartley Sweeten, Eric Anholt, Stefan Wahren,
	Forest Bond, Gustavo A. R. Silva

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

In Kees Cook words:
"This is an unfortunate omission in the C language, and thankfully both
gcc and clang have stepped up to solve this the same way static
analyzers have solved it. It does both document the intention for
humans and provide a way for analyzers to report issues.

Having the compiler help us not make mistakes is quite handy."

In some cases there were "no break" or "fall thru" comments already
in place. So I replaced them with proper "fall through" comments, which
is what GCC is expecting to find.

For the rest of the cases, please double check if the actual intention
of the code is to fall through.

Thanks!

Gustavo A. R. Silva (20):
  staging: ks7010: ks_wlan_net: mark expected switch fall-throughs
  staging: lustre: lnet: socklnd: mark expected switch fall-through
  staging: rtl8192e: mark expected switch fall-through
  staging: rtl8723bs: rtw_mlme_ext: mark expected switch fall-through
  staging: lustre: lnet: net_fault: mark expected switch fall-through
  staging: comedi: s526: mark expected switch fall-through
  staging: rtl8188eu: usb_halinit: mark expected switch fall-through
  staging: vc04_services: vchiq_core: mark expected switch fall-through
  staging: vt6656: card: mark expected switch fall-throughs
  staging: rtl8188eu: usb_ops_linux: mark expected switch fall-through
  staging: r8822be: mark expected switch fall-throughs
  staging: lustre: lnet: selftest: mark expected switch fall-through
  staging: rtlwifi: halmac: mark expected switch fall-through
  staging: lustre: lnet: selftest: mark expected switch fall-throughs
  staging: lustre: llite: mark expected switch fall-through
  staging: lustre: lprocfs: mark expected switch fall-throughs
  staging: lustre: ldlm: mark expected switch fall-through
  staging: lustre: osc: mark expected switch fall-through
  staging: lustre: ptlrpc: mark expected switch fall-throughs
  staging: lustre: rpc: mark expected switch fall-throughs

 drivers/staging/comedi/drivers/s526.c                       |  5 ++---
 drivers/staging/ks7010/ks_wlan_net.c                        | 10 ++++++++++
 drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c         |  2 +-
 drivers/staging/lustre/lnet/lnet/net_fault.c                |  1 +
 drivers/staging/lustre/lnet/selftest/conctl.c               |  1 +
 drivers/staging/lustre/lnet/selftest/module.c               |  5 ++++-
 drivers/staging/lustre/lnet/selftest/rpc.c                  | 13 +++++++++----
 drivers/staging/lustre/lustre/ldlm/ldlm_request.c           |  1 +
 drivers/staging/lustre/lustre/llite/namei.c                 |  4 +++-
 drivers/staging/lustre/lustre/obdclass/lprocfs_status.c     |  4 ++++
 drivers/staging/lustre/lustre/osc/osc_cache.c               |  1 +
 drivers/staging/lustre/lustre/ptlrpc/pack_generic.c         |  6 +++---
 drivers/staging/rtl8188eu/hal/usb_halinit.c                 |  1 +
 drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c            |  1 +
 drivers/staging/rtl8192e/rtllib_wx.c                        |  3 +--
 drivers/staging/rtl8723bs/core/rtw_mlme_ext.c               |  2 +-
 .../staging/rtlwifi/halmac/halmac_88xx/halmac_api_88xx.c    |  2 ++
 drivers/staging/rtlwifi/halmac/rtl_halmac.c                 |  2 +-
 .../staging/vc04_services/interface/vchiq_arm/vchiq_core.c  |  3 +--
 drivers/staging/vt6656/card.c                               |  2 ++
 20 files changed, 50 insertions(+), 19 deletions(-)

-- 
2.7.4

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

* [PATCH 01/20] staging: ks7010: ks_wlan_net: mark expected switch fall-throughs
  2017-10-12 16:15 [PATCH 00/20] mark expected switch fall-throughs Gustavo A. R. Silva
@ 2017-10-12 16:15 ` Gustavo A. R. Silva
  2017-10-12 16:16 ` [PATCH 02/20] staging: lustre: lnet: socklnd: mark expected switch fall-through Gustavo A. R. Silva
                   ` (19 subsequent siblings)
  20 siblings, 0 replies; 34+ messages in thread
From: Gustavo A. R. Silva @ 2017-10-12 16:15 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: devel, linux-kernel, Gustavo A. R. Silva

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

Addresses-Coverity-ID: 1364489
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
---
 drivers/staging/ks7010/ks_wlan_net.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/staging/ks7010/ks_wlan_net.c b/drivers/staging/ks7010/ks_wlan_net.c
index 0f9348b..b82b515 100644
--- a/drivers/staging/ks7010/ks_wlan_net.c
+++ b/drivers/staging/ks7010/ks_wlan_net.c
@@ -473,13 +473,16 @@ static int ks_wlan_set_rate(struct net_device *dev,
 					priv->reg.rate_set.body[3] =
 					    TX_RATE_11M;
 					i++;
+					/* fall through */
 				case 5500000:
 					priv->reg.rate_set.body[2] = TX_RATE_5M;
 					i++;
+					/* fall through */
 				case 2000000:
 					priv->reg.rate_set.body[1] =
 					    TX_RATE_2M | BASIC_RATE;
 					i++;
+					/* fall through */
 				case 1000000:
 					priv->reg.rate_set.body[0] =
 					    TX_RATE_1M | BASIC_RATE;
@@ -535,14 +538,17 @@ static int ks_wlan_set_rate(struct net_device *dev,
 					priv->reg.rate_set.body[11] =
 					    TX_RATE_54M;
 					i++;
+					/* fall through */
 				case 48000000:
 					priv->reg.rate_set.body[10] =
 					    TX_RATE_48M;
 					i++;
+					/* fall through */
 				case 36000000:
 					priv->reg.rate_set.body[9] =
 					    TX_RATE_36M;
 					i++;
+					/* fall through */
 				case 24000000:
 				case 18000000:
 				case 12000000:
@@ -619,14 +625,17 @@ static int ks_wlan_set_rate(struct net_device *dev,
 						    TX_RATE_6M | BASIC_RATE;
 						i++;
 					}
+					/* fall through */
 				case 5500000:
 					priv->reg.rate_set.body[2] =
 					    TX_RATE_5M | BASIC_RATE;
 					i++;
+					/* fall through */
 				case 2000000:
 					priv->reg.rate_set.body[1] =
 					    TX_RATE_2M | BASIC_RATE;
 					i++;
+					/* fall through */
 				case 1000000:
 					priv->reg.rate_set.body[0] =
 					    TX_RATE_1M | BASIC_RATE;
@@ -2010,6 +2019,7 @@ static int ks_wlan_set_mlme(struct net_device *dev,
 	case IW_MLME_DEAUTH:
 		if (mlme->reason_code == WLAN_REASON_MIC_FAILURE)
 			return 0;
+		/* fall through */
 	case IW_MLME_DISASSOC:
 		mode = 1;
 		return ks_wlan_set_stop_request(dev, NULL, &mode, NULL);
-- 
2.7.4

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

* [PATCH 02/20] staging: lustre: lnet: socklnd: mark expected switch fall-through
  2017-10-12 16:15 [PATCH 00/20] mark expected switch fall-throughs Gustavo A. R. Silva
  2017-10-12 16:15 ` [PATCH 01/20] staging: ks7010: ks_wlan_net: " Gustavo A. R. Silva
@ 2017-10-12 16:16 ` Gustavo A. R. Silva
  2017-10-17 22:56   ` Dilger, Andreas
  2017-10-12 16:16 ` [PATCH 03/20] staging: rtl8192e: " Gustavo A. R. Silva
                   ` (18 subsequent siblings)
  20 siblings, 1 reply; 34+ messages in thread
From: Gustavo A. R. Silva @ 2017-10-12 16:16 UTC (permalink / raw)
  To: Oleg Drokin, Andreas Dilger, James Simmons, Greg Kroah-Hartman
  Cc: lustre-devel, devel, linux-kernel, Gustavo A. R. Silva

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

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
---
 drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c
index d0ee58d..7b014ca 100644
--- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c
+++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c
@@ -2308,7 +2308,7 @@ ksocknal_base_shutdown(void)
 	switch (ksocknal_data.ksnd_init) {
 	default:
 		LASSERT(0);
-
+		/* fall through */
 	case SOCKNAL_INIT_ALL:
 	case SOCKNAL_INIT_DATA:
 		LASSERT(ksocknal_data.ksnd_peers);
-- 
2.7.4

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

* [PATCH 03/20] staging: rtl8192e: mark expected switch fall-through
  2017-10-12 16:15 [PATCH 00/20] mark expected switch fall-throughs Gustavo A. R. Silva
  2017-10-12 16:15 ` [PATCH 01/20] staging: ks7010: ks_wlan_net: " Gustavo A. R. Silva
  2017-10-12 16:16 ` [PATCH 02/20] staging: lustre: lnet: socklnd: mark expected switch fall-through Gustavo A. R. Silva
@ 2017-10-12 16:16 ` Gustavo A. R. Silva
  2017-10-12 16:16 ` [PATCH 04/20] staging: rtl8723bs: rtw_mlme_ext: " Gustavo A. R. Silva
                   ` (17 subsequent siblings)
  20 siblings, 0 replies; 34+ messages in thread
From: Gustavo A. R. Silva @ 2017-10-12 16:16 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: devel, linux-kernel, Gustavo A. R. Silva

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

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
---
 drivers/staging/rtl8192e/rtllib_wx.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtllib_wx.c b/drivers/staging/rtl8192e/rtllib_wx.c
index f7eba01..03fbff0 100644
--- a/drivers/staging/rtl8192e/rtllib_wx.c
+++ b/drivers/staging/rtl8192e/rtllib_wx.c
@@ -694,8 +694,7 @@ int rtllib_wx_set_mlme(struct rtllib_device *ieee,
 	switch (mlme->cmd) {
 	case IW_MLME_DEAUTH:
 		deauth = true;
-		/* leave break out intentionly */
-
+		/* fall through */
 	case IW_MLME_DISASSOC:
 		if (deauth)
 			netdev_info(ieee->dev, "disauth packet !\n");
-- 
2.7.4

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

* [PATCH 04/20] staging: rtl8723bs: rtw_mlme_ext: mark expected switch fall-through
  2017-10-12 16:15 [PATCH 00/20] mark expected switch fall-throughs Gustavo A. R. Silva
                   ` (2 preceding siblings ...)
  2017-10-12 16:16 ` [PATCH 03/20] staging: rtl8192e: " Gustavo A. R. Silva
@ 2017-10-12 16:16 ` Gustavo A. R. Silva
  2017-10-12 16:16 ` [PATCH 05/20] staging: lustre: lnet: net_fault: " Gustavo A. R. Silva
                   ` (16 subsequent siblings)
  20 siblings, 0 replies; 34+ messages in thread
From: Gustavo A. R. Silva @ 2017-10-12 16:16 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: devel, linux-kernel, Gustavo A. R. Silva

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

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
---
 drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
index 355ce9b..66127d1 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
@@ -584,7 +584,7 @@ void mgt_dispatcher(struct adapter *padapter, union recv_frame *precv_frame)
 			ptable->func = &OnAuth;
 		else
 			ptable->func = &OnAuthClient;
-		/* pass through */
+		/* fall through */
 	case WIFI_ASSOCREQ:
 	case WIFI_REASSOCREQ:
 		_mgt_dispatcher(padapter, ptable, precv_frame);
-- 
2.7.4

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

* [PATCH 05/20] staging: lustre: lnet: net_fault: mark expected switch fall-through
  2017-10-12 16:15 [PATCH 00/20] mark expected switch fall-throughs Gustavo A. R. Silva
                   ` (3 preceding siblings ...)
  2017-10-12 16:16 ` [PATCH 04/20] staging: rtl8723bs: rtw_mlme_ext: " Gustavo A. R. Silva
@ 2017-10-12 16:16 ` Gustavo A. R. Silva
  2017-10-17 22:57   ` Dilger, Andreas
  2017-10-12 16:16 ` [PATCH 06/20] staging: comedi: s526: " Gustavo A. R. Silva
                   ` (15 subsequent siblings)
  20 siblings, 1 reply; 34+ messages in thread
From: Gustavo A. R. Silva @ 2017-10-12 16:16 UTC (permalink / raw)
  To: Oleg Drokin, Andreas Dilger, James Simmons, Greg Kroah-Hartman
  Cc: lustre-devel, devel, linux-kernel, Gustavo A. R. Silva

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

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
---
 drivers/staging/lustre/lnet/lnet/net_fault.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/lustre/lnet/lnet/net_fault.c b/drivers/staging/lustre/lnet/lnet/net_fault.c
index 03f3d18..7391e16 100644
--- a/drivers/staging/lustre/lnet/lnet/net_fault.c
+++ b/drivers/staging/lustre/lnet/lnet/net_fault.c
@@ -629,6 +629,7 @@ delayed_msg_process(struct list_head *msg_list, bool drop)
 			case LNET_CREDIT_OK:
 				lnet_ni_recv(ni, msg->msg_private, msg, 0,
 					     0, msg->msg_len, msg->msg_len);
+				/* fall through */
 			case LNET_CREDIT_WAIT:
 				continue;
 			default: /* failures */
-- 
2.7.4

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

* [PATCH 06/20] staging: comedi: s526: mark expected switch fall-through
  2017-10-12 16:15 [PATCH 00/20] mark expected switch fall-throughs Gustavo A. R. Silva
                   ` (4 preceding siblings ...)
  2017-10-12 16:16 ` [PATCH 05/20] staging: lustre: lnet: net_fault: " Gustavo A. R. Silva
@ 2017-10-12 16:16 ` Gustavo A. R. Silva
  2017-10-12 16:16 ` [PATCH 07/20] staging: rtl8188eu: usb_halinit: " Gustavo A. R. Silva
                   ` (14 subsequent siblings)
  20 siblings, 0 replies; 34+ messages in thread
From: Gustavo A. R. Silva @ 2017-10-12 16:16 UTC (permalink / raw)
  To: Ian Abbott, H Hartley Sweeten, Greg Kroah-Hartman
  Cc: devel, linux-kernel, Gustavo A. R. Silva

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

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
---
 drivers/staging/comedi/drivers/s526.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/comedi/drivers/s526.c b/drivers/staging/comedi/drivers/s526.c
index c80527d..e620f6a 100644
--- a/drivers/staging/comedi/drivers/s526.c
+++ b/drivers/staging/comedi/drivers/s526.c
@@ -408,9 +408,8 @@ static int s526_gpct_winsn(struct comedi_device *dev,
 		 */
 		if ((data[1] <= data[0]) || !data[0])
 			return -EINVAL;
-
-		/* Fall thru to write the PULSE_WIDTH */
-
+		/* to write the PULSE_WIDTH */
+		/* fall through */
 	case INSN_CONFIG_GPCT_QUADRATURE_ENCODER:
 	case INSN_CONFIG_GPCT_SINGLE_PULSE_GENERATOR:
 		s526_gpct_write(dev, chan, data[0]);
-- 
2.7.4

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

* [PATCH 07/20] staging: rtl8188eu: usb_halinit: mark expected switch fall-through
  2017-10-12 16:15 [PATCH 00/20] mark expected switch fall-throughs Gustavo A. R. Silva
                   ` (5 preceding siblings ...)
  2017-10-12 16:16 ` [PATCH 06/20] staging: comedi: s526: " Gustavo A. R. Silva
@ 2017-10-12 16:16 ` Gustavo A. R. Silva
  2017-10-12 16:16 ` [PATCH 08/20] staging: vc04_services: vchiq_core: " Gustavo A. R. Silva
                   ` (13 subsequent siblings)
  20 siblings, 0 replies; 34+ messages in thread
From: Gustavo A. R. Silva @ 2017-10-12 16:16 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: devel, linux-kernel, Gustavo A. R. Silva

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

Addresses-Coverity-ID: 1373894
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
---
 drivers/staging/rtl8188eu/hal/usb_halinit.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/rtl8188eu/hal/usb_halinit.c b/drivers/staging/rtl8188eu/hal/usb_halinit.c
index 674ac53..17967c9 100644
--- a/drivers/staging/rtl8188eu/hal/usb_halinit.c
+++ b/drivers/staging/rtl8188eu/hal/usb_halinit.c
@@ -1745,6 +1745,7 @@ void rtw_hal_get_hwreg(struct adapter *Adapter, u8 variable, u8 *val)
 	switch (variable) {
 	case HW_VAR_BASIC_RATE:
 		*((u16 *)(val)) = Adapter->HalData->BasicRateSet;
+		/* fall through */
 	case HW_VAR_TXPAUSE:
 		val[0] = usb_read8(Adapter, REG_TXPAUSE);
 		break;
-- 
2.7.4

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

* [PATCH 08/20] staging: vc04_services: vchiq_core: mark expected switch fall-through
  2017-10-12 16:15 [PATCH 00/20] mark expected switch fall-throughs Gustavo A. R. Silva
                   ` (6 preceding siblings ...)
  2017-10-12 16:16 ` [PATCH 07/20] staging: rtl8188eu: usb_halinit: " Gustavo A. R. Silva
@ 2017-10-12 16:16 ` Gustavo A. R. Silva
  2017-10-12 17:29   ` Stefan Wahren
  2017-10-12 16:16 ` [PATCH 09/20] staging: vt6656: card: mark expected switch fall-throughs Gustavo A. R. Silva
                   ` (12 subsequent siblings)
  20 siblings, 1 reply; 34+ messages in thread
From: Gustavo A. R. Silva @ 2017-10-12 16:16 UTC (permalink / raw)
  To: Eric Anholt, Stefan Wahren, Greg Kroah-Hartman
  Cc: linux-rpi-kernel, linux-arm-kernel, devel, linux-kernel,
	Gustavo A. R. Silva

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

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
---
 drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c
index c3bb8e0..ecff92b 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c
@@ -2951,8 +2951,7 @@ vchiq_close_service_internal(VCHIQ_SERVICE_T *service, int close_recvd)
 
 	case VCHIQ_SRVSTATE_OPENSYNC:
 		mutex_lock(&state->sync_mutex);
-		/* Drop through */
-
+		/* fall through */
 	case VCHIQ_SRVSTATE_OPEN:
 		if (state->is_master || close_recvd) {
 			if (!do_abort_bulks(service))
-- 
2.7.4

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

* [PATCH 09/20] staging: vt6656: card: mark expected switch fall-throughs
  2017-10-12 16:15 [PATCH 00/20] mark expected switch fall-throughs Gustavo A. R. Silva
                   ` (7 preceding siblings ...)
  2017-10-12 16:16 ` [PATCH 08/20] staging: vc04_services: vchiq_core: " Gustavo A. R. Silva
@ 2017-10-12 16:16 ` Gustavo A. R. Silva
  2017-10-12 16:16 ` [PATCH 10/20] staging: rtl8188eu: usb_ops_linux: mark expected switch fall-through Gustavo A. R. Silva
                   ` (11 subsequent siblings)
  20 siblings, 0 replies; 34+ messages in thread
From: Gustavo A. R. Silva @ 2017-10-12 16:16 UTC (permalink / raw)
  To: Forest Bond, Greg Kroah-Hartman; +Cc: devel, linux-kernel, Gustavo A. R. Silva

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

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
---
 drivers/staging/vt6656/card.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/staging/vt6656/card.c b/drivers/staging/vt6656/card.c
index c61422e..4fd9cd6 100644
--- a/drivers/staging/vt6656/card.c
+++ b/drivers/staging/vt6656/card.c
@@ -382,11 +382,13 @@ void vnt_update_ifs(struct vnt_private *priv)
 			priv->difs -= 1;
 			break;
 		}
+		/* fall through */
 	case RF_AIROHA7230:
 	case RF_AL2230:
 	case RF_AL2230S:
 		if (priv->bb_type != BB_TYPE_11B)
 			break;
+		/* fall through */
 	case RF_RFMD2959:
 	case RF_VT3226:
 	case RF_VT3342A0:
-- 
2.7.4

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

* [PATCH 10/20] staging: rtl8188eu: usb_ops_linux: mark expected switch fall-through
  2017-10-12 16:15 [PATCH 00/20] mark expected switch fall-throughs Gustavo A. R. Silva
                   ` (8 preceding siblings ...)
  2017-10-12 16:16 ` [PATCH 09/20] staging: vt6656: card: mark expected switch fall-throughs Gustavo A. R. Silva
@ 2017-10-12 16:16 ` Gustavo A. R. Silva
  2017-10-12 16:17 ` [PATCH 11/20] staging: r8822be: mark expected switch fall-throughs Gustavo A. R. Silva
                   ` (10 subsequent siblings)
  20 siblings, 0 replies; 34+ messages in thread
From: Gustavo A. R. Silva @ 2017-10-12 16:16 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: devel, linux-kernel, Gustavo A. R. Silva

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

Addresses-Coverity-ID: 1077613
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
---
 drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c b/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
index 64397b6..7e75030 100644
--- a/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
+++ b/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
@@ -407,6 +407,7 @@ static void usb_read_port_complete(struct urb *purb, struct pt_regs *regs)
 		case -ENODEV:
 		case -ESHUTDOWN:
 			adapt->bSurpriseRemoved = true;
+			/* fall through */
 		case -ENOENT:
 			adapt->bDriverStopped = true;
 			RT_TRACE(_module_hci_ops_os_c_, _drv_err_, ("usb_read_port_complete:bDriverStopped=true\n"));
-- 
2.7.4

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

* [PATCH 11/20] staging: r8822be: mark expected switch fall-throughs
  2017-10-12 16:15 [PATCH 00/20] mark expected switch fall-throughs Gustavo A. R. Silva
                   ` (9 preceding siblings ...)
  2017-10-12 16:16 ` [PATCH 10/20] staging: rtl8188eu: usb_ops_linux: mark expected switch fall-through Gustavo A. R. Silva
@ 2017-10-12 16:17 ` Gustavo A. R. Silva
  2017-10-12 16:17 ` [PATCH 12/20] staging: lustre: lnet: selftest: mark expected switch fall-through Gustavo A. R. Silva
                   ` (9 subsequent siblings)
  20 siblings, 0 replies; 34+ messages in thread
From: Gustavo A. R. Silva @ 2017-10-12 16:17 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: devel, linux-kernel, Gustavo A. R. Silva

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

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
---
 drivers/staging/rtlwifi/halmac/halmac_88xx/halmac_api_88xx.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/staging/rtlwifi/halmac/halmac_88xx/halmac_api_88xx.c b/drivers/staging/rtlwifi/halmac/halmac_88xx/halmac_api_88xx.c
index edbf6af..448b137 100644
--- a/drivers/staging/rtlwifi/halmac/halmac_88xx/halmac_api_88xx.c
+++ b/drivers/staging/rtlwifi/halmac/halmac_88xx/halmac_api_88xx.c
@@ -3391,8 +3391,10 @@ halmac_cfg_txbf_88xx(struct halmac_adapter *halmac_adapter, u8 userid,
 		switch (bw) {
 		case HALMAC_BW_80:
 			temp42C |= BIT_R_TXBF0_80M;
+			/* fall through */
 		case HALMAC_BW_40:
 			temp42C |= BIT_R_TXBF0_40M;
+			/* fall through */
 		case HALMAC_BW_20:
 			temp42C |= BIT_R_TXBF0_20M;
 			break;
-- 
2.7.4

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

* [PATCH 12/20] staging: lustre: lnet: selftest: mark expected switch fall-through
  2017-10-12 16:15 [PATCH 00/20] mark expected switch fall-throughs Gustavo A. R. Silva
                   ` (10 preceding siblings ...)
  2017-10-12 16:17 ` [PATCH 11/20] staging: r8822be: mark expected switch fall-throughs Gustavo A. R. Silva
@ 2017-10-12 16:17 ` Gustavo A. R. Silva
  2017-10-17 23:05   ` Dilger, Andreas
  2017-10-12 16:17 ` [PATCH 13/20] staging: rtlwifi: halmac: " Gustavo A. R. Silva
                   ` (8 subsequent siblings)
  20 siblings, 1 reply; 34+ messages in thread
From: Gustavo A. R. Silva @ 2017-10-12 16:17 UTC (permalink / raw)
  To: Oleg Drokin, Andreas Dilger, James Simmons, Greg Kroah-Hartman
  Cc: lustre-devel, devel, linux-kernel, Gustavo A. R. Silva

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

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
---
 drivers/staging/lustre/lnet/selftest/conctl.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/lustre/lnet/selftest/conctl.c b/drivers/staging/lustre/lnet/selftest/conctl.c
index 9619ecb..551e921 100644
--- a/drivers/staging/lustre/lnet/selftest/conctl.c
+++ b/drivers/staging/lustre/lnet/selftest/conctl.c
@@ -151,6 +151,7 @@ lst_debug_ioctl(struct lstio_debug_args *args)
 
 	case LST_OPC_BATCHSRV:
 		client = 0;
+		/* fall through */
 	case LST_OPC_BATCHCLI:
 		if (!name)
 			goto out;
-- 
2.7.4

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

* [PATCH 13/20] staging: rtlwifi: halmac: mark expected switch fall-through
  2017-10-12 16:15 [PATCH 00/20] mark expected switch fall-throughs Gustavo A. R. Silva
                   ` (11 preceding siblings ...)
  2017-10-12 16:17 ` [PATCH 12/20] staging: lustre: lnet: selftest: mark expected switch fall-through Gustavo A. R. Silva
@ 2017-10-12 16:17 ` Gustavo A. R. Silva
  2017-10-12 16:17 ` [PATCH 14/20] staging: lustre: lnet: selftest: mark expected switch fall-throughs Gustavo A. R. Silva
                   ` (7 subsequent siblings)
  20 siblings, 0 replies; 34+ messages in thread
From: Gustavo A. R. Silva @ 2017-10-12 16:17 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: devel, linux-kernel, Gustavo A. R. Silva

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

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
---
 drivers/staging/rtlwifi/halmac/rtl_halmac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtlwifi/halmac/rtl_halmac.c b/drivers/staging/rtlwifi/halmac/rtl_halmac.c
index 6448a8b..66f0a6d 100644
--- a/drivers/staging/rtlwifi/halmac/rtl_halmac.c
+++ b/drivers/staging/rtlwifi/halmac/rtl_halmac.c
@@ -617,7 +617,7 @@ static int _send_general_info(struct rtl_priv *rtlpriv)
 		RT_TRACE(rtlpriv, COMP_HALMAC, DBG_WARNING,
 			 "%s: halmac_send_general_info() fail because fw not dl!\n",
 			 __func__);
-	/* fallthrough here */
+	/* fall through */
 	default:
 		return -1;
 	}
-- 
2.7.4

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

* [PATCH 14/20] staging: lustre: lnet: selftest: mark expected switch fall-throughs
  2017-10-12 16:15 [PATCH 00/20] mark expected switch fall-throughs Gustavo A. R. Silva
                   ` (12 preceding siblings ...)
  2017-10-12 16:17 ` [PATCH 13/20] staging: rtlwifi: halmac: " Gustavo A. R. Silva
@ 2017-10-12 16:17 ` Gustavo A. R. Silva
  2017-10-17 22:58   ` Dilger, Andreas
  2017-10-12 16:17 ` [PATCH 15/20] staging: lustre: llite: mark expected switch fall-through Gustavo A. R. Silva
                   ` (6 subsequent siblings)
  20 siblings, 1 reply; 34+ messages in thread
From: Gustavo A. R. Silva @ 2017-10-12 16:17 UTC (permalink / raw)
  To: Oleg Drokin, Andreas Dilger, James Simmons, Greg Kroah-Hartman
  Cc: lustre-devel, devel, linux-kernel, Gustavo A. R. Silva


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

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
---
 drivers/staging/lustre/lnet/selftest/module.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lnet/selftest/module.c b/drivers/staging/lustre/lnet/selftest/module.c
index b5d556f..fa1bccc 100644
--- a/drivers/staging/lustre/lnet/selftest/module.c
+++ b/drivers/staging/lustre/lnet/selftest/module.c
@@ -57,10 +57,13 @@ lnet_selftest_exit(void)
 	switch (lst_init_step) {
 	case LST_INIT_CONSOLE:
 		lstcon_console_fini();
+		/* fall through */
 	case LST_INIT_FW:
 		sfw_shutdown();
+		/* fall through */
 	case LST_INIT_RPC:
 		srpc_shutdown();
+		/* fall through */
 	case LST_INIT_WI_TEST:
 		for (i = 0;
 		     i < cfs_cpt_number(lnet_cpt_table()); i++) {
@@ -72,7 +75,7 @@ lnet_selftest_exit(void)
 			    sizeof(lst_sched_test[0]) *
 			    cfs_cpt_number(lnet_cpt_table()));
 		lst_sched_test = NULL;
-
+		/* fall through */
 	case LST_INIT_WI_SERIAL:
 		cfs_wi_sched_destroy(lst_sched_serial);
 		lst_sched_serial = NULL;
-- 
2.7.4

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

* [PATCH 15/20] staging: lustre: llite: mark expected switch fall-through
  2017-10-12 16:15 [PATCH 00/20] mark expected switch fall-throughs Gustavo A. R. Silva
                   ` (13 preceding siblings ...)
  2017-10-12 16:17 ` [PATCH 14/20] staging: lustre: lnet: selftest: mark expected switch fall-throughs Gustavo A. R. Silva
@ 2017-10-12 16:17 ` Gustavo A. R. Silva
  2017-10-17 23:00   ` Dilger, Andreas
  2017-10-12 16:17 ` [PATCH 16/20] staging: lustre: lprocfs: mark expected switch fall-throughs Gustavo A. R. Silva
                   ` (5 subsequent siblings)
  20 siblings, 1 reply; 34+ messages in thread
From: Gustavo A. R. Silva @ 2017-10-12 16:17 UTC (permalink / raw)
  To: Oleg Drokin, Andreas Dilger, James Simmons, Greg Kroah-Hartman
  Cc: lustre-devel, devel, linux-kernel, Gustavo A. R. Silva

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

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
---
 drivers/staging/lustre/lustre/llite/namei.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/llite/namei.c b/drivers/staging/lustre/lustre/llite/namei.c
index 5cc2b32..55e0d03 100644
--- a/drivers/staging/lustre/lustre/llite/namei.c
+++ b/drivers/staging/lustre/lustre/llite/namei.c
@@ -949,7 +949,9 @@ static int ll_mknod(struct inode *dir, struct dentry *dchild,
 
 	switch (mode & S_IFMT) {
 	case 0:
-		mode |= S_IFREG; /* for mode = 0 case, fallthrough */
+		mode |= S_IFREG;
+		/* for mode = 0 case */
+		/* fall through */
 	case S_IFREG:
 	case S_IFCHR:
 	case S_IFBLK:
-- 
2.7.4

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

* [PATCH 16/20] staging: lustre: lprocfs: mark expected switch fall-throughs
  2017-10-12 16:15 [PATCH 00/20] mark expected switch fall-throughs Gustavo A. R. Silva
                   ` (14 preceding siblings ...)
  2017-10-12 16:17 ` [PATCH 15/20] staging: lustre: llite: mark expected switch fall-through Gustavo A. R. Silva
@ 2017-10-12 16:17 ` Gustavo A. R. Silva
  2017-10-17 23:00   ` Dilger, Andreas
  2017-10-12 16:17 ` [PATCH 17/20] staging: lustre: ldlm: mark expected switch fall-through Gustavo A. R. Silva
                   ` (4 subsequent siblings)
  20 siblings, 1 reply; 34+ messages in thread
From: Gustavo A. R. Silva @ 2017-10-12 16:17 UTC (permalink / raw)
  To: Oleg Drokin, Andreas Dilger, James Simmons, Greg Kroah-Hartman
  Cc: lustre-devel, devel, linux-kernel, Gustavo A. R. Silva

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

Addresses-Coverity-ID: 1271166
Addresses-Coverity-ID: 1271167
Addresses-Coverity-ID: 1271168
Addresses-Coverity-ID: 1271169
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
---
 drivers/staging/lustre/lustre/obdclass/lprocfs_status.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
index e79485b..4ec582f 100644
--- a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
+++ b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
@@ -1507,12 +1507,16 @@ int lprocfs_write_frac_u64_helper(const char __user *buffer,
 		switch (tolower(*end)) {
 		case 'p':
 			units <<= 10;
+			/* fall through */
 		case 't':
 			units <<= 10;
+			/* fall through */
 		case 'g':
 			units <<= 10;
+			/* fall through */
 		case 'm':
 			units <<= 10;
+			/* fall through */
 		case 'k':
 			units <<= 10;
 		}
-- 
2.7.4

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

* [PATCH 17/20] staging: lustre: ldlm: mark expected switch fall-through
  2017-10-12 16:15 [PATCH 00/20] mark expected switch fall-throughs Gustavo A. R. Silva
                   ` (15 preceding siblings ...)
  2017-10-12 16:17 ` [PATCH 16/20] staging: lustre: lprocfs: mark expected switch fall-throughs Gustavo A. R. Silva
@ 2017-10-12 16:17 ` Gustavo A. R. Silva
  2017-10-17 23:01   ` Dilger, Andreas
  2017-10-12 16:17 ` [PATCH 18/20] staging: lustre: osc: " Gustavo A. R. Silva
                   ` (3 subsequent siblings)
  20 siblings, 1 reply; 34+ messages in thread
From: Gustavo A. R. Silva @ 2017-10-12 16:17 UTC (permalink / raw)
  To: Oleg Drokin, Andreas Dilger, James Simmons, Greg Kroah-Hartman
  Cc: lustre-devel, devel, linux-kernel, Gustavo A. R. Silva

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

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
---
 drivers/staging/lustre/lustre/ldlm/ldlm_request.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c
index f3bf238..6943987 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c
@@ -1175,6 +1175,7 @@ ldlm_cancel_no_wait_policy(struct ldlm_namespace *ns, struct ldlm_lock *lock,
 	case LDLM_IBITS:
 		if (ns->ns_cancel && ns->ns_cancel(lock) != 0)
 			break;
+		/* fall through */
 	default:
 		result = LDLM_POLICY_SKIP_LOCK;
 		lock_res_and_lock(lock);
-- 
2.7.4

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

* [PATCH 18/20] staging: lustre: osc: mark expected switch fall-through
  2017-10-12 16:15 [PATCH 00/20] mark expected switch fall-throughs Gustavo A. R. Silva
                   ` (16 preceding siblings ...)
  2017-10-12 16:17 ` [PATCH 17/20] staging: lustre: ldlm: mark expected switch fall-through Gustavo A. R. Silva
@ 2017-10-12 16:17 ` Gustavo A. R. Silva
  2017-10-17 23:03   ` Dilger, Andreas
  2017-10-12 16:17 ` [PATCH 19/20] staging: lustre: ptlrpc: mark expected switch fall-throughs Gustavo A. R. Silva
                   ` (2 subsequent siblings)
  20 siblings, 1 reply; 34+ messages in thread
From: Gustavo A. R. Silva @ 2017-10-12 16:17 UTC (permalink / raw)
  To: Oleg Drokin, Andreas Dilger, James Simmons, Greg Kroah-Hartman
  Cc: lustre-devel, devel, linux-kernel, Gustavo A. R. Silva

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

Addresses-Coverity-ID: 1077598
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
---
 drivers/staging/lustre/lustre/osc/osc_cache.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/lustre/lustre/osc/osc_cache.c b/drivers/staging/lustre/lustre/osc/osc_cache.c
index e1207c2..eab7759 100644
--- a/drivers/staging/lustre/lustre/osc/osc_cache.c
+++ b/drivers/staging/lustre/lustre/osc/osc_cache.c
@@ -227,6 +227,7 @@ static int osc_extent_sanity_check0(struct osc_extent *ext,
 			rc = 65;
 			goto out;
 		}
+		/* fall through */
 	default:
 		if (atomic_read(&ext->oe_users) > 0) {
 			rc = 70;
-- 
2.7.4

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

* [PATCH 19/20] staging: lustre: ptlrpc: mark expected switch fall-throughs
  2017-10-12 16:15 [PATCH 00/20] mark expected switch fall-throughs Gustavo A. R. Silva
                   ` (17 preceding siblings ...)
  2017-10-12 16:17 ` [PATCH 18/20] staging: lustre: osc: " Gustavo A. R. Silva
@ 2017-10-12 16:17 ` Gustavo A. R. Silva
  2017-10-17 23:04   ` Dilger, Andreas
  2017-10-12 16:17 ` [PATCH 20/20] staging: lustre: rpc: " Gustavo A. R. Silva
  2017-10-23 19:33 ` [PATCH 00/20] " Gustavo A. R. Silva
  20 siblings, 1 reply; 34+ messages in thread
From: Gustavo A. R. Silva @ 2017-10-12 16:17 UTC (permalink / raw)
  To: Oleg Drokin, Andreas Dilger, James Simmons, Greg Kroah-Hartman
  Cc: lustre-devel, devel, linux-kernel, Gustavo A. R. Silva

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

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
---
 drivers/staging/lustre/lustre/ptlrpc/pack_generic.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c b/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c
index aad4ff1..a3664c1 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c
@@ -786,7 +786,7 @@ __u32 lustre_msg_get_flags(struct lustre_msg *msg)
 
 		CERROR("invalid msg %p: no ptlrpc body!\n", msg);
 	}
-	/* no break */
+	/* fall through */
 	default:
 		/* flags might be printed in debug code while message
 		 * uninitialized
@@ -854,7 +854,7 @@ __u32 lustre_msg_get_op_flags(struct lustre_msg *msg)
 
 		CERROR("invalid msg %p: no ptlrpc body!\n", msg);
 	}
-	/* no break */
+	/* fall through */
 	default:
 		return 0;
 	}
@@ -1035,7 +1035,7 @@ int lustre_msg_get_status(struct lustre_msg *msg)
 
 		CERROR("invalid msg %p: no ptlrpc body!\n", msg);
 	}
-	/* no break */
+	/* fall through */
 	default:
 		/* status might be printed in debug code while message
 		 * uninitialized
-- 
2.7.4

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

* [PATCH 20/20] staging: lustre: rpc: mark expected switch fall-throughs
  2017-10-12 16:15 [PATCH 00/20] mark expected switch fall-throughs Gustavo A. R. Silva
                   ` (18 preceding siblings ...)
  2017-10-12 16:17 ` [PATCH 19/20] staging: lustre: ptlrpc: mark expected switch fall-throughs Gustavo A. R. Silva
@ 2017-10-12 16:17 ` Gustavo A. R. Silva
  2017-10-17 23:05   ` Dilger, Andreas
  2017-10-23 19:33 ` [PATCH 00/20] " Gustavo A. R. Silva
  20 siblings, 1 reply; 34+ messages in thread
From: Gustavo A. R. Silva @ 2017-10-12 16:17 UTC (permalink / raw)
  To: Oleg Drokin, Andreas Dilger, James Simmons, Greg Kroah-Hartman
  Cc: lustre-devel, devel, linux-kernel, Gustavo A. R. Silva

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

Addresses-Coverity-ID: 1077604
Addresses-Coverity-ID: 1077605
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
---
 drivers/staging/lustre/lnet/selftest/rpc.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/lustre/lnet/selftest/rpc.c b/drivers/staging/lustre/lnet/selftest/rpc.c
index 77c222c..74ef3c3 100644
--- a/drivers/staging/lustre/lnet/selftest/rpc.c
+++ b/drivers/staging/lustre/lnet/selftest/rpc.c
@@ -1037,6 +1037,7 @@ srpc_handle_rpc(struct swi_workitem *wi)
 			ev->ev_status = rc;
 		}
 	}
+		/* fall through */
 	case SWI_STATE_BULK_STARTED:
 		LASSERT(!rpc->srpc_bulk || ev->ev_fired);
 
@@ -1237,7 +1238,8 @@ srpc_send_rpc(struct swi_workitem *wi)
 			break;
 
 		wi->swi_state = SWI_STATE_REQUEST_SENT;
-		/* perhaps more events, fall thru */
+		/* perhaps more events */
+		/* fall through */
 	case SWI_STATE_REQUEST_SENT: {
 		enum srpc_msg_type type = srpc_service2reply(rpc->crpc_service);
 
@@ -1269,6 +1271,7 @@ srpc_send_rpc(struct swi_workitem *wi)
 
 		wi->swi_state = SWI_STATE_REPLY_RECEIVED;
 	}
+		/* fall through */
 	case SWI_STATE_REPLY_RECEIVED:
 		if (do_bulk && !rpc->crpc_bulkev.ev_fired)
 			break;
@@ -1448,6 +1451,7 @@ srpc_lnet_ev_handler(struct lnet_event *ev)
 			srpc_data.rpc_counters.rpcs_sent++;
 			spin_unlock(&srpc_data.rpc_glock);
 		}
+		/* fall through */
 	case SRPC_REPLY_RCVD:
 	case SRPC_BULK_REQ_RCVD:
 		crpc = rpcev->ev_data;
@@ -1570,7 +1574,7 @@ srpc_lnet_ev_handler(struct lnet_event *ev)
 
 		if (!ev->unlinked)
 			break; /* wait for final event */
-
+		/* fall through */
 	case SRPC_BULK_PUT_SENT:
 		if (!ev->status && ev->type != LNET_EVENT_UNLINK) {
 			spin_lock(&srpc_data.rpc_glock);
@@ -1582,6 +1586,7 @@ srpc_lnet_ev_handler(struct lnet_event *ev)
 
 			spin_unlock(&srpc_data.rpc_glock);
 		}
+		/* fall through */
 	case SRPC_REPLY_SENT:
 		srpc = rpcev->ev_data;
 		scd = srpc->srpc_scd;
@@ -1674,14 +1679,14 @@ srpc_shutdown(void)
 		spin_unlock(&srpc_data.rpc_glock);
 
 		stt_shutdown();
-
+		/* fall through */
 	case SRPC_STATE_EQ_INIT:
 		rc = LNetClearLazyPortal(SRPC_FRAMEWORK_REQUEST_PORTAL);
 		rc = LNetClearLazyPortal(SRPC_REQUEST_PORTAL);
 		LASSERT(!rc);
 		rc = LNetEQFree(srpc_data.rpc_lnet_eq);
 		LASSERT(!rc); /* the EQ should have no user by now */
-
+		/* fall through */
 	case SRPC_STATE_NI_INIT:
 		LNetNIFini();
 	}
-- 
2.7.4

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

* Re: [PATCH 08/20] staging: vc04_services: vchiq_core: mark expected switch fall-through
  2017-10-12 16:16 ` [PATCH 08/20] staging: vc04_services: vchiq_core: " Gustavo A. R. Silva
@ 2017-10-12 17:29   ` Stefan Wahren
  0 siblings, 0 replies; 34+ messages in thread
From: Stefan Wahren @ 2017-10-12 17:29 UTC (permalink / raw)
  To: Gustavo A. R. Silva, Eric Anholt, Greg Kroah-Hartman
  Cc: linux-kernel, devel, linux-rpi-kernel, linux-arm-kernel


> "Gustavo A. R. Silva" <garsilva@embeddedor.com> hat am 12. Oktober 2017 um 18:16 geschrieben:
> 
> 
> In preparation to enabling -Wimplicit-fallthrough, mark switch cases
> where we are expecting to fall through.
> 
> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
> ---
>  drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)

Acked-by: Stefan Wahren <stefan.wahren@i2se.com>

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

* Re: [PATCH 02/20] staging: lustre: lnet: socklnd: mark expected switch fall-through
  2017-10-12 16:16 ` [PATCH 02/20] staging: lustre: lnet: socklnd: mark expected switch fall-through Gustavo A. R. Silva
@ 2017-10-17 22:56   ` Dilger, Andreas
  0 siblings, 0 replies; 34+ messages in thread
From: Dilger, Andreas @ 2017-10-17 22:56 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: Drokin, Oleg, James Simmons, Greg Kroah-Hartman, lustre-devel,
	devel, linux-kernel

On Oct 12, 2017, at 10:16, Gustavo A. R. Silva <garsilva@embeddedor.com> wrote:
> 
> In preparation to enabling -Wimplicit-fallthrough, mark switch cases
> where we are expecting to fall through.
> 
> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>

This isn't strictly necessary, since LASSERT() never returns, but
not harmful either.

Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>

> ---
> drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c
> index d0ee58d..7b014ca 100644
> --- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c
> +++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c
> @@ -2308,7 +2308,7 @@ ksocknal_base_shutdown(void)
> 	switch (ksocknal_data.ksnd_init) {
> 	default:
> 		LASSERT(0);
> -
> +		/* fall through */
> 	case SOCKNAL_INIT_ALL:
> 	case SOCKNAL_INIT_DATA:
> 		LASSERT(ksocknal_data.ksnd_peers);
> -- 
> 2.7.4
> 

Cheers, Andreas
--
Andreas Dilger
Lustre Principal Architect
Intel Corporation

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

* Re: [PATCH 05/20] staging: lustre: lnet: net_fault: mark expected switch fall-through
  2017-10-12 16:16 ` [PATCH 05/20] staging: lustre: lnet: net_fault: " Gustavo A. R. Silva
@ 2017-10-17 22:57   ` Dilger, Andreas
  0 siblings, 0 replies; 34+ messages in thread
From: Dilger, Andreas @ 2017-10-17 22:57 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: Drokin, Oleg, James Simmons, Greg Kroah-Hartman,
	Lustre Development List, Shehata, Amir, devel,
	Linux Kernel Mailing List

On Oct 12, 2017, at 10:16, Gustavo A. R. Silva <garsilva@embeddedor.com> wrote:
> 
> In preparation to enabling -Wimplicit-fallthrough, mark switch cases
> where we are expecting to fall through.
> 
> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>

This could also just be "continue;", but doesn't appear harmful.

Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>

> ---
> drivers/staging/lustre/lnet/lnet/net_fault.c | 1 +
> 1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/staging/lustre/lnet/lnet/net_fault.c b/drivers/staging/lustre/lnet/lnet/net_fault.c
> index 03f3d18..7391e16 100644
> --- a/drivers/staging/lustre/lnet/lnet/net_fault.c
> +++ b/drivers/staging/lustre/lnet/lnet/net_fault.c
> @@ -629,6 +629,7 @@ delayed_msg_process(struct list_head *msg_list, bool drop)
> 			case LNET_CREDIT_OK:
> 				lnet_ni_recv(ni, msg->msg_private, msg, 0,
> 					     0, msg->msg_len, msg->msg_len);
> +				/* fall through */
> 			case LNET_CREDIT_WAIT:
> 				continue;
> 			default: /* failures */
> -- 
> 2.7.4
> 

Cheers, Andreas
--
Andreas Dilger
Lustre Principal Architect
Intel Corporation

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

* Re: [PATCH 14/20] staging: lustre: lnet: selftest: mark expected switch fall-throughs
  2017-10-12 16:17 ` [PATCH 14/20] staging: lustre: lnet: selftest: mark expected switch fall-throughs Gustavo A. R. Silva
@ 2017-10-17 22:58   ` Dilger, Andreas
  0 siblings, 0 replies; 34+ messages in thread
From: Dilger, Andreas @ 2017-10-17 22:58 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: Drokin, Oleg, James Simmons, Greg Kroah-Hartman,
	Lustre Development List, devel, Shehata, Amir,
	Linux Kernel Mailing List

On Oct 12, 2017, at 10:17, Gustavo A. R. Silva <garsilva@embeddedor.com> wrote:
> 
> 
> In preparation to enabling -Wimplicit-fallthrough, mark switch cases
> where we are expecting to fall through.
> 
> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>

Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>

> ---
> drivers/staging/lustre/lnet/selftest/module.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/lustre/lnet/selftest/module.c b/drivers/staging/lustre/lnet/selftest/module.c
> index b5d556f..fa1bccc 100644
> --- a/drivers/staging/lustre/lnet/selftest/module.c
> +++ b/drivers/staging/lustre/lnet/selftest/module.c
> @@ -57,10 +57,13 @@ lnet_selftest_exit(void)
> 	switch (lst_init_step) {
> 	case LST_INIT_CONSOLE:
> 		lstcon_console_fini();
> +		/* fall through */
> 	case LST_INIT_FW:
> 		sfw_shutdown();
> +		/* fall through */
> 	case LST_INIT_RPC:
> 		srpc_shutdown();
> +		/* fall through */
> 	case LST_INIT_WI_TEST:
> 		for (i = 0;
> 		     i < cfs_cpt_number(lnet_cpt_table()); i++) {
> @@ -72,7 +75,7 @@ lnet_selftest_exit(void)
> 			    sizeof(lst_sched_test[0]) *
> 			    cfs_cpt_number(lnet_cpt_table()));
> 		lst_sched_test = NULL;
> -
> +		/* fall through */
> 	case LST_INIT_WI_SERIAL:
> 		cfs_wi_sched_destroy(lst_sched_serial);
> 		lst_sched_serial = NULL;
> -- 
> 2.7.4
> 

Cheers, Andreas
--
Andreas Dilger
Lustre Principal Architect
Intel Corporation

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

* Re: [PATCH 15/20] staging: lustre: llite: mark expected switch fall-through
  2017-10-12 16:17 ` [PATCH 15/20] staging: lustre: llite: mark expected switch fall-through Gustavo A. R. Silva
@ 2017-10-17 23:00   ` Dilger, Andreas
  0 siblings, 0 replies; 34+ messages in thread
From: Dilger, Andreas @ 2017-10-17 23:00 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: Drokin, Oleg, James Simmons, Greg Kroah-Hartman, lustre-devel,
	devel, linux-kernel


> On Oct 12, 2017, at 10:17, Gustavo A. R. Silva <garsilva@embeddedor.com> wrote:
> 
> In preparation to enabling -Wimplicit-fallthrough, mark switch cases
> where we are expecting to fall through.
> 
> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>

Not sure why you moved the "for mode = 0" comment to a separate line?
Not the end of the world though.

Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>

> ---
> drivers/staging/lustre/lustre/llite/namei.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/lustre/lustre/llite/namei.c b/drivers/staging/lustre/lustre/llite/namei.c
> index 5cc2b32..55e0d03 100644
> --- a/drivers/staging/lustre/lustre/llite/namei.c
> +++ b/drivers/staging/lustre/lustre/llite/namei.c
> @@ -949,7 +949,9 @@ static int ll_mknod(struct inode *dir, struct dentry *dchild,
> 
> 	switch (mode & S_IFMT) {
> 	case 0:
> -		mode |= S_IFREG; /* for mode = 0 case, fallthrough */
> +		mode |= S_IFREG;
> +		/* for mode = 0 case */
> +		/* fall through */
> 	case S_IFREG:
> 	case S_IFCHR:
> 	case S_IFBLK:
> -- 
> 2.7.4
> 

Cheers, Andreas
--
Andreas Dilger
Lustre Principal Architect
Intel Corporation

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

* Re: [PATCH 16/20] staging: lustre: lprocfs: mark expected switch fall-throughs
  2017-10-12 16:17 ` [PATCH 16/20] staging: lustre: lprocfs: mark expected switch fall-throughs Gustavo A. R. Silva
@ 2017-10-17 23:00   ` Dilger, Andreas
  0 siblings, 0 replies; 34+ messages in thread
From: Dilger, Andreas @ 2017-10-17 23:00 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: Drokin, Oleg, James Simmons, Greg Kroah-Hartman, lustre-devel,
	devel, linux-kernel

On Oct 12, 2017, at 10:17, Gustavo A. R. Silva <garsilva@embeddedor.com> wrote:
> 
> In preparation to enabling -Wimplicit-fallthrough, mark switch cases
> where we are expecting to fall through.
> 
> Addresses-Coverity-ID: 1271166
> Addresses-Coverity-ID: 1271167
> Addresses-Coverity-ID: 1271168
> Addresses-Coverity-ID: 1271169
> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>

Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>

> ---
> drivers/staging/lustre/lustre/obdclass/lprocfs_status.c | 4 ++++
> 1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
> index e79485b..4ec582f 100644
> --- a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
> +++ b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
> @@ -1507,12 +1507,16 @@ int lprocfs_write_frac_u64_helper(const char __user *buffer,
> 		switch (tolower(*end)) {
> 		case 'p':
> 			units <<= 10;
> +			/* fall through */
> 		case 't':
> 			units <<= 10;
> +			/* fall through */
> 		case 'g':
> 			units <<= 10;
> +			/* fall through */
> 		case 'm':
> 			units <<= 10;
> +			/* fall through */
> 		case 'k':
> 			units <<= 10;
> 		}
> -- 
> 2.7.4
> 

Cheers, Andreas
--
Andreas Dilger
Lustre Principal Architect
Intel Corporation

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

* Re: [PATCH 17/20] staging: lustre: ldlm: mark expected switch fall-through
  2017-10-12 16:17 ` [PATCH 17/20] staging: lustre: ldlm: mark expected switch fall-through Gustavo A. R. Silva
@ 2017-10-17 23:01   ` Dilger, Andreas
  0 siblings, 0 replies; 34+ messages in thread
From: Dilger, Andreas @ 2017-10-17 23:01 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: Drokin, Oleg, James Simmons, Greg Kroah-Hartman, lustre-devel,
	devel, linux-kernel

On Oct 12, 2017, at 10:17, Gustavo A. R. Silva <garsilva@embeddedor.com> wrote:
> 
> In preparation to enabling -Wimplicit-fallthrough, mark switch cases
> where we are expecting to fall through.
> 
> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>

Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>

> ---
> drivers/staging/lustre/lustre/ldlm/ldlm_request.c | 1 +
> 1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c
> index f3bf238..6943987 100644
> --- a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c
> +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c
> @@ -1175,6 +1175,7 @@ ldlm_cancel_no_wait_policy(struct ldlm_namespace *ns, struct ldlm_lock *lock,
> 	case LDLM_IBITS:
> 		if (ns->ns_cancel && ns->ns_cancel(lock) != 0)
> 			break;
> +		/* fall through */
> 	default:
> 		result = LDLM_POLICY_SKIP_LOCK;
> 		lock_res_and_lock(lock);
> -- 
> 2.7.4
> 

Cheers, Andreas
--
Andreas Dilger
Lustre Principal Architect
Intel Corporation

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

* Re: [PATCH 18/20] staging: lustre: osc: mark expected switch fall-through
  2017-10-12 16:17 ` [PATCH 18/20] staging: lustre: osc: " Gustavo A. R. Silva
@ 2017-10-17 23:03   ` Dilger, Andreas
  0 siblings, 0 replies; 34+ messages in thread
From: Dilger, Andreas @ 2017-10-17 23:03 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: Drokin, Oleg, James Simmons, Greg Kroah-Hartman,
	Lustre Development List, devel, Linux Kernel Mailing List

On Oct 12, 2017, at 10:17, Gustavo A. R. Silva <garsilva@embeddedor.com> wrote:
> 
> In preparation to enabling -Wimplicit-fallthrough, mark switch cases
> where we are expecting to fall through.
> 
> Addresses-Coverity-ID: 1077598
> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>

Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>

> ---
> drivers/staging/lustre/lustre/osc/osc_cache.c | 1 +
> 1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/staging/lustre/lustre/osc/osc_cache.c b/drivers/staging/lustre/lustre/osc/osc_cache.c
> index e1207c2..eab7759 100644
> --- a/drivers/staging/lustre/lustre/osc/osc_cache.c
> +++ b/drivers/staging/lustre/lustre/osc/osc_cache.c
> @@ -227,6 +227,7 @@ static int osc_extent_sanity_check0(struct osc_extent *ext,
> 			rc = 65;
> 			goto out;
> 		}
> +		/* fall through */
> 	default:
> 		if (atomic_read(&ext->oe_users) > 0) {
> 			rc = 70;
> -- 
> 2.7.4
> 

Cheers, Andreas
--
Andreas Dilger
Lustre Principal Architect
Intel Corporation

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

* Re: [PATCH 19/20] staging: lustre: ptlrpc: mark expected switch fall-throughs
  2017-10-12 16:17 ` [PATCH 19/20] staging: lustre: ptlrpc: mark expected switch fall-throughs Gustavo A. R. Silva
@ 2017-10-17 23:04   ` Dilger, Andreas
  0 siblings, 0 replies; 34+ messages in thread
From: Dilger, Andreas @ 2017-10-17 23:04 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: Drokin, Oleg, James Simmons, Greg Kroah-Hartman, lustre-devel,
	devel, linux-kernel

On Oct 12, 2017, at 10:17, Gustavo A. R. Silva <garsilva@embeddedor.com> wrote:
> 
> In preparation to enabling -Wimplicit-fallthrough, mark switch cases
> where we are expecting to fall through.
> 
> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>

Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>

> ---
> drivers/staging/lustre/lustre/ptlrpc/pack_generic.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c b/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c
> index aad4ff1..a3664c1 100644
> --- a/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c
> +++ b/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c
> @@ -786,7 +786,7 @@ __u32 lustre_msg_get_flags(struct lustre_msg *msg)
> 
> 		CERROR("invalid msg %p: no ptlrpc body!\n", msg);
> 	}
> -	/* no break */
> +	/* fall through */
> 	default:
> 		/* flags might be printed in debug code while message
> 		 * uninitialized
> @@ -854,7 +854,7 @@ __u32 lustre_msg_get_op_flags(struct lustre_msg *msg)
> 
> 		CERROR("invalid msg %p: no ptlrpc body!\n", msg);
> 	}
> -	/* no break */
> +	/* fall through */
> 	default:
> 		return 0;
> 	}
> @@ -1035,7 +1035,7 @@ int lustre_msg_get_status(struct lustre_msg *msg)
> 
> 		CERROR("invalid msg %p: no ptlrpc body!\n", msg);
> 	}
> -	/* no break */
> +	/* fall through */
> 	default:
> 		/* status might be printed in debug code while message
> 		 * uninitialized
> -- 
> 2.7.4
> 

Cheers, Andreas
--
Andreas Dilger
Lustre Principal Architect
Intel Corporation

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

* Re: [PATCH 20/20] staging: lustre: rpc: mark expected switch fall-throughs
  2017-10-12 16:17 ` [PATCH 20/20] staging: lustre: rpc: " Gustavo A. R. Silva
@ 2017-10-17 23:05   ` Dilger, Andreas
  0 siblings, 0 replies; 34+ messages in thread
From: Dilger, Andreas @ 2017-10-17 23:05 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: Drokin, Oleg, James Simmons, Greg Kroah-Hartman, lustre-devel,
	devel, linux-kernel

On Oct 12, 2017, at 10:17, Gustavo A. R. Silva <garsilva@embeddedor.com> wrote:
> 
> In preparation to enabling -Wimplicit-fallthrough, mark switch cases
> where we are expecting to fall through.
> 
> Addresses-Coverity-ID: 1077604
> Addresses-Coverity-ID: 1077605
> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>

Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>

> ---
> drivers/staging/lustre/lnet/selftest/rpc.c | 13 +++++++++----
> 1 file changed, 9 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/staging/lustre/lnet/selftest/rpc.c b/drivers/staging/lustre/lnet/selftest/rpc.c
> index 77c222c..74ef3c3 100644
> --- a/drivers/staging/lustre/lnet/selftest/rpc.c
> +++ b/drivers/staging/lustre/lnet/selftest/rpc.c
> @@ -1037,6 +1037,7 @@ srpc_handle_rpc(struct swi_workitem *wi)
> 			ev->ev_status = rc;
> 		}
> 	}
> +		/* fall through */
> 	case SWI_STATE_BULK_STARTED:
> 		LASSERT(!rpc->srpc_bulk || ev->ev_fired);
> 
> @@ -1237,7 +1238,8 @@ srpc_send_rpc(struct swi_workitem *wi)
> 			break;
> 
> 		wi->swi_state = SWI_STATE_REQUEST_SENT;
> -		/* perhaps more events, fall thru */
> +		/* perhaps more events */
> +		/* fall through */
> 	case SWI_STATE_REQUEST_SENT: {
> 		enum srpc_msg_type type = srpc_service2reply(rpc->crpc_service);
> 
> @@ -1269,6 +1271,7 @@ srpc_send_rpc(struct swi_workitem *wi)
> 
> 		wi->swi_state = SWI_STATE_REPLY_RECEIVED;
> 	}
> +		/* fall through */
> 	case SWI_STATE_REPLY_RECEIVED:
> 		if (do_bulk && !rpc->crpc_bulkev.ev_fired)
> 			break;
> @@ -1448,6 +1451,7 @@ srpc_lnet_ev_handler(struct lnet_event *ev)
> 			srpc_data.rpc_counters.rpcs_sent++;
> 			spin_unlock(&srpc_data.rpc_glock);
> 		}
> +		/* fall through */
> 	case SRPC_REPLY_RCVD:
> 	case SRPC_BULK_REQ_RCVD:
> 		crpc = rpcev->ev_data;
> @@ -1570,7 +1574,7 @@ srpc_lnet_ev_handler(struct lnet_event *ev)
> 
> 		if (!ev->unlinked)
> 			break; /* wait for final event */
> -
> +		/* fall through */
> 	case SRPC_BULK_PUT_SENT:
> 		if (!ev->status && ev->type != LNET_EVENT_UNLINK) {
> 			spin_lock(&srpc_data.rpc_glock);
> @@ -1582,6 +1586,7 @@ srpc_lnet_ev_handler(struct lnet_event *ev)
> 
> 			spin_unlock(&srpc_data.rpc_glock);
> 		}
> +		/* fall through */
> 	case SRPC_REPLY_SENT:
> 		srpc = rpcev->ev_data;
> 		scd = srpc->srpc_scd;
> @@ -1674,14 +1679,14 @@ srpc_shutdown(void)
> 		spin_unlock(&srpc_data.rpc_glock);
> 
> 		stt_shutdown();
> -
> +		/* fall through */
> 	case SRPC_STATE_EQ_INIT:
> 		rc = LNetClearLazyPortal(SRPC_FRAMEWORK_REQUEST_PORTAL);
> 		rc = LNetClearLazyPortal(SRPC_REQUEST_PORTAL);
> 		LASSERT(!rc);
> 		rc = LNetEQFree(srpc_data.rpc_lnet_eq);
> 		LASSERT(!rc); /* the EQ should have no user by now */
> -
> +		/* fall through */
> 	case SRPC_STATE_NI_INIT:
> 		LNetNIFini();
> 	}
> -- 
> 2.7.4
> 

Cheers, Andreas
--
Andreas Dilger
Lustre Principal Architect
Intel Corporation

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

* Re: [PATCH 12/20] staging: lustre: lnet: selftest: mark expected switch fall-through
  2017-10-12 16:17 ` [PATCH 12/20] staging: lustre: lnet: selftest: mark expected switch fall-through Gustavo A. R. Silva
@ 2017-10-17 23:05   ` Dilger, Andreas
  0 siblings, 0 replies; 34+ messages in thread
From: Dilger, Andreas @ 2017-10-17 23:05 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: Drokin, Oleg, James Simmons, Greg Kroah-Hartman, lustre-devel,
	devel, linux-kernel

On Oct 12, 2017, at 10:17, Gustavo A. R. Silva <garsilva@embeddedor.com> wrote:
> 
> In preparation to enabling -Wimplicit-fallthrough, mark switch cases
> where we are expecting to fall through.
> 
> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>

Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>

> ---
> drivers/staging/lustre/lnet/selftest/conctl.c | 1 +
> 1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/staging/lustre/lnet/selftest/conctl.c b/drivers/staging/lustre/lnet/selftest/conctl.c
> index 9619ecb..551e921 100644
> --- a/drivers/staging/lustre/lnet/selftest/conctl.c
> +++ b/drivers/staging/lustre/lnet/selftest/conctl.c
> @@ -151,6 +151,7 @@ lst_debug_ioctl(struct lstio_debug_args *args)
> 
> 	case LST_OPC_BATCHSRV:
> 		client = 0;
> +		/* fall through */
> 	case LST_OPC_BATCHCLI:
> 		if (!name)
> 			goto out;
> -- 
> 2.7.4
> 

Cheers, Andreas
--
Andreas Dilger
Lustre Principal Architect
Intel Corporation

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

* Re: [PATCH 00/20] mark expected switch fall-throughs
  2017-10-12 16:15 [PATCH 00/20] mark expected switch fall-throughs Gustavo A. R. Silva
                   ` (19 preceding siblings ...)
  2017-10-12 16:17 ` [PATCH 20/20] staging: lustre: rpc: " Gustavo A. R. Silva
@ 2017-10-23 19:33 ` Gustavo A. R. Silva
  20 siblings, 0 replies; 34+ messages in thread
From: Gustavo A. R. Silva @ 2017-10-23 19:33 UTC (permalink / raw)
  To: linux-rpi-kernel, linux-arm-kernel, lustre-devel, devel, linux-kernel
  Cc: Oleg Drokin, Andreas Dilger, James Simmons, Greg Kroah-Hartman,
	Ian Abbott, H Hartley Sweeten, Eric Anholt, Stefan Wahren,
	Forest Bond


Quoting "Gustavo A. R. Silva" <garsilva@embeddedor.com>:

> In preparation to enabling -Wimplicit-fallthrough, this patchset aims
> to mark switch cases where we are expecting to fall through.
>
> In Kees Cook words:
> "This is an unfortunate omission in the C language, and thankfully both
> gcc and clang have stepped up to solve this the same way static
> analyzers have solved it. It does both document the intention for
> humans and provide a way for analyzers to report issues.
>
> Having the compiler help us not make mistakes is quite handy."
>
> In some cases there were "no break" or "fall thru" comments already
> in place. So I replaced them with proper "fall through" comments, which
> is what GCC is expecting to find.
>
> For the rest of the cases, please double check if the actual intention
> of the code is to fall through.
>
> Thanks!
>
> Gustavo A. R. Silva (20):
>   staging: ks7010: ks_wlan_net: mark expected switch fall-throughs
>   staging: lustre: lnet: socklnd: mark expected switch fall-through
>   staging: rtl8192e: mark expected switch fall-through
>   staging: rtl8723bs: rtw_mlme_ext: mark expected switch fall-through
>   staging: lustre: lnet: net_fault: mark expected switch fall-through
>   staging: comedi: s526: mark expected switch fall-through
>   staging: rtl8188eu: usb_halinit: mark expected switch fall-through
>   staging: vc04_services: vchiq_core: mark expected switch fall-through
>   staging: vt6656: card: mark expected switch fall-throughs
>   staging: rtl8188eu: usb_ops_linux: mark expected switch fall-through
>   staging: r8822be: mark expected switch fall-throughs
>   staging: lustre: lnet: selftest: mark expected switch fall-through
>   staging: rtlwifi: halmac: mark expected switch fall-through
>   staging: lustre: lnet: selftest: mark expected switch fall-throughs
>   staging: lustre: llite: mark expected switch fall-through
>   staging: lustre: lprocfs: mark expected switch fall-throughs
>   staging: lustre: ldlm: mark expected switch fall-through
>   staging: lustre: osc: mark expected switch fall-through
>   staging: lustre: ptlrpc: mark expected switch fall-throughs
>   staging: lustre: rpc: mark expected switch fall-throughs
>
>  drivers/staging/comedi/drivers/s526.c                       |  5 ++---
>  drivers/staging/ks7010/ks_wlan_net.c                        | 10 ++++++++++
>  drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c         |  2 +-
>  drivers/staging/lustre/lnet/lnet/net_fault.c                |  1 +
>  drivers/staging/lustre/lnet/selftest/conctl.c               |  1 +
>  drivers/staging/lustre/lnet/selftest/module.c               |  5 ++++-
>  drivers/staging/lustre/lnet/selftest/rpc.c                  | 13  
> +++++++++----
>  drivers/staging/lustre/lustre/ldlm/ldlm_request.c           |  1 +
>  drivers/staging/lustre/lustre/llite/namei.c                 |  4 +++-
>  drivers/staging/lustre/lustre/obdclass/lprocfs_status.c     |  4 ++++
>  drivers/staging/lustre/lustre/osc/osc_cache.c               |  1 +
>  drivers/staging/lustre/lustre/ptlrpc/pack_generic.c         |  6 +++---
>  drivers/staging/rtl8188eu/hal/usb_halinit.c                 |  1 +
>  drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c            |  1 +
>  drivers/staging/rtl8192e/rtllib_wx.c                        |  3 +--
>  drivers/staging/rtl8723bs/core/rtw_mlme_ext.c               |  2 +-
>  .../staging/rtlwifi/halmac/halmac_88xx/halmac_api_88xx.c    |  2 ++
>  drivers/staging/rtlwifi/halmac/rtl_halmac.c                 |  2 +-
>  .../staging/vc04_services/interface/vchiq_arm/vchiq_core.c  |  3 +--
>  drivers/staging/vt6656/card.c                               |  2 ++
>  20 files changed, 50 insertions(+), 19 deletions(-)
>
> --
> 2.7.4

Andreas, Stefan:
Thank you for your reviews and ACKs

Greg:
Thank you for applying the patches.

--
Gustavo A. R. Silva

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

* [PATCH 00/20] Mark expected switch fall-throughs
@ 2018-10-22 20:37 Gustavo A. R. Silva
  0 siblings, 0 replies; 34+ messages in thread
From: Gustavo A. R. Silva @ 2018-10-22 20:37 UTC (permalink / raw)
  To: QCA ath9k Development, Christian Lamparter, Stanislaw Gruszka,
	Luis R. Rodriguez, Amitkumar Karwar, Nishant Sarmukadam,
	Ganapathi Bhat, Xinming Hu, Helmut Schaa, Ping-Ke Shih
  Cc: Kalle Valo, linux-wireless, David S. Miller, netdev,
	linux-kernel, Gustavo A. R. Silva, Kees Cook

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

Thanks!

Gustavo A. R. Silva (20):
  ath6kl: Mark expected switch fall-through
  ath9k: mark expected switch fall-through
  ath9k: ar9002_phy: mark expected switch fall-throughs
  ath9k_hw: mark expected switch fall-through
  carl9170: rx: mark expected switch fall-through
  carl9170: tx: mark expected switch fall-throughs
  iwlegacy: 4965-mac: mark expected switch fall-through
  iwlegacy: common: mark expected switch fall-throughs
  orinoco_usb: mark expected switch fall-through
  prism54: isl_38xx: Mark expected switch fall-through
  prism54: isl_ioctl: mark expected switch fall-through
  prism54: islpci_dev: mark expected switch fall-through
  mwifiex: Mark expected switch fall-through
  rt2x00: rt2400pci: mark expected switch fall-through
  rt2x00: rt2500pci: mark expected switch fall-through
  rt2x00: rt2800lib: mark expected switch fall-through
  rt2x00: rt61pci: mark expected switch fall-through
  ray_cs: mark expected switch fall-throughs
  rtlwifi: rtl8821ae: phy: Mark expected switch fall-through
  zd1201: mark expected switch fall-through

 drivers/net/wireless/ath/ath6kl/main.c               | 1 +
 drivers/net/wireless/ath/ath9k/ar5008_phy.c          | 2 +-
 drivers/net/wireless/ath/ath9k/ar9002_phy.c          | 2 +-
 drivers/net/wireless/ath/ath9k/hw.c                  | 1 +
 drivers/net/wireless/ath/carl9170/rx.c               | 1 +
 drivers/net/wireless/ath/carl9170/tx.c               | 3 +++
 drivers/net/wireless/intel/iwlegacy/4965-mac.c       | 2 +-
 drivers/net/wireless/intel/iwlegacy/common.c         | 2 ++
 drivers/net/wireless/intersil/orinoco/orinoco_usb.c  | 1 +
 drivers/net/wireless/intersil/prism54/isl_38xx.c     | 1 +
 drivers/net/wireless/intersil/prism54/isl_ioctl.c    | 1 +
 drivers/net/wireless/intersil/prism54/islpci_dev.c   | 1 +
 drivers/net/wireless/marvell/mwifiex/ie.c            | 1 +
 drivers/net/wireless/ralink/rt2x00/rt2400pci.c       | 2 +-
 drivers/net/wireless/ralink/rt2x00/rt2500pci.c       | 2 +-
 drivers/net/wireless/ralink/rt2x00/rt2800lib.c       | 4 ++++
 drivers/net/wireless/ralink/rt2x00/rt61pci.c         | 2 +-
 drivers/net/wireless/ray_cs.c                        | 2 ++
 drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c | 1 +
 drivers/net/wireless/zydas/zd1201.c                  | 1 +
 20 files changed, 27 insertions(+), 6 deletions(-)

-- 
2.7.4


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

end of thread, other threads:[~2018-10-22 20:37 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-12 16:15 [PATCH 00/20] mark expected switch fall-throughs Gustavo A. R. Silva
2017-10-12 16:15 ` [PATCH 01/20] staging: ks7010: ks_wlan_net: " Gustavo A. R. Silva
2017-10-12 16:16 ` [PATCH 02/20] staging: lustre: lnet: socklnd: mark expected switch fall-through Gustavo A. R. Silva
2017-10-17 22:56   ` Dilger, Andreas
2017-10-12 16:16 ` [PATCH 03/20] staging: rtl8192e: " Gustavo A. R. Silva
2017-10-12 16:16 ` [PATCH 04/20] staging: rtl8723bs: rtw_mlme_ext: " Gustavo A. R. Silva
2017-10-12 16:16 ` [PATCH 05/20] staging: lustre: lnet: net_fault: " Gustavo A. R. Silva
2017-10-17 22:57   ` Dilger, Andreas
2017-10-12 16:16 ` [PATCH 06/20] staging: comedi: s526: " Gustavo A. R. Silva
2017-10-12 16:16 ` [PATCH 07/20] staging: rtl8188eu: usb_halinit: " Gustavo A. R. Silva
2017-10-12 16:16 ` [PATCH 08/20] staging: vc04_services: vchiq_core: " Gustavo A. R. Silva
2017-10-12 17:29   ` Stefan Wahren
2017-10-12 16:16 ` [PATCH 09/20] staging: vt6656: card: mark expected switch fall-throughs Gustavo A. R. Silva
2017-10-12 16:16 ` [PATCH 10/20] staging: rtl8188eu: usb_ops_linux: mark expected switch fall-through Gustavo A. R. Silva
2017-10-12 16:17 ` [PATCH 11/20] staging: r8822be: mark expected switch fall-throughs Gustavo A. R. Silva
2017-10-12 16:17 ` [PATCH 12/20] staging: lustre: lnet: selftest: mark expected switch fall-through Gustavo A. R. Silva
2017-10-17 23:05   ` Dilger, Andreas
2017-10-12 16:17 ` [PATCH 13/20] staging: rtlwifi: halmac: " Gustavo A. R. Silva
2017-10-12 16:17 ` [PATCH 14/20] staging: lustre: lnet: selftest: mark expected switch fall-throughs Gustavo A. R. Silva
2017-10-17 22:58   ` Dilger, Andreas
2017-10-12 16:17 ` [PATCH 15/20] staging: lustre: llite: mark expected switch fall-through Gustavo A. R. Silva
2017-10-17 23:00   ` Dilger, Andreas
2017-10-12 16:17 ` [PATCH 16/20] staging: lustre: lprocfs: mark expected switch fall-throughs Gustavo A. R. Silva
2017-10-17 23:00   ` Dilger, Andreas
2017-10-12 16:17 ` [PATCH 17/20] staging: lustre: ldlm: mark expected switch fall-through Gustavo A. R. Silva
2017-10-17 23:01   ` Dilger, Andreas
2017-10-12 16:17 ` [PATCH 18/20] staging: lustre: osc: " Gustavo A. R. Silva
2017-10-17 23:03   ` Dilger, Andreas
2017-10-12 16:17 ` [PATCH 19/20] staging: lustre: ptlrpc: mark expected switch fall-throughs Gustavo A. R. Silva
2017-10-17 23:04   ` Dilger, Andreas
2017-10-12 16:17 ` [PATCH 20/20] staging: lustre: rpc: " Gustavo A. R. Silva
2017-10-17 23:05   ` Dilger, Andreas
2017-10-23 19:33 ` [PATCH 00/20] " Gustavo A. R. Silva
2018-10-22 20:37 [PATCH 00/20] Mark " 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).