[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <5C98D6B502000078002219FB@prv1-mh.provo.novell.com>
Date: Mon, 25 Mar 2019 07:25:09 -0600
From: "Jan Beulich" <JBeulich@...e.com>
To: "Gustavo A.R.Silva" <gustavo@...eddedor.com>
Cc: <keescook@...omium.org>, "Bjorn Helgaas" <bhelgaas@...gle.com>,
"Stefano Stabellini" <sstabellini@...nel.org>,
"xen-devel" <xen-devel@...ts.xenproject.org>,
"Boris Ostrovsky" <boris.ostrovsky@...cle.com>,
"Konrad Rzeszutek Wilk" <konrad.wilk@...cle.com>,
"Juergen Gross" <jgross@...e.com>, <linux-kernel@...r.kernel.org>,
<linux-pci@...r.kernel.org>
Subject: Re: [Xen-devel] [PATCH] PCI: Mark expected switch
fall-throughs
>>> On 20.03.19 at 19:27, <gustavo@...eddedor.com> wrote:
> In preparation to enabling -Wimplicit-fallthrough, mark switch
> cases where we are expecting to fall through.
>
> This patch fixes the following warnings:
>
> drivers/pci/proc.c: In function ‘proc_bus_pci_ioctl’:
> drivers/pci/proc.c:216:6: warning: this statement may fall through
> [-Wimplicit-fallthrough=]
> if (arch_can_pci_mmap_wc()) {
> ^
> drivers/pci/proc.c:225:2: note: here
> default:
> ^~~~~~~
>
> drivers/pci/xen-pcifront.c: In function ‘pcifront_backend_changed’:
> drivers/pci/xen-pcifront.c:1105:6: warning: this statement may fall through
> [-Wimplicit-fallthrough=]
> if (xdev->state == XenbusStateClosed)
> ^
> drivers/pci/xen-pcifront.c:1108:2: note: here
> case XenbusStateClosing:
> ^~~~
>
> Notice that, in this particular case, the /* fall through */
> comment is placed at the very bottom of the case statement,
> which is what GCC is expecting to find.
>
> Warning level 3 was used: -Wimplicit-fallthrough=3
>
> This patch is part of the ongoing efforts to enable
> -Wimplicit-fallthrough.
None of the above explains why ...
> --- a/drivers/pci/xen-pcifront.c
> +++ b/drivers/pci/xen-pcifront.c
> @@ -1104,7 +1104,7 @@ static void __ref pcifront_backend_changed(struct xenbus_device *xdev,
> case XenbusStateClosed:
> if (xdev->state == XenbusStateClosed)
> break;
> - /* Missed the backend's CLOSING state -- fallthrough */
> + /* fall through - Missed the backend's CLOSING state. */
... the original comment here wasn't good enough.
Jan
Powered by blists - more mailing lists