* [PATCH 00/20] mark expected switch fall-throughs
@ 2017-10-12 16:15 Gustavo A. R. Silva
2017-10-12 16:16 ` [PATCH 08/20] staging: vc04_services: vchiq_core: mark expected switch fall-through Gustavo A. R. Silva
2017-10-23 19:33 ` [PATCH 00/20] mark expected switch fall-throughs Gustavo A. R. Silva
0 siblings, 2 replies; 4+ messages in thread
From: Gustavo A. R. Silva @ 2017-10-12 16:15 UTC (permalink / raw)
To: linux-arm-kernel
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] 4+ 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
@ 2017-10-12 16:16 ` Gustavo A. R. Silva
2017-10-12 17:29 ` Stefan Wahren
2017-10-23 19:33 ` [PATCH 00/20] mark expected switch fall-throughs Gustavo A. R. Silva
1 sibling, 1 reply; 4+ messages in thread
From: Gustavo A. R. Silva @ 2017-10-12 16:16 UTC (permalink / raw)
To: linux-arm-kernel
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] 4+ messages in thread
* [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: mark expected switch fall-through Gustavo A. R. Silva
@ 2017-10-12 17:29 ` Stefan Wahren
0 siblings, 0 replies; 4+ messages in thread
From: Stefan Wahren @ 2017-10-12 17:29 UTC (permalink / raw)
To: 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] 4+ messages in thread
* [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
2017-10-12 16:16 ` [PATCH 08/20] staging: vc04_services: vchiq_core: mark expected switch fall-through Gustavo A. R. Silva
@ 2017-10-23 19:33 ` Gustavo A. R. Silva
1 sibling, 0 replies; 4+ messages in thread
From: Gustavo A. R. Silva @ 2017-10-23 19:33 UTC (permalink / raw)
To: linux-arm-kernel
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] 4+ messages in thread
end of thread, other threads:[~2017-10-23 19:33 UTC | newest]
Thread overview: 4+ 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:16 ` [PATCH 08/20] staging: vc04_services: vchiq_core: mark expected switch fall-through Gustavo A. R. Silva
2017-10-12 17:29 ` Stefan Wahren
2017-10-23 19:33 ` [PATCH 00/20] mark expected switch fall-throughs 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).