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.
Unified · Split
| @@ -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; |
| @@ -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); |