History

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.

Gustavo A. R. Silva committed 7 years ago

Commit 296bd5a1 parent 9e98c672 files · +2 −1Browse files

Unified · Split

2 files
  1. drivers/pci/proc.c +1 −0
  2. drivers/pci/xen-pcifront.c +1 −1
drivers/pci/proc.c+1−0
@@ -222,6 +222,7 @@ static long proc_bus_pci_ioctl(struct file *file, unsigned int cmd, · 221 unmodified lines
222 }222 }
223 /* If arch decided it can't, fall through... */223 /* If arch decided it can't, fall through... */
224#endif /* HAVE_PCI_MMAP */224#endif /* HAVE_PCI_MMAP */
225 /* fall through */
225 default:226 default:
226 ret = -EINVAL;227 ret = -EINVAL;
227 break;228 break;
drivers/pci/xen-pcifront.c+1−1
@@ -1104,7 +1104,7 @@ static void __ref pcifront_backend_changed(struct xenbus_device *xdev, · 1103 unmodified lines
1104 case XenbusStateClosed:1104 case XenbusStateClosed:
1105 if (xdev->state == XenbusStateClosed)1105 if (xdev->state == XenbusStateClosed)
1106 break;1106 break;
1107 /* Missed the backend's CLOSING state -- fallthrough */1107 /* fall through - Missed the backend's CLOSING state. */
1108 case XenbusStateClosing:1108 case XenbusStateClosing:
1109 dev_warn(&xdev->dev, "backend going away!\n");1109 dev_warn(&xdev->dev, "backend going away!\n");
1110 pcifront_try_disconnect(pdev);1110 pcifront_try_disconnect(pdev);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t