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

usb: 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/20200707195607.GA4198@embeddedorSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4e71e079
...@@ -408,7 +408,7 @@ static ssize_t adsl_state_store(struct device *dev, ...@@ -408,7 +408,7 @@ static ssize_t adsl_state_store(struct device *dev,
case CXPOLL_STOPPING: case CXPOLL_STOPPING:
/* abort stop request */ /* abort stop request */
instance->poll_state = CXPOLL_POLLING; instance->poll_state = CXPOLL_POLLING;
/* fall through */ fallthrough;
case CXPOLL_POLLING: case CXPOLL_POLLING:
case CXPOLL_SHUTDOWN: case CXPOLL_SHUTDOWN:
/* don't start polling */ /* don't start polling */
...@@ -802,7 +802,7 @@ static int cxacru_atm_start(struct usbatm_data *usbatm_instance, ...@@ -802,7 +802,7 @@ static int cxacru_atm_start(struct usbatm_data *usbatm_instance,
case CXPOLL_STOPPING: case CXPOLL_STOPPING:
/* abort stop request */ /* abort stop request */
instance->poll_state = CXPOLL_POLLING; instance->poll_state = CXPOLL_POLLING;
/* fall through */ fallthrough;
case CXPOLL_POLLING: case CXPOLL_POLLING:
case CXPOLL_SHUTDOWN: case CXPOLL_SHUTDOWN:
/* don't start polling */ /* don't start polling */
......
...@@ -2815,7 +2815,7 @@ static int cdns3_gadget_udc_start(struct usb_gadget *gadget, ...@@ -2815,7 +2815,7 @@ static int cdns3_gadget_udc_start(struct usb_gadget *gadget,
dev_err(priv_dev->dev, dev_err(priv_dev->dev,
"invalid maximum_speed parameter %d\n", "invalid maximum_speed parameter %d\n",
max_speed); max_speed);
/* fall through */ fallthrough;
case USB_SPEED_UNKNOWN: case USB_SPEED_UNKNOWN:
/* default to superspeed */ /* default to superspeed */
max_speed = USB_SPEED_SUPER; max_speed = USB_SPEED_SUPER;
...@@ -3056,7 +3056,7 @@ static int cdns3_gadget_start(struct cdns3 *cdns) ...@@ -3056,7 +3056,7 @@ static int cdns3_gadget_start(struct cdns3 *cdns)
default: default:
dev_err(cdns->dev, "invalid maximum_speed parameter %d\n", dev_err(cdns->dev, "invalid maximum_speed parameter %d\n",
max_speed); max_speed);
/* fall through */ fallthrough;
case USB_SPEED_UNKNOWN: case USB_SPEED_UNKNOWN:
/* default to superspeed */ /* default to superspeed */
max_speed = USB_SPEED_SUPER; max_speed = USB_SPEED_SUPER;
......
...@@ -2282,7 +2282,7 @@ static void usbtmc_interrupt(struct urb *urb) ...@@ -2282,7 +2282,7 @@ static void usbtmc_interrupt(struct urb *urb)
case -EOVERFLOW: case -EOVERFLOW:
dev_err(dev, "overflow with length %d, actual length is %d\n", dev_err(dev, "overflow with length %d, actual length is %d\n",
data->iin_wMaxPacketSize, urb->actual_length); data->iin_wMaxPacketSize, urb->actual_length);
/* fall through */ fallthrough;
case -ECONNRESET: case -ECONNRESET:
case -ENOENT: case -ENOENT:
case -ESHUTDOWN: case -ESHUTDOWN:
......
...@@ -427,7 +427,7 @@ static int usb_parse_endpoint(struct device *ddev, int cfgno, ...@@ -427,7 +427,7 @@ static int usb_parse_endpoint(struct device *ddev, int cfgno,
i = maxp & (BIT(12) | BIT(11)); i = maxp & (BIT(12) | BIT(11));
maxp &= ~i; maxp &= ~i;
} }
/* fallthrough */ fallthrough;
default: default:
maxpacket_maxes = high_speed_maxpacket_maxes; maxpacket_maxes = high_speed_maxpacket_maxes;
break; break;
......
...@@ -564,7 +564,7 @@ static int rh_call_control (struct usb_hcd *hcd, struct urb *urb) ...@@ -564,7 +564,7 @@ static int rh_call_control (struct usb_hcd *hcd, struct urb *urb)
case DeviceRequest | USB_REQ_GET_CONFIGURATION: case DeviceRequest | USB_REQ_GET_CONFIGURATION:
tbuf[0] = 1; tbuf[0] = 1;
len = 1; len = 1;
/* FALLTHROUGH */ fallthrough;
case DeviceOutRequest | USB_REQ_SET_CONFIGURATION: case DeviceOutRequest | USB_REQ_SET_CONFIGURATION:
break; break;
case DeviceRequest | USB_REQ_GET_DESCRIPTOR: case DeviceRequest | USB_REQ_GET_DESCRIPTOR:
...@@ -633,7 +633,7 @@ static int rh_call_control (struct usb_hcd *hcd, struct urb *urb) ...@@ -633,7 +633,7 @@ static int rh_call_control (struct usb_hcd *hcd, struct urb *urb)
case DeviceRequest | USB_REQ_GET_INTERFACE: case DeviceRequest | USB_REQ_GET_INTERFACE:
tbuf[0] = 0; tbuf[0] = 0;
len = 1; len = 1;
/* FALLTHROUGH */ fallthrough;
case DeviceOutRequest | USB_REQ_SET_INTERFACE: case DeviceOutRequest | USB_REQ_SET_INTERFACE:
break; break;
case DeviceOutRequest | USB_REQ_SET_ADDRESS: case DeviceOutRequest | USB_REQ_SET_ADDRESS:
...@@ -651,7 +651,7 @@ static int rh_call_control (struct usb_hcd *hcd, struct urb *urb) ...@@ -651,7 +651,7 @@ static int rh_call_control (struct usb_hcd *hcd, struct urb *urb)
tbuf[0] = 0; tbuf[0] = 0;
tbuf[1] = 0; tbuf[1] = 0;
len = 2; len = 2;
/* FALLTHROUGH */ fallthrough;
case EndpointOutRequest | USB_REQ_CLEAR_FEATURE: case EndpointOutRequest | USB_REQ_CLEAR_FEATURE:
case EndpointOutRequest | USB_REQ_SET_FEATURE: case EndpointOutRequest | USB_REQ_SET_FEATURE:
dev_dbg (hcd->self.controller, "no endpoint features yet\n"); dev_dbg (hcd->self.controller, "no endpoint features yet\n");
...@@ -2726,7 +2726,7 @@ int usb_add_hcd(struct usb_hcd *hcd, ...@@ -2726,7 +2726,7 @@ int usb_add_hcd(struct usb_hcd *hcd,
case HCD_USB32: case HCD_USB32:
rhdev->rx_lanes = 2; rhdev->rx_lanes = 2;
rhdev->tx_lanes = 2; rhdev->tx_lanes = 2;
/* fall through */ fallthrough;
case HCD_USB31: case HCD_USB31:
rhdev->speed = USB_SPEED_SUPER_PLUS; rhdev->speed = USB_SPEED_SUPER_PLUS;
break; break;
......
...@@ -4698,7 +4698,7 @@ hub_port_init(struct usb_hub *hub, struct usb_device *udev, int port1, ...@@ -4698,7 +4698,7 @@ hub_port_init(struct usb_hub *hub, struct usb_device *udev, int port1,
r = 0; r = 0;
break; break;
} }
/* FALL THROUGH */ fallthrough;
default: default:
if (r == 0) if (r == 0)
r = -EPROTO; r = -EPROTO;
......
...@@ -486,7 +486,7 @@ int usb_submit_urb(struct urb *urb, gfp_t mem_flags) ...@@ -486,7 +486,7 @@ int usb_submit_urb(struct urb *urb, gfp_t mem_flags)
case USB_ENDPOINT_XFER_INT: case USB_ENDPOINT_XFER_INT:
if (is_out) if (is_out)
allowed |= URB_ZERO_PACKET; allowed |= URB_ZERO_PACKET;
/* FALLTHROUGH */ fallthrough;
default: /* all non-iso endpoints */ default: /* all non-iso endpoints */
if (!is_out) if (!is_out)
allowed |= URB_SHORT_NOT_OK; allowed |= URB_SHORT_NOT_OK;
...@@ -519,7 +519,7 @@ int usb_submit_urb(struct urb *urb, gfp_t mem_flags) ...@@ -519,7 +519,7 @@ int usb_submit_urb(struct urb *urb, gfp_t mem_flags)
if ((urb->interval < 6) if ((urb->interval < 6)
&& (xfertype == USB_ENDPOINT_XFER_INT)) && (xfertype == USB_ENDPOINT_XFER_INT))
return -EINVAL; return -EINVAL;
/* fall through */ fallthrough;
default: default:
if (urb->interval <= 0) if (urb->interval <= 0)
return -EINVAL; return -EINVAL;
......
...@@ -2807,7 +2807,7 @@ static struct fotg210_qh *qh_make(struct fotg210_hcd *fotg210, struct urb *urb, ...@@ -2807,7 +2807,7 @@ static struct fotg210_qh *qh_make(struct fotg210_hcd *fotg210, struct urb *urb,
switch (urb->dev->speed) { switch (urb->dev->speed) {
case USB_SPEED_LOW: case USB_SPEED_LOW:
info1 |= QH_LOW_SPEED; info1 |= QH_LOW_SPEED;
/* FALL THROUGH */ fallthrough;
case USB_SPEED_FULL: case USB_SPEED_FULL:
/* EPS 0 means "full" */ /* EPS 0 means "full" */
...@@ -4634,7 +4634,7 @@ static inline int scan_frame_queue(struct fotg210_hcd *fotg210, unsigned frame, ...@@ -4634,7 +4634,7 @@ static inline int scan_frame_queue(struct fotg210_hcd *fotg210, unsigned frame,
default: default:
fotg210_dbg(fotg210, "corrupt type %d frame %d shadow %p\n", fotg210_dbg(fotg210, "corrupt type %d frame %d shadow %p\n",
type, frame, q.ptr); type, frame, q.ptr);
/* FALL THROUGH */ fallthrough;
case Q_TYPE_QH: case Q_TYPE_QH:
case Q_TYPE_FSTN: case Q_TYPE_FSTN:
/* End of the iTDs and siTDs */ /* End of the iTDs and siTDs */
...@@ -5411,7 +5411,7 @@ static void fotg210_endpoint_disable(struct usb_hcd *hcd, ...@@ -5411,7 +5411,7 @@ static void fotg210_endpoint_disable(struct usb_hcd *hcd,
*/ */
if (tmp) if (tmp)
start_unlink_async(fotg210, qh); start_unlink_async(fotg210, qh);
/* FALL THROUGH */ fallthrough;
case QH_STATE_UNLINK: /* wait for hw to finish? */ case QH_STATE_UNLINK: /* wait for hw to finish? */
case QH_STATE_UNLINK_WAIT: case QH_STATE_UNLINK_WAIT:
idle_timeout: idle_timeout:
...@@ -5425,7 +5425,7 @@ static void fotg210_endpoint_disable(struct usb_hcd *hcd, ...@@ -5425,7 +5425,7 @@ static void fotg210_endpoint_disable(struct usb_hcd *hcd,
qh_destroy(fotg210, qh); qh_destroy(fotg210, qh);
break; break;
} }
/* fall through */ fallthrough;
default: default:
/* caller was supposed to have unlinked any requests; /* caller was supposed to have unlinked any requests;
* that's not our job. just leak this memory. * that's not our job. just leak this memory.
......
...@@ -1748,7 +1748,7 @@ static int isp1362_bus_suspend(struct usb_hcd *hcd) ...@@ -1748,7 +1748,7 @@ static int isp1362_bus_suspend(struct usb_hcd *hcd)
isp1362_hcd->hc_control &= ~OHCI_CTRL_HCFS; isp1362_hcd->hc_control &= ~OHCI_CTRL_HCFS;
isp1362_hcd->hc_control |= OHCI_USB_RESET; isp1362_hcd->hc_control |= OHCI_USB_RESET;
isp1362_write_reg32(isp1362_hcd, HCCONTROL, isp1362_hcd->hc_control); isp1362_write_reg32(isp1362_hcd, HCCONTROL, isp1362_hcd->hc_control);
/* FALL THROUGH */ fallthrough;
case OHCI_USB_RESET: case OHCI_USB_RESET:
status = -EBUSY; status = -EBUSY;
pr_warn("%s: needs reinit!\n", __func__); pr_warn("%s: needs reinit!\n", __func__);
......
...@@ -925,7 +925,7 @@ max3421_handle_error(struct usb_hcd *hcd, u8 hrsl) ...@@ -925,7 +925,7 @@ max3421_handle_error(struct usb_hcd *hcd, u8 hrsl)
spi_wr8(hcd, MAX3421_REG_HCTL, spi_wr8(hcd, MAX3421_REG_HCTL,
BIT(sndtog + MAX3421_HCTL_SNDTOG0_BIT)); BIT(sndtog + MAX3421_HCTL_SNDTOG0_BIT));
} }
/* FALL THROUGH */ fallthrough;
case MAX3421_HRSL_BADBC: /* bad byte count */ case MAX3421_HRSL_BADBC: /* bad byte count */
case MAX3421_HRSL_PIDERR: /* received PID is corrupted */ case MAX3421_HRSL_PIDERR: /* received PID is corrupted */
case MAX3421_HRSL_PKTERR: /* packet error (stuff, EOP) */ case MAX3421_HRSL_PKTERR: /* packet error (stuff, EOP) */
...@@ -1715,7 +1715,7 @@ max3421_hub_control(struct usb_hcd *hcd, u16 type_req, u16 value, u16 index, ...@@ -1715,7 +1715,7 @@ max3421_hub_control(struct usb_hcd *hcd, u16 type_req, u16 value, u16 index,
dev_dbg(hcd->self.controller, "power-off\n"); dev_dbg(hcd->self.controller, "power-off\n");
max3421_gpout_set_value(hcd, pdata->vbus_gpout, max3421_gpout_set_value(hcd, pdata->vbus_gpout,
!pdata->vbus_active_level); !pdata->vbus_active_level);
/* FALLS THROUGH */ fallthrough;
default: default:
max3421_hcd->port_status &= ~(1 << value); max3421_hcd->port_status &= ~(1 << value);
} }
...@@ -1768,7 +1768,7 @@ max3421_hub_control(struct usb_hcd *hcd, u16 type_req, u16 value, u16 index, ...@@ -1768,7 +1768,7 @@ max3421_hub_control(struct usb_hcd *hcd, u16 type_req, u16 value, u16 index,
break; break;
case USB_PORT_FEAT_RESET: case USB_PORT_FEAT_RESET:
max3421_reset_port(hcd); max3421_reset_port(hcd);
/* FALLS THROUGH */ fallthrough;
default: default:
if ((max3421_hcd->port_status & USB_PORT_STAT_POWER) if ((max3421_hcd->port_status & USB_PORT_STAT_POWER)
!= 0) != 0)
......
...@@ -1858,7 +1858,7 @@ static struct ehci_qh *qh_make(struct oxu_hcd *oxu, ...@@ -1858,7 +1858,7 @@ static struct ehci_qh *qh_make(struct oxu_hcd *oxu,
switch (urb->dev->speed) { switch (urb->dev->speed) {
case USB_SPEED_LOW: case USB_SPEED_LOW:
info1 |= (1 << 12); /* EPS "low" */ info1 |= (1 << 12); /* EPS "low" */
/* FALL THROUGH */ fallthrough;
case USB_SPEED_FULL: case USB_SPEED_FULL:
/* EPS 0 means "full" */ /* EPS 0 means "full" */
...@@ -3377,7 +3377,7 @@ static int oxu_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status) ...@@ -3377,7 +3377,7 @@ static int oxu_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status)
switch (qh->qh_state) { switch (qh->qh_state) {
case QH_STATE_LINKED: case QH_STATE_LINKED:
intr_deschedule(oxu, qh); intr_deschedule(oxu, qh);
/* FALL THROUGH */ fallthrough;
case QH_STATE_IDLE: case QH_STATE_IDLE:
qh_completions(oxu, qh); qh_completions(oxu, qh);
break; break;
...@@ -3449,7 +3449,7 @@ static void oxu_endpoint_disable(struct usb_hcd *hcd, ...@@ -3449,7 +3449,7 @@ static void oxu_endpoint_disable(struct usb_hcd *hcd,
if (!tmp) if (!tmp)
goto nogood; goto nogood;
unlink_async(oxu, qh); unlink_async(oxu, qh);
/* FALL THROUGH */ fallthrough;
case QH_STATE_UNLINK: /* wait for hw to finish? */ case QH_STATE_UNLINK: /* wait for hw to finish? */
idle_timeout: idle_timeout:
spin_unlock_irqrestore(&oxu->lock, flags); spin_unlock_irqrestore(&oxu->lock, flags);
...@@ -3460,7 +3460,7 @@ static void oxu_endpoint_disable(struct usb_hcd *hcd, ...@@ -3460,7 +3460,7 @@ static void oxu_endpoint_disable(struct usb_hcd *hcd,
qh_put(qh); qh_put(qh);
break; break;
} }
/* fall through */ fallthrough;
default: default:
nogood: nogood:
/* caller was supposed to have unlinked any requests; /* caller was supposed to have unlinked any requests;
......
...@@ -880,7 +880,7 @@ static ssize_t mdc800_device_write (struct file *file, const char __user *buf, s ...@@ -880,7 +880,7 @@ static ssize_t mdc800_device_write (struct file *file, const char __user *buf, s
return -EIO; return -EIO;
} }
mdc800->pic_len=-1; mdc800->pic_len=-1;
/* fall through */ fallthrough;
case 0x09: /* Download Thumbnail */ case 0x09: /* Download Thumbnail */
mdc800->download_left=answersize+64; mdc800->download_left=answersize+64;
......
...@@ -788,11 +788,11 @@ static void collect_qtds(struct usb_hcd *hcd, struct isp1760_qh *qh, ...@@ -788,11 +788,11 @@ static void collect_qtds(struct usb_hcd *hcd, struct isp1760_qh *qh,
mem_reads8(hcd->regs, qtd->payload_addr, mem_reads8(hcd->regs, qtd->payload_addr,
qtd->data_buffer, qtd->data_buffer,
qtd->actual_length); qtd->actual_length);
/* Fall through */ fallthrough;
case OUT_PID: case OUT_PID:
qtd->urb->actual_length += qtd->urb->actual_length +=
qtd->actual_length; qtd->actual_length;
/* Fall through */ fallthrough;
case SETUP_PID: case SETUP_PID:
break; break;
} }
......
...@@ -89,7 +89,7 @@ static void appledisplay_complete(struct urb *urb) ...@@ -89,7 +89,7 @@ static void appledisplay_complete(struct urb *urb)
dev_err(dev, dev_err(dev,
"OVERFLOW with data length %d, actual length is %d\n", "OVERFLOW with data length %d, actual length is %d\n",
ACD_URB_BUFFER_LEN, pdata->urb->actual_length); ACD_URB_BUFFER_LEN, pdata->urb->actual_length);
/* fall through */ fallthrough;
case -ECONNRESET: case -ECONNRESET:
case -ENOENT: case -ENOENT:
case -ESHUTDOWN: case -ESHUTDOWN:
......
...@@ -182,7 +182,7 @@ get_endpoints(struct usbtest_dev *dev, struct usb_interface *intf) ...@@ -182,7 +182,7 @@ get_endpoints(struct usbtest_dev *dev, struct usb_interface *intf)
case USB_ENDPOINT_XFER_ISOC: case USB_ENDPOINT_XFER_ISOC:
if (dev->info->iso) if (dev->info->iso)
endpoint_update(edi, &iso_in, &iso_out, e); endpoint_update(edi, &iso_in, &iso_out, e);
/* FALLTHROUGH */ fallthrough;
default: default:
continue; continue;
} }
...@@ -364,7 +364,7 @@ static void simple_fill_buf(struct urb *urb) ...@@ -364,7 +364,7 @@ static void simple_fill_buf(struct urb *urb)
switch (pattern) { switch (pattern) {
default: default:
/* FALLTHROUGH */ fallthrough;
case 0: case 0:
memset(buf, 0, len); memset(buf, 0, len);
break; break;
...@@ -681,7 +681,7 @@ static int get_altsetting(struct usbtest_dev *dev) ...@@ -681,7 +681,7 @@ static int get_altsetting(struct usbtest_dev *dev)
return dev->buf[0]; return dev->buf[0];
case 0: case 0:
retval = -ERANGE; retval = -ERANGE;
/* FALLTHROUGH */ fallthrough;
default: default:
return retval; return retval;
} }
...@@ -1951,7 +1951,7 @@ static void complicated_callback(struct urb *urb) ...@@ -1951,7 +1951,7 @@ static void complicated_callback(struct urb *urb)
dev_err(&ctx->dev->intf->dev, dev_err(&ctx->dev->intf->dev,
"resubmit err %d\n", "resubmit err %d\n",
status); status);
/* FALLTHROUGH */ fallthrough;
case -ENODEV: /* disconnected */ case -ENODEV: /* disconnected */
case -ESHUTDOWN: /* endpoint disabled */ case -ESHUTDOWN: /* endpoint disabled */
ctx->submit_error = 1; ctx->submit_error = 1;
......
...@@ -472,7 +472,7 @@ static ssize_t yurex_write(struct file *file, const char __user *user_buffer, ...@@ -472,7 +472,7 @@ static ssize_t yurex_write(struct file *file, const char __user *user_buffer,
break; break;
case CMD_SET: case CMD_SET:
data++; data++;
/* FALL THROUGH */ fallthrough;
case '0' ... '9': case '0' ... '9':
set = 1; set = 1;
c = c2 = simple_strtoull(data, NULL, 0); c = c2 = simple_strtoull(data, NULL, 0);
......
...@@ -509,7 +509,7 @@ static int usbhsg_irq_ctrl_stage(struct usbhs_priv *priv, ...@@ -509,7 +509,7 @@ static int usbhsg_irq_ctrl_stage(struct usbhs_priv *priv,
case READ_STATUS_STAGE: case READ_STATUS_STAGE:
case WRITE_STATUS_STAGE: case WRITE_STATUS_STAGE:
usbhs_dcp_control_transfer_done(pipe); usbhs_dcp_control_transfer_done(pipe);
/* fall through */ fallthrough;
default: default:
return ret; return ret;
} }
......
...@@ -308,7 +308,7 @@ static void __usbhsp_pid_try_nak_if_stall(struct usbhs_pipe *pipe) ...@@ -308,7 +308,7 @@ static void __usbhsp_pid_try_nak_if_stall(struct usbhs_pipe *pipe)
switch (pid) { switch (pid) {
case PID_STALL11: case PID_STALL11:
usbhsp_pipectrl_set(pipe, PID_MASK, PID_STALL10); usbhsp_pipectrl_set(pipe, PID_MASK, PID_STALL10);
/* fall-through */ fallthrough;
case PID_STALL10: case PID_STALL10:
usbhsp_pipectrl_set(pipe, PID_MASK, PID_NAK); usbhsp_pipectrl_set(pipe, PID_MASK, PID_NAK);
} }
......
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