Commit 296bd5ae authored by Gustavo A. R. Silva's avatar Gustavo A. R. Silva Committed by Bjorn Helgaas

PCI: Mark expected switch fall-throughs

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.
Signed-off-by: default avatarGustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
parent 9e98c678
......@@ -222,6 +222,7 @@ static long proc_bus_pci_ioctl(struct file *file, unsigned int cmd,
}
/* If arch decided it can't, fall through... */
#endif /* HAVE_PCI_MMAP */
/* fall through */
default:
ret = -EINVAL;
break;
......
......@@ -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. */
case XenbusStateClosing:
dev_warn(&xdev->dev, "backend going away!\n");
pcifront_try_disconnect(pdev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment