diff mbox series

[RFC,v3,12/78] hw/usb: add fallthrough pseudo-keyword

Message ID 8a8bc7d7ac048e5caaa31b5020f63056c9490325.1697186560.git.manos.pitsidianakis@linaro.org (mailing list archive)
State New, archived
Headers show
Series Strict disable implicit fallthrough | expand

Commit Message

Manos Pitsidianakis Oct. 13, 2023, 8:45 a.m. UTC
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.

Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
 hw/usb/dev-mtp.c   | 2 +-
 hw/usb/dev-wacom.c | 2 +-
 hw/usb/hcd-ehci.c  | 4 +++-
 hw/usb/hcd-xhci.c  | 4 ++--
 hw/usb/redirect.c  | 4 ++--
 hw/usb/tusb6010.c  | 2 +-
 6 files changed, 10 insertions(+), 8 deletions(-)
diff mbox series

Patch

diff --git a/hw/usb/dev-mtp.c b/hw/usb/dev-mtp.c
index 1cac1cd435..5cbaabd2b2 100644
--- a/hw/usb/dev-mtp.c
+++ b/hw/usb/dev-mtp.c
@@ -1648,7 +1648,7 @@  static void usb_mtp_write_data(MTPState *s, uint32_t handle)
                 d->write_status = WRITE_END;
             }
         }
-        /* fall through */
+        fallthrough;
     case WRITE_CONTINUE:
     case WRITE_END:
         rc = write_retry(d->fd, d->data, d->data_offset,
diff --git a/hw/usb/dev-wacom.c b/hw/usb/dev-wacom.c
index 7177c17f03..bd2a1bae50 100644
--- a/hw/usb/dev-wacom.c
+++ b/hw/usb/dev-wacom.c
@@ -389,7 +389,7 @@  static void usb_wacom_handle_data(USBDevice *dev, USBPacket *p)
             usb_packet_copy(p, buf, len);
             break;
         }
-        /* Fall through.  */
+        fallthrough;
     case USB_TOKEN_OUT:
     default:
         p->status = USB_RET_STALL;
diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c
index 19b4534c20..e29cc21957 100644
--- a/hw/usb/hcd-ehci.c
+++ b/hw/usb/hcd-ehci.c
@@ -1477,7 +1477,7 @@  static int ehci_process_itd(EHCIState *ehci,
             default:
                 fprintf(stderr, "Unexpected iso usb result: %d\n",
                         ehci->ipacket.status);
-                /* Fall through */
+                fallthrough;
             case USB_RET_IOERROR:
             case USB_RET_NODEV:
                 /* 3.3.2: XACTERR is only allowed on IN transactions */
@@ -2140,6 +2140,7 @@  static void ehci_advance_async_state(EHCIState *ehci)
         }
         ehci_set_state(ehci, async, EST_ACTIVE);
         // No break, fall through to ACTIVE
+        fallthrough;
 
     case EST_ACTIVE:
         if (!ehci_async_enabled(ehci)) {
@@ -2197,6 +2198,7 @@  static void ehci_advance_periodic_state(EHCIState *ehci)
         if (!(ehci->frindex & 7) && ehci_periodic_enabled(ehci)) {
             ehci_set_state(ehci, async, EST_ACTIVE);
             // No break, fall through to ACTIVE
+            fallthrough;
         } else
             break;
 
diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
index 4b60114207..3e9b9c62bd 100644
--- a/hw/usb/hcd-xhci.c
+++ b/hw/usb/hcd-xhci.c
@@ -1457,7 +1457,7 @@  static int xhci_xfer_create_sgl(XHCITransfer *xfer, int in_xfer)
                 DPRINTF("xhci: data direction mismatch for TR_DATA\n");
                 goto err;
             }
-            /* fallthrough */
+            fallthrough;
         case TR_NORMAL:
         case TR_ISOCH:
             addr = xhci_mask64(trb->parameter);
@@ -2678,7 +2678,7 @@  static void xhci_port_reset(XHCIPort *port, bool warm_reset)
         if (warm_reset) {
             port->portsc |= PORTSC_WRC;
         }
-        /* fall through */
+        fallthrough;
     case USB_SPEED_LOW:
     case USB_SPEED_FULL:
     case USB_SPEED_HIGH:
diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c
index c9893df867..2531d583ad 100644
--- a/hw/usb/redirect.c
+++ b/hw/usb/redirect.c
@@ -1814,7 +1814,7 @@  static void usbredir_ep_info(void *priv,
         case usb_redir_type_iso:
             usbredir_mark_speed_incompatible(dev, USB_SPEED_FULL);
             usbredir_mark_speed_incompatible(dev, USB_SPEED_HIGH);
-            /* Fall through */
+            fallthrough;
         case usb_redir_type_interrupt:
             if (!usbredirparser_peer_has_cap(dev->parser,
                                      usb_redir_cap_ep_info_max_packet_size) ||
@@ -1831,7 +1831,7 @@  static void usbredir_ep_info(void *priv,
                 usbredir_reject_device(dev);
                 return;
             }
-            /* Fall through */
+            fallthrough;
         case usb_redir_type_control:
         case usb_redir_type_bulk:
             DPRINTF("ep: %02X type: %d interface: %d\n", I2EP(i),
diff --git a/hw/usb/tusb6010.c b/hw/usb/tusb6010.c
index 1dd4071e68..88c736fad2 100644
--- a/hw/usb/tusb6010.c
+++ b/hw/usb/tusb6010.c
@@ -741,7 +741,7 @@  static void tusb_musb_core_intr(void *opaque, int source, int level)
     case musb_irq_tx:
     case musb_irq_rx:
         s->usbip_intr = musb_core_intr_get(s->musb);
-        /* Fall through.  */
+        fallthrough;
     default:
         if (level)
             s->intr |= 1 << source;