@@ -678,6 +678,8 @@ static __poll_t ffs_ep0_poll(struct file *file, poll_table *wait)
mask |= (EPOLLIN | EPOLLOUT);
break;
}
+ break;
+
case FFS_CLOSING:
break;
case FFS_DEACTIVATED:
@@ -274,7 +274,7 @@ static void loopback_complete(struct usb_ep *ep, struct usb_request *req)
default:
ERROR(cdev, "%s loop complete --> %d, %d/%d\n", ep->name,
status, req->actual, req->length);
- /* FALLTHROUGH */
+ fallthrough;
/* NOTE: since this driver doesn't maintain an explicit record
* of requests it submitted (just maintains qlen count), we
@@ -559,6 +559,7 @@ static void source_sink_complete(struct usb_ep *ep, struct usb_request *req)
#if 1
DBG(cdev, "%s complete --> %d, %d/%d\n", ep->name,
status, req->actual, req->length);
+ break;
#endif
case -EREMOTEIO: /* short read */
break;
@@ -553,6 +553,7 @@ static int dummy_enable(struct usb_ep *_ep,
/* we'll fake any legal size */
break;
/* save a return statement */
+ fallthrough;
default:
goto done;
}
@@ -595,6 +596,7 @@ static int dummy_enable(struct usb_ep *_ep,
if (max <= 1023)
break;
/* save a return statement */
+ fallthrough;
default:
goto done;
}
@@ -5276,7 +5276,7 @@ static int fotg210_urb_enqueue(struct usb_hcd *hcd, struct urb *urb,
*/
if (urb->transfer_buffer_length > (16 * 1024))
return -EMSGSIZE;
- /* FALLTHROUGH */
+ fallthrough;
/* case PIPE_BULK: */
default:
if (!qh_urb_transaction(fotg210, urb, &qtd_list, mem_flags))
@@ -1447,6 +1447,7 @@ static int isp116x_bus_resume(struct usb_hcd *hcd)
val &= ~HCCONTROL_HCFS;
val |= HCCONTROL_USB_RESUME;
isp116x_write_reg32(isp116x, HCCONTROL, val);
+ break;
case HCCONTROL_USB_RESUME:
break;
case HCCONTROL_USB_OPER:
@@ -1537,6 +1537,7 @@ max3421_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, gfp_t mem_flags)
__func__, urb->interval);
return -EINVAL;
}
+ break;
default:
break;
}
@@ -1365,6 +1365,7 @@ __acquires(oxu->lock)
switch (urb->status) {
case -EINPROGRESS: /* success */
urb->status = 0;
+ break;
default: /* fault */
break;
case -EREMOTEIO: /* fault or normal */
@@ -137,6 +137,7 @@ static void yurex_interrupt(struct urb *urb)
dev_err(&dev->interface->dev,
"%s - overflow with length %d, actual length is %d\n",
__func__, YUREX_BUF_SIZE, dev->urb->actual_length);
+ return;
case -ECONNRESET:
case -ENOENT:
case -ESHUTDOWN:
@@ -467,6 +467,7 @@ static void musb_do_idle(struct timer_list *t)
fallthrough;
case OTG_STATE_A_IDLE:
tusb_musb_set_vbus(musb, 0);
+ break;
default:
break;
}
@@ -861,6 +861,7 @@ static int ms_count_freeblock(struct us_data *us, u16 PhyBlock)
case MS_LB_NOT_USED:
case MS_LB_NOT_USED_ERASED:
Count++;
+ break;
default:
break;
}
@@ -690,6 +690,7 @@ static int uas_queuecommand_lck(struct scsi_cmnd *cmnd,
fallthrough;
case DMA_TO_DEVICE:
cmdinfo->state |= ALLOC_DATA_OUT_URB | SUBMIT_DATA_OUT_URB;
+ break;
case DMA_NONE:
break;
}
In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding multiple break/return/fallthrough statements instead of letting the code fall through to the next case. Link: https://github.com/KSPP/linux/issues/115 Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org> --- drivers/usb/gadget/function/f_fs.c | 2 ++ drivers/usb/gadget/function/f_loopback.c | 2 +- drivers/usb/gadget/function/f_sourcesink.c | 1 + drivers/usb/gadget/udc/dummy_hcd.c | 2 ++ drivers/usb/host/fotg210-hcd.c | 2 +- drivers/usb/host/isp116x-hcd.c | 1 + drivers/usb/host/max3421-hcd.c | 1 + drivers/usb/host/oxu210hp-hcd.c | 1 + drivers/usb/misc/yurex.c | 1 + drivers/usb/musb/tusb6010.c | 1 + drivers/usb/storage/ene_ub6250.c | 1 + drivers/usb/storage/uas.c | 1 + 12 files changed, 14 insertions(+), 2 deletions(-)