All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] usb: host: fhci-hcd: annotate PIPE_CONTROL switch case with fallthrough
@ 2020-02-13  8:54 Rasmus Villemoes
  2020-02-13 12:56 ` Greg Kroah-Hartman
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Rasmus Villemoes @ 2020-02-13  8:54 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Timur Tabi, Li Yang, Rasmus Villemoes,
	Gustavo A. R. Silva
  Cc: Anton Vorontsov, kbuild test robot, linux-usb, linux-kernel

After this was made buildable for something other than PPC32, kbuild
starts warning

drivers/usb/host/fhci-hcd.c:398:8: warning: this statement may fall
through [-Wimplicit-fallthrough=]

I don't know this code, but from the construction (initializing size
with 0 and explicitly using "size +=" in the PIPE_BULK case) I assume
that fallthrough is indeed intended.

Reported-by: kbuild test robot <lkp@intel.com>
Fixes: 5a35435ef4e6 (soc: fsl: qe: remove PPC32 dependency from CONFIG_QUICC_ENGINE)
Fixes: a035d552a93b (Makefile: Globally enable fall-through warning)
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
---

Two different Fixes: Obviously my 5a35435ef4e6 is the one that started
making kbuild complain, but that's just because apparently kbuild
doesn't cover a PPC32+USB_FHCI_HCD .config. Note for -stable folks,
just in case 5.3.y is still maintained somewhere: a035d552a93b
appeared in 5.3, but the #define fallthrough that I'm using here
wasn't introduced until 5.4 (294f69e662d15). So either ignore this,
make it /* fallthrough */, or backport 294f69e662d15 to 5.3.y as well.

 drivers/usb/host/fhci-hcd.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/host/fhci-hcd.c b/drivers/usb/host/fhci-hcd.c
index 04733876c9c6..a8e1048278d0 100644
--- a/drivers/usb/host/fhci-hcd.c
+++ b/drivers/usb/host/fhci-hcd.c
@@ -396,6 +396,7 @@ static int fhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb,
 	case PIPE_CONTROL:
 		/* 1 td fro setup,1 for ack */
 		size = 2;
+		fallthrough;
 	case PIPE_BULK:
 		/* one td for every 4096 bytes(can be up to 8k) */
 		size += urb->transfer_buffer_length / 4096;
-- 
2.23.0


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

end of thread, other threads:[~2020-02-17 19:44 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-13  8:54 [PATCH] usb: host: fhci-hcd: annotate PIPE_CONTROL switch case with fallthrough Rasmus Villemoes
2020-02-13 12:56 ` Greg Kroah-Hartman
2020-02-13 13:35   ` Rasmus Villemoes
2020-02-13 15:23     ` [PATCH] checkpatch: Prefer fallthrough; over fallthrough comments Joe Perches
2020-02-17  9:38     ` [PATCH] usb: host: fhci-hcd: annotate PIPE_CONTROL switch case with fallthrough Greg Kroah-Hartman
2020-02-17 14:12       ` Rasmus Villemoes
2020-02-17 14:18         ` Greg Kroah-Hartman
2020-02-17 16:15           ` Gustavo A. R. Silva
2020-02-17 16:29             ` Greg Kroah-Hartman
2020-02-17 17:12   ` Gustavo A. R. Silva
2020-02-17 17:33     ` Joe Perches
2020-02-17 19:44       ` Rasmus Villemoes
2020-02-13 21:11 ` Leo Li
2020-02-17 17:28 ` Gustavo A. R. Silva

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