提交 93c747ed 编写于 作者: G Gustavo A. R. Silva 提交者: Greg Kroah-Hartman

usb: Fix fall-through warnings for Clang

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/115Signed-off-by: NGustavo A. R. Silva <gustavoars@kernel.org>
Link: https://lore.kernel.org/r/a76da7ca5b4f41c13d27b298accb8222d0b04e61.1605896060.git.gustavoars@kernel.orgSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 52a0372a
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册