@@ -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,
@@ -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;
@@ -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;
@@ -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:
@@ -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),
@@ -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;
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(-)