Skip to content

mark expected switch fall-throughs

Gustavo A. R. Silva lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest9 patches 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9usb: host: fotg210-hcd: mark expected switch fall-throughdrivers/usb/host/fotg210-hcd.c+1 -10 replies
2/9usb: host: xhci: mark expected switch fall-throughdrivers/usb/host/xhci.c+1 -00 replies
3/9usb: host: xhci-mem: mark expected switch fall-throughdrivers/usb/host/xhci-mem.c+1 -00 replies
4/9usb: host: ohci-hcd: mark expected switch fall-throughdrivers/usb/host/ohci-hcd.c+1 -10 replies
5/9usb: host: ehci-hcd: mark expected switch fall-throughdrivers/usb/host/ehci-hcd.c+1 -10 replies
6/9usb: host: isp1362-hcd: mark expected switch fall-throughdrivers/usb/host/isp1362-hcd.c+1 -05 replies
7/9usb: host: oxu210hp-hcd: mark expected switch fall-throughdrivers/usb/host/oxu210hp-hcd.c+1 -10 replies
8/9usb: host: xhci-hub: mark expected switch fall-throughdrivers/usb/host/xhci-hub.c+1 -00 replies
9/9usb: host: pci-quirks: mark expected switch fall-throughdrivers/usb/host/pci-quirks.c+1 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/9] mark expected switch fall-throughs

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 "else FALL THROUGH" or "then fallthrough..." comments already in place. So I replaced them with proper "fall through" comments, which is what GCC is expecting to find.

Thanks!

Gustavo A. R. Silva (9):
usb: host: fotg210-hcd: mark expected switch fall-through
usb: host: xhci: mark expected switch fall-through
usb: host: xhci-mem: mark expected switch fall-through
usb: host: ohci-hcd: mark expected switch fall-through
usb: host: ehci-hcd: mark expected switch fall-through
usb: host: isp1362-hcd: mark expected switch fall-through
usb: host: oxu210hp-hcd: mark expected switch fall-through
usb: host: xhci-hub: mark expected switch fall-through
usb: host: pci-quirks: mark expected switch fall-through

 drivers/usb/host/ehci-hcd.c     | 2 +-
 drivers/usb/host/fotg210-hcd.c  | 2 +-
 drivers/usb/host/isp1362-hcd.c  | 1 +
 drivers/usb/host/ohci-hcd.c     | 2 +-
 drivers/usb/host/oxu210hp-hcd.c | 2 +-
 drivers/usb/host/pci-quirks.c   | 2 +-
 drivers/usb/host/xhci-hub.c     | 1 +
 drivers/usb/host/xhci-mem.c     | 1 +
 drivers/usb/host/xhci.c         | 1 +
 9 files changed, 9 insertions(+), 5 deletions(-)
Signature · 1 line
2.7.4