[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200213125659.GB3325929@kroah.com>
Date: Thu, 13 Feb 2020 04:56:59 -0800
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: "Gustavo A. R. Silva" <gustavo@...eddedor.com>,
Rasmus Villemoes <linux@...musvillemoes.dk>
Cc: Timur Tabi <timur@...nel.org>, Li Yang <leoyang.li@....com>,
"Gustavo A. R. Silva" <gustavo@...eddedor.com>,
Anton Vorontsov <avorontsov@...mvista.com>,
kbuild test robot <lkp@...el.com>, linux-usb@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] usb: host: fhci-hcd: annotate PIPE_CONTROL switch case
with fallthrough
On Thu, Feb 13, 2020 at 09:54:00AM +0100, Rasmus Villemoes wrote:
> 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@...el.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@...musvillemoes.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;
We have an attribute for that?
Shouldn't this be /* fall through */ instead?
Gustavo, what's the best practice here, I count only a few
"fallthrough;" instances in the kernel, although one is in our coding
style document, and thousands of the /* */ version.
thanks,
greg k-h
Powered by blists - more mailing lists