Skip to contentSkip to conversation

serial: 8250_pci: Use fallthrough pseudo-keyword

PATCH In review Wei Ming Chen 2 participants 2 messages May 7, 2021 TTY layer and serial drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 serial: 8250_pci: Use fallthrough pseudo-keyword

Add pseudo-keyword macro fallthrough[1]

[1] https://www.kernel.org/doc/html/latest/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through

---
 drivers/tty/serial/8250/8250_pci.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/tty/serial/8250/8250_pci.c +3 -0
index 689d8227f95f..4158f06de4d5 100644
@@ -847,8 +847,11 @@ static int pci_netmos_init(struct pci_dev *dev)
 
 	switch (dev->device) { /* FALLTHROUGH on all */
 	case PCI_DEVICE_ID_NETMOS_9904:
+		fallthrough;
 	case PCI_DEVICE_ID_NETMOS_9912:
+		fallthrough;
 	case PCI_DEVICE_ID_NETMOS_9922:
+		fallthrough;
 	case PCI_DEVICE_ID_NETMOS_9900:
 		num_serial = pci_netmos_9900_numports(dev);
 		break;
Signature · 1 line
2.25.1
maintainer
#1 lore raw
Quoted 14 lines · Wei Ming Chen

Add pseudo-keyword macro fallthrough[1]

[1] https://www.kernel.org/doc/html/latest/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through

---
 drivers/tty/serial/8250/8250_pci.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/tty/serial/8250/8250_pci.c +0 -0
index 689d8227f95f..4158f06de4d5 100644

drivers/tty/serial/8250/8250_pci.c static int pci_netmos_init(struct pci_dev *dev) · line 855

Quoted 9 lines
drivers/tty/serial/8250/8250_pci.c +3 -0
@@ -847,8 +847,11 @@ static int pci_netmos_init(struct pci_dev *dev)
 
 	switch (dev->device) { /* FALLTHROUGH on all */
 	case PCI_DEVICE_ID_NETMOS_9904:
+		fallthrough;
 	case PCI_DEVICE_ID_NETMOS_9912:
+		fallthrough;
 	case PCI_DEVICE_ID_NETMOS_9922:
+		fallthrough;
 	case PCI_DEVICE_ID_NETMOS_9900:

I really doubt this is needed here. If so, something is really wrong with the static checkers.

thanks,

greg k-h