Commit a74005ab authored by Gustavo A. R. Silva's avatar Gustavo A. R. Silva Committed by Greg Kroah-Hartman

usb: gadget: Use fallthrough pseudo-keyword

Replace the existing /* fall through */ comments and its variants with
the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary
fall-through markings when it is the case.

[1] https://www.kernel.org/doc/html/latest/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-throughSigned-off-by: default avatarGustavo A. R. Silva <gustavoars@kernel.org>
Link: https://lore.kernel.org/r/20200707171500.GA13620@embeddedorSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 8b84724e
...@@ -72,17 +72,17 @@ function_descriptors(struct usb_function *f, ...@@ -72,17 +72,17 @@ function_descriptors(struct usb_function *f,
descriptors = f->ssp_descriptors; descriptors = f->ssp_descriptors;
if (descriptors) if (descriptors)
break; break;
/* FALLTHROUGH */ fallthrough;
case USB_SPEED_SUPER: case USB_SPEED_SUPER:
descriptors = f->ss_descriptors; descriptors = f->ss_descriptors;
if (descriptors) if (descriptors)
break; break;
/* FALLTHROUGH */ fallthrough;
case USB_SPEED_HIGH: case USB_SPEED_HIGH:
descriptors = f->hs_descriptors; descriptors = f->hs_descriptors;
if (descriptors) if (descriptors)
break; break;
/* FALLTHROUGH */ fallthrough;
default: default:
descriptors = f->fs_descriptors; descriptors = f->fs_descriptors;
} }
...@@ -170,20 +170,20 @@ int config_ep_by_speed_and_alt(struct usb_gadget *g, ...@@ -170,20 +170,20 @@ int config_ep_by_speed_and_alt(struct usb_gadget *g,
want_comp_desc = 1; want_comp_desc = 1;
break; break;
} }
/* fall through */ fallthrough;
case USB_SPEED_SUPER: case USB_SPEED_SUPER:
if (gadget_is_superspeed(g)) { if (gadget_is_superspeed(g)) {
speed_desc = f->ss_descriptors; speed_desc = f->ss_descriptors;
want_comp_desc = 1; want_comp_desc = 1;
break; break;
} }
/* fall through */ fallthrough;
case USB_SPEED_HIGH: case USB_SPEED_HIGH:
if (gadget_is_dualspeed(g)) { if (gadget_is_dualspeed(g)) {
speed_desc = f->hs_descriptors; speed_desc = f->hs_descriptors;
break; break;
} }
/* fall through */ fallthrough;
default: default:
speed_desc = f->fs_descriptors; speed_desc = f->fs_descriptors;
} }
...@@ -237,7 +237,7 @@ int config_ep_by_speed_and_alt(struct usb_gadget *g, ...@@ -237,7 +237,7 @@ int config_ep_by_speed_and_alt(struct usb_gadget *g,
case USB_ENDPOINT_XFER_ISOC: case USB_ENDPOINT_XFER_ISOC:
/* mult: bits 1:0 of bmAttributes */ /* mult: bits 1:0 of bmAttributes */
_ep->mult = (comp_desc->bmAttributes & 0x3) + 1; _ep->mult = (comp_desc->bmAttributes & 0x3) + 1;
/* fall through */ fallthrough;
case USB_ENDPOINT_XFER_BULK: case USB_ENDPOINT_XFER_BULK:
case USB_ENDPOINT_XFER_INT: case USB_ENDPOINT_XFER_INT:
_ep->maxburst = comp_desc->bMaxBurst + 1; _ep->maxburst = comp_desc->bMaxBurst + 1;
...@@ -1697,7 +1697,7 @@ composite_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl) ...@@ -1697,7 +1697,7 @@ composite_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
if (!gadget_is_dualspeed(gadget) || if (!gadget_is_dualspeed(gadget) ||
gadget->speed >= USB_SPEED_SUPER) gadget->speed >= USB_SPEED_SUPER)
break; break;
/* FALLTHROUGH */ fallthrough;
case USB_DT_CONFIG: case USB_DT_CONFIG:
value = config_desc(cdev, w_value); value = config_desc(cdev, w_value);
if (value >= 0) if (value >= 0)
......
...@@ -2726,7 +2726,7 @@ static void __ffs_event_add(struct ffs_data *ffs, ...@@ -2726,7 +2726,7 @@ static void __ffs_event_add(struct ffs_data *ffs,
switch (type) { switch (type) {
case FUNCTIONFS_RESUME: case FUNCTIONFS_RESUME:
rem_type2 = FUNCTIONFS_SUSPEND; rem_type2 = FUNCTIONFS_SUSPEND;
/* FALL THROUGH */ fallthrough;
case FUNCTIONFS_SUSPEND: case FUNCTIONFS_SUSPEND:
case FUNCTIONFS_SETUP: case FUNCTIONFS_SETUP:
rem_type1 = type; rem_type1 = type;
......
...@@ -477,7 +477,7 @@ static void hidg_set_report_complete(struct usb_ep *ep, struct usb_request *req) ...@@ -477,7 +477,7 @@ static void hidg_set_report_complete(struct usb_ep *ep, struct usb_request *req)
break; break;
default: default:
ERROR(cdev, "Set report failed %d\n", req->status); ERROR(cdev, "Set report failed %d\n", req->status);
/* FALLTHROUGH */ fallthrough;
case -ECONNABORTED: /* hardware forced ep reset */ case -ECONNABORTED: /* hardware forced ep reset */
case -ECONNRESET: /* request dequeued */ case -ECONNRESET: /* request dequeued */
case -ESHUTDOWN: /* disconnect from host */ case -ESHUTDOWN: /* disconnect from host */
......
...@@ -2039,7 +2039,7 @@ static int do_scsi_command(struct fsg_common *common) ...@@ -2039,7 +2039,7 @@ static int do_scsi_command(struct fsg_common *common)
case RELEASE: case RELEASE:
case RESERVE: case RESERVE:
case SEND_DIAGNOSTIC: case SEND_DIAGNOSTIC:
/* Fall through */ fallthrough;
default: default:
unknown_cmnd: unknown_cmnd:
......
...@@ -212,7 +212,7 @@ static void pn_tx_complete(struct usb_ep *ep, struct usb_request *req) ...@@ -212,7 +212,7 @@ static void pn_tx_complete(struct usb_ep *ep, struct usb_request *req)
case -ESHUTDOWN: /* disconnected */ case -ESHUTDOWN: /* disconnected */
case -ECONNRESET: /* disabled */ case -ECONNRESET: /* disabled */
dev->stats.tx_aborted_errors++; dev->stats.tx_aborted_errors++;
/* fall through */ fallthrough;
default: default:
dev->stats.tx_errors++; dev->stats.tx_errors++;
} }
...@@ -360,7 +360,7 @@ static void pn_rx_complete(struct usb_ep *ep, struct usb_request *req) ...@@ -360,7 +360,7 @@ static void pn_rx_complete(struct usb_ep *ep, struct usb_request *req)
/* Do resubmit in these cases: */ /* Do resubmit in these cases: */
case -EOVERFLOW: /* request buffer overflow */ case -EOVERFLOW: /* request buffer overflow */
dev->stats.rx_over_errors++; dev->stats.rx_over_errors++;
/* fall through */ fallthrough;
default: default:
dev->stats.rx_errors++; dev->stats.rx_errors++;
break; break;
......
...@@ -285,7 +285,7 @@ static void rx_complete(struct usb_ep *ep, struct usb_request *req) ...@@ -285,7 +285,7 @@ static void rx_complete(struct usb_ep *ep, struct usb_request *req)
/* data overrun */ /* data overrun */
case -EOVERFLOW: case -EOVERFLOW:
/* FALLTHROUGH */ fallthrough;
default: default:
DBG(dev, "rx status %d\n", status); DBG(dev, "rx status %d\n", status);
...@@ -304,7 +304,7 @@ static void tx_complete(struct usb_ep *ep, struct usb_request *req) ...@@ -304,7 +304,7 @@ static void tx_complete(struct usb_ep *ep, struct usb_request *req)
switch (req->status) { switch (req->status) {
default: default:
VDBG(dev, "tx err %d\n", req->status); VDBG(dev, "tx err %d\n", req->status);
/* FALLTHROUGH */ fallthrough;
case -ECONNRESET: /* unlink */ case -ECONNRESET: /* unlink */
case -ESHUTDOWN: /* disconnect etc */ case -ESHUTDOWN: /* disconnect etc */
break; break;
...@@ -919,7 +919,7 @@ static bool gprinter_req_match(struct usb_function *f, ...@@ -919,7 +919,7 @@ static bool gprinter_req_match(struct usb_function *f,
if (!w_value && !w_length && if (!w_value && !w_length &&
!(USB_DIR_IN & ctrl->bRequestType)) !(USB_DIR_IN & ctrl->bRequestType))
break; break;
/* fall through */ fallthrough;
default: default:
return false; return false;
} }
......
...@@ -426,7 +426,7 @@ static void rndis_response_complete(struct usb_ep *ep, struct usb_request *req) ...@@ -426,7 +426,7 @@ static void rndis_response_complete(struct usb_ep *ep, struct usb_request *req)
DBG(cdev, "RNDIS %s response error %d, %d/%d\n", DBG(cdev, "RNDIS %s response error %d, %d/%d\n",
ep->name, status, ep->name, status,
req->actual, req->length); req->actual, req->length);
/* FALLTHROUGH */ fallthrough;
case 0: case 0:
if (ep != rndis->notify) if (ep != rndis->notify)
break; break;
......
...@@ -1150,7 +1150,7 @@ static int usbg_submit_command(struct f_uas *fu, ...@@ -1150,7 +1150,7 @@ static int usbg_submit_command(struct f_uas *fu,
default: default:
pr_debug_once("Unsupported prio_attr: %02x.\n", pr_debug_once("Unsupported prio_attr: %02x.\n",
cmd_iu->prio_attr); cmd_iu->prio_attr);
/* fall through */ fallthrough;
case UAS_SIMPLE_TAG: case UAS_SIMPLE_TAG:
cmd->prio_attr = TCM_SIMPLE_TAG; cmd->prio_attr = TCM_SIMPLE_TAG;
break; break;
......
...@@ -321,7 +321,7 @@ static void rx_complete(struct usb_ep *ep, struct usb_request *req) ...@@ -321,7 +321,7 @@ static void rx_complete(struct usb_ep *ep, struct usb_request *req)
/* data overrun */ /* data overrun */
case -EOVERFLOW: case -EOVERFLOW:
dev->net->stats.rx_over_errors++; dev->net->stats.rx_over_errors++;
/* FALLTHROUGH */ fallthrough;
default: default:
dev->net->stats.rx_errors++; dev->net->stats.rx_errors++;
...@@ -444,7 +444,7 @@ static void tx_complete(struct usb_ep *ep, struct usb_request *req) ...@@ -444,7 +444,7 @@ static void tx_complete(struct usb_ep *ep, struct usb_request *req)
default: default:
dev->net->stats.tx_errors++; dev->net->stats.tx_errors++;
VDBG(dev, "tx err %d\n", req->status); VDBG(dev, "tx err %d\n", req->status);
/* FALLTHROUGH */ fallthrough;
case -ECONNRESET: /* unlink */ case -ECONNRESET: /* unlink */
case -ESHUTDOWN: /* disconnect etc */ case -ESHUTDOWN: /* disconnect etc */
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
......
...@@ -386,7 +386,7 @@ static void gs_rx_push(struct work_struct *work) ...@@ -386,7 +386,7 @@ static void gs_rx_push(struct work_struct *work)
/* presumably a transient fault */ /* presumably a transient fault */
pr_warn("ttyGS%d: unexpected RX status %d\n", pr_warn("ttyGS%d: unexpected RX status %d\n",
port->port_num, req->status); port->port_num, req->status);
/* FALLTHROUGH */ fallthrough;
case 0: case 0:
/* normal completion */ /* normal completion */
break; break;
...@@ -472,7 +472,7 @@ static void gs_write_complete(struct usb_ep *ep, struct usb_request *req) ...@@ -472,7 +472,7 @@ static void gs_write_complete(struct usb_ep *ep, struct usb_request *req)
/* presumably a transient fault */ /* presumably a transient fault */
pr_warn("%s: unexpected %s status %d\n", pr_warn("%s: unexpected %s status %d\n",
__func__, ep->name, req->status); __func__, ep->name, req->status);
/* FALL THROUGH */ fallthrough;
case 0: case 0:
/* normal completion */ /* normal completion */
gs_start_tx(port); gs_start_tx(port);
...@@ -871,7 +871,7 @@ static void gs_console_complete_out(struct usb_ep *ep, struct usb_request *req) ...@@ -871,7 +871,7 @@ static void gs_console_complete_out(struct usb_ep *ep, struct usb_request *req)
default: default:
pr_warn("%s: unexpected %s status %d\n", pr_warn("%s: unexpected %s status %d\n",
__func__, ep->name, req->status); __func__, ep->name, req->status);
/* fall through */ fallthrough;
case 0: case 0:
/* normal completion */ /* normal completion */
spin_lock(&cons->lock); spin_lock(&cons->lock);
......
...@@ -312,7 +312,7 @@ get_ready_ep (unsigned f_flags, struct ep_data *epdata, bool is_write) ...@@ -312,7 +312,7 @@ get_ready_ep (unsigned f_flags, struct ep_data *epdata, bool is_write)
case STATE_EP_READY: /* not configured yet */ case STATE_EP_READY: /* not configured yet */
if (is_write) if (is_write)
return 0; return 0;
// FALLTHRU fallthrough;
case STATE_EP_UNBOUND: /* clean disconnect */ case STATE_EP_UNBOUND: /* clean disconnect */
break; break;
// case STATE_EP_DISABLED: /* "can't happen" */ // case STATE_EP_DISABLED: /* "can't happen" */
...@@ -1084,7 +1084,7 @@ next_event (struct dev_data *dev, enum usb_gadgetfs_event_type type) ...@@ -1084,7 +1084,7 @@ next_event (struct dev_data *dev, enum usb_gadgetfs_event_type type)
case GADGETFS_DISCONNECT: case GADGETFS_DISCONNECT:
if (dev->state == STATE_DEV_SETUP) if (dev->state == STATE_DEV_SETUP)
dev->setup_abort = 1; dev->setup_abort = 1;
// FALL THROUGH fallthrough;
case GADGETFS_CONNECT: case GADGETFS_CONNECT:
dev->ev_next = 0; dev->ev_next = 0;
break; break;
...@@ -1381,7 +1381,6 @@ gadgetfs_setup (struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl) ...@@ -1381,7 +1381,6 @@ gadgetfs_setup (struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
make_qualifier (dev); make_qualifier (dev);
break; break;
case USB_DT_OTHER_SPEED_CONFIG: case USB_DT_OTHER_SPEED_CONFIG:
// FALLTHROUGH
case USB_DT_CONFIG: case USB_DT_CONFIG:
value = config_buf (dev, value = config_buf (dev,
w_value >> 8, w_value >> 8,
...@@ -1718,7 +1717,7 @@ gadgetfs_suspend (struct usb_gadget *gadget) ...@@ -1718,7 +1717,7 @@ gadgetfs_suspend (struct usb_gadget *gadget)
case STATE_DEV_UNCONNECTED: case STATE_DEV_UNCONNECTED:
next_event (dev, GADGETFS_SUSPEND); next_event (dev, GADGETFS_SUSPEND);
ep0_readable (dev); ep0_readable (dev);
/* FALLTHROUGH */ fallthrough;
default: default:
break; break;
} }
......
...@@ -567,12 +567,12 @@ static int dummy_enable(struct usb_ep *_ep, ...@@ -567,12 +567,12 @@ static int dummy_enable(struct usb_ep *_ep,
if (max <= 1024) if (max <= 1024)
break; break;
/* save a return statement */ /* save a return statement */
/* fall through */ fallthrough;
case USB_SPEED_FULL: case USB_SPEED_FULL:
if (max <= 64) if (max <= 64)
break; break;
/* save a return statement */ /* save a return statement */
/* fall through */ fallthrough;
default: default:
if (max <= 8) if (max <= 8)
break; break;
...@@ -590,7 +590,7 @@ static int dummy_enable(struct usb_ep *_ep, ...@@ -590,7 +590,7 @@ static int dummy_enable(struct usb_ep *_ep,
if (max <= 1024) if (max <= 1024)
break; break;
/* save a return statement */ /* save a return statement */
/* fall through */ fallthrough;
case USB_SPEED_FULL: case USB_SPEED_FULL:
if (max <= 1023) if (max <= 1023)
break; break;
...@@ -1943,7 +1943,7 @@ static void dummy_timer(struct timer_list *t) ...@@ -1943,7 +1943,7 @@ static void dummy_timer(struct timer_list *t)
* this almost certainly polls too fast. * this almost certainly polls too fast.
*/ */
limit = max(limit, periodic_bytes(dum, ep)); limit = max(limit, periodic_bytes(dum, ep));
/* FALLTHROUGH */ fallthrough;
default: default:
treat_control_like_bulk: treat_control_like_bulk:
...@@ -2252,7 +2252,7 @@ static int dummy_hub_control( ...@@ -2252,7 +2252,7 @@ static int dummy_hub_control(
"supported for USB 2.0 roothub\n"); "supported for USB 2.0 roothub\n");
goto error; goto error;
} }
/* FALLS THROUGH */ fallthrough;
case USB_PORT_FEAT_RESET: case USB_PORT_FEAT_RESET:
/* if it's already enabled, disable */ /* if it's already enabled, disable */
if (hcd->speed == HCD_USB3) { if (hcd->speed == HCD_USB3) {
...@@ -2276,7 +2276,7 @@ static int dummy_hub_control( ...@@ -2276,7 +2276,7 @@ static int dummy_hub_control(
* interval? Is it still 50msec as for HS? * interval? Is it still 50msec as for HS?
*/ */
dum_hcd->re_timeout = jiffies + msecs_to_jiffies(50); dum_hcd->re_timeout = jiffies + msecs_to_jiffies(50);
/* FALLS THROUGH */ fallthrough;
default: default:
if (hcd->speed == HCD_USB3) { if (hcd->speed == HCD_USB3) {
if ((dum_hcd->port_status & if ((dum_hcd->port_status &
......
...@@ -125,11 +125,14 @@ goku_ep_enable(struct usb_ep *_ep, const struct usb_endpoint_descriptor *desc) ...@@ -125,11 +125,14 @@ goku_ep_enable(struct usb_ep *_ep, const struct usb_endpoint_descriptor *desc)
max = get_unaligned_le16(&desc->wMaxPacketSize); max = get_unaligned_le16(&desc->wMaxPacketSize);
switch (max) { switch (max) {
case 64: case 64:
mode++; /* fall through */ mode++;
fallthrough;
case 32: case 32:
mode++; /* fall through */ mode++;
fallthrough;
case 16: case 16:
mode++; /* fall through */ mode++;
fallthrough;
case 8: case 8:
mode <<= 3; mode <<= 3;
break; break;
......
...@@ -2831,7 +2831,7 @@ static int omap_udc_probe(struct platform_device *pdev) ...@@ -2831,7 +2831,7 @@ static int omap_udc_probe(struct platform_device *pdev)
type = "integrated"; type = "integrated";
break; break;
} }
/* FALL THROUGH */ fallthrough;
case 3: case 3:
case 11: case 11:
case 16: case 16:
...@@ -2848,7 +2848,7 @@ static int omap_udc_probe(struct platform_device *pdev) ...@@ -2848,7 +2848,7 @@ static int omap_udc_probe(struct platform_device *pdev)
case 14: /* transceiverless */ case 14: /* transceiverless */
if (cpu_is_omap1710()) if (cpu_is_omap1710())
goto bad_on_1710; goto bad_on_1710;
/* FALL THROUGH */ fallthrough;
case 13: case 13:
case 15: case 15:
type = "no"; type = "no";
......
...@@ -308,7 +308,7 @@ static int s3c2410_udc_write_fifo(struct s3c2410_ep *ep, ...@@ -308,7 +308,7 @@ static int s3c2410_udc_write_fifo(struct s3c2410_ep *ep,
switch (idx) { switch (idx) {
default: default:
idx = 0; idx = 0;
/* fall through */ fallthrough;
case 0: case 0:
fifo_reg = S3C2410_UDC_EP0_FIFO_REG; fifo_reg = S3C2410_UDC_EP0_FIFO_REG;
break; break;
...@@ -413,7 +413,7 @@ static int s3c2410_udc_read_fifo(struct s3c2410_ep *ep, ...@@ -413,7 +413,7 @@ static int s3c2410_udc_read_fifo(struct s3c2410_ep *ep,
switch (idx) { switch (idx) {
default: default:
idx = 0; idx = 0;
/* fall through */ fallthrough;
case 0: case 0:
fifo_reg = S3C2410_UDC_EP0_FIFO_REG; fifo_reg = S3C2410_UDC_EP0_FIFO_REG;
break; break;
......
...@@ -2742,7 +2742,7 @@ static void tegra_xudc_handle_transfer_event(struct tegra_xudc *xudc, ...@@ -2742,7 +2742,7 @@ static void tegra_xudc_handle_transfer_event(struct tegra_xudc *xudc,
ep_wait_for_stopped(xudc, ep_index); ep_wait_for_stopped(xudc, ep_index);
ep->enq_ptr = ep->deq_ptr; ep->enq_ptr = ep->deq_ptr;
tegra_xudc_ep_nuke(ep, -EIO); tegra_xudc_ep_nuke(ep, -EIO);
/* FALLTHROUGH */ fallthrough;
case TRB_CMPL_CODE_STREAM_NUMP_ERROR: case TRB_CMPL_CODE_STREAM_NUMP_ERROR:
case TRB_CMPL_CODE_CTRL_DIR_ERR: case TRB_CMPL_CODE_CTRL_DIR_ERR:
case TRB_CMPL_CODE_INVALID_STREAM_TYPE_ERR: case TRB_CMPL_CODE_INVALID_STREAM_TYPE_ERR:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment