usb: gadget: Use fallthrough pseudo-keyword
Subsystems (2)
PATCH 1/1 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.
Signed-off-by Gustavo A. R. Silva <[email protected]>
--- drivers/usb/gadget/composite.c | 16 ++++++++-------- drivers/usb/gadget/function/f_fs.c | 2 +- drivers/usb/gadget/function/f_hid.c | 2 +- drivers/usb/gadget/function/f_mass_storage.c | 2 +- drivers/usb/gadget/function/f_phonet.c | 4 ++-- drivers/usb/gadget/function/f_printer.c | 6 +++--- drivers/usb/gadget/function/f_rndis.c | 2 +- drivers/usb/gadget/function/f_tcm.c | 2 +- drivers/usb/gadget/function/u_ether.c | 4 ++-- drivers/usb/gadget/function/u_serial.c | 6 +++--- drivers/usb/gadget/legacy/inode.c | 7 +++---- drivers/usb/gadget/udc/dummy_hcd.c | 12 ++++++------ drivers/usb/gadget/udc/goku_udc.c | 9 ++++++--- drivers/usb/gadget/udc/omap_udc.c | 4 ++-- drivers/usb/gadget/udc/s3c2410_udc.c | 4 ++-- drivers/usb/gadget/udc/tegra-xudc.c | 2 +- 16 files changed, 43 insertions(+), 41 deletions(-)
drivers/usb/gadget/composite.c +8 -8
@@ -72,17 +72,17 @@ function_descriptors(struct usb_function *f, descriptors = f->ssp_descriptors;if (descriptors)break ; -/* FALLTHROUGH */ + fallthrough;case USB_SPEED_SUPER : descriptors = f->ss_descriptors;if (descriptors)break ; -/* FALLTHROUGH */ + fallthrough;case USB_SPEED_HIGH : descriptors = f->hs_descriptors;if (descriptors)break ; -/* FALLTHROUGH */ + fallthrough;default : descriptors = f->fs_descriptors; }
@@ -170,20 +170,20 @@ int config_ep_by_speed_and_alt(struct usb_gadget *g, want_comp_desc =1 ;break ; } -/* fall through */ + fallthrough;case USB_SPEED_SUPER :if (gadget_is_superspeed (g)) { speed_desc = f->ss_descriptors; want_comp_desc =1 ;break ; } -/* fall through */ + fallthrough;case USB_SPEED_HIGH :if (gadget_is_dualspeed (g)) { speed_desc = f->hs_descriptors;break ; } -/* fall through */ + fallthrough;default : speed_desc = f->fs_descriptors; }
@@ -237,7 +237,7 @@ int config_ep_by_speed_and_alt(struct usb_gadget *g,case USB_ENDPOINT_XFER_ISOC :/* mult: bits 1:0 of bmAttributes */ _ep->mult = (comp_desc->bmAttributes &0x3 ) +1 ; -/* fall through */ + fallthrough;case USB_ENDPOINT_XFER_BULK :case USB_ENDPOINT_XFER_INT : _ep->maxburst = comp_desc->bMaxBurst +1 ;
@@ -1697,7 +1697,7 @@ composite_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)if (!gadget_is_dualspeed (gadget) || gadget->speed >=USB_SPEED_SUPER )break ; -/* FALLTHROUGH */ + fallthrough;case USB_DT_CONFIG : value =config_desc (cdev, w_value);if (value >=0 )
drivers/usb/gadget/function/f_fs.c +1 -1
@@ -2726,7 +2726,7 @@ static void __ffs_event_add(struct ffs_data *ffs,switch (type) {case FUNCTIONFS_RESUME : rem_type2 =FUNCTIONFS_SUSPEND ; -/* FALL THROUGH */ + fallthrough;case FUNCTIONFS_SUSPEND :case FUNCTIONFS_SETUP : rem_type1 = type;
drivers/usb/gadget/function/f_hid.c +1 -1
@@ -477,7 +477,7 @@ static void hidg_set_report_complete(struct usb_ep *ep, struct usb_request *req)break ;default :ERROR (cdev,"Set report failed %d\n" , req->status); -/* FALLTHROUGH */ + fallthrough;case -ECONNABORTED :/* hardware forced ep reset */ case -ECONNRESET :/* request dequeued */ case -ESHUTDOWN :/* disconnect from host */
drivers/usb/gadget/function/f_mass_storage.c +1 -1
@@ -2039,7 +2039,7 @@ static int do_scsi_command(struct fsg_common *common)case RELEASE :case RESERVE :case SEND_DIAGNOSTIC : -/* Fall through */ + fallthrough;default : unknown_cmnd:
drivers/usb/gadget/function/f_phonet.c +2 -2
@@ -212,7 +212,7 @@ static void pn_tx_complete(struct usb_ep *ep, struct usb_request *req)case -ESHUTDOWN :/* disconnected */ case -ECONNRESET :/* disabled */ dev->stats.tx_aborted_errors++; -/* fall through */ + fallthrough;default : dev->stats.tx_errors++; }
@@ -360,7 +360,7 @@ static void pn_rx_complete(struct usb_ep *ep, struct usb_request *req)/* Do resubmit in these cases: */ case -EOVERFLOW :/* request buffer overflow */ dev->stats.rx_over_errors++; -/* fall through */ + fallthrough;default : dev->stats.rx_errors++;break ;
drivers/usb/gadget/function/f_printer.c +3 -3
@@ -285,7 +285,7 @@ static void rx_complete(struct usb_ep *ep, struct usb_request *req)/* data overrun */ case -EOVERFLOW : -/* FALLTHROUGH */ + fallthrough;default :DBG (dev,"rx status %d\n" , status);
@@ -304,7 +304,7 @@ static void tx_complete(struct usb_ep *ep, struct usb_request *req)switch (req->status) {default :VDBG (dev,"tx err %d\n" , req->status); -/* FALLTHROUGH */ + fallthrough;case -ECONNRESET :/* unlink */ case -ESHUTDOWN :/* disconnect etc */ break ;
@@ -919,7 +919,7 @@ static bool gprinter_req_match(struct usb_function *f,if (!w_value && !w_length && !(USB_DIR_IN & ctrl->bRequestType))break ; -/* fall through */ + fallthrough;default :return false; }
drivers/usb/gadget/function/f_rndis.c +1 -1
@@ -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" , ep->name, status, req->actual, req->length); -/* FALLTHROUGH */ + fallthrough;case 0 :if (ep != rndis->notify)break ;
drivers/usb/gadget/function/f_tcm.c +1 -1
@@ -1150,7 +1150,7 @@ static int usbg_submit_command(struct f_uas *fu,default :pr_debug_once ("Unsupported prio_attr: %02x.\n" , cmd_iu->prio_attr); -/* fall through */ + fallthrough;case UAS_SIMPLE_TAG : cmd->prio_attr =TCM_SIMPLE_TAG ;break ;
drivers/usb/gadget/function/u_ether.c +2 -2
@@ -321,7 +321,7 @@ static void rx_complete(struct usb_ep *ep, struct usb_request *req)/* data overrun */ case -EOVERFLOW : dev->net->stats.rx_over_errors++; -/* FALLTHROUGH */ + fallthrough;default : dev->net->stats.rx_errors++;
@@ -444,7 +444,7 @@ static void tx_complete(struct usb_ep *ep, struct usb_request *req)default : dev->net->stats.tx_errors++;VDBG (dev,"tx err %d\n" , req->status); -/* FALLTHROUGH */ + fallthrough;case -ECONNRESET :/* unlink */ case -ESHUTDOWN :/* disconnect etc */ dev_kfree_skb_any (skb);
drivers/usb/gadget/function/u_serial.c +3 -3
@@ -386,7 +386,7 @@ static void gs_rx_push(struct work_struct *work)/* presumably a transient fault */ pr_warn ("ttyGS%d: unexpected RX status %d\n" , port->port_num, req->status); -/* FALLTHROUGH */ + fallthrough;case 0 :/* normal completion */ break ;
@@ -472,7 +472,7 @@ static void gs_write_complete(struct usb_ep *ep, struct usb_request *req)/* presumably a transient fault */ pr_warn ("%s: unexpected %s status %d\n" , __func__, ep->name, req->status); -/* FALL THROUGH */ + fallthrough;case 0 :/* normal completion */ gs_start_tx (port);
@@ -871,7 +871,7 @@ static void gs_console_complete_out(struct usb_ep *ep, struct usb_request *req)default :pr_warn ("%s: unexpected %s status %d\n" , __func__, ep->name, req->status); -/* fall through */ + fallthrough;case 0 :/* normal completion */ spin_lock (&cons->lock);
drivers/usb/gadget/legacy/inode.c +3 -4
@@ -312,7 +312,7 @@ get_ready_ep (unsigned f_flags, struct ep_data *epdata, bool is_write)case STATE_EP_READY :/* not configured yet */ if (is_write)return 0 ; -// FALLTHRU + fallthrough;case STATE_EP_UNBOUND :/* clean disconnect */ break ;// case STATE_EP_DISABLED: /* "can't happen" */
@@ -1084,7 +1084,7 @@ next_event (struct dev_data *dev, enum usb_gadgetfs_event_type type)case GADGETFS_DISCONNECT :if (dev->state ==STATE_DEV_SETUP ) dev->setup_abort =1 ; -// FALL THROUGH + fallthrough;case GADGETFS_CONNECT : dev->ev_next =0 ;break ;
@@ -1381,7 +1381,6 @@ gadgetfs_setup (struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)make_qualifier (dev);break ;case USB_DT_OTHER_SPEED_CONFIG : -// FALLTHROUGH case USB_DT_CONFIG : value = config_buf (dev, w_value >> 8,
@@ -1718,7 +1717,7 @@ gadgetfs_suspend (struct usb_gadget *gadget)case STATE_DEV_UNCONNECTED :next_event (dev,GADGETFS_SUSPEND );ep0_readable (dev); -/* FALLTHROUGH */ + fallthrough;default :break ; }
drivers/usb/gadget/udc/dummy_hcd.c +6 -6
@@ -567,12 +567,12 @@ static int dummy_enable(struct usb_ep *_ep,if (max <=1024 )break ;/* save a return statement */ -/* fall through */ + fallthrough;case USB_SPEED_FULL :if (max <=64 )break ;/* save a return statement */ -/* fall through */ + fallthrough;default :if (max <=8 )break ;
@@ -590,7 +590,7 @@ static int dummy_enable(struct usb_ep *_ep,if (max <=1024 )break ;/* save a return statement */ -/* fall through */ + fallthrough;case USB_SPEED_FULL :if (max <=1023 )break ;
@@ -1943,7 +1943,7 @@ static void dummy_timer(struct timer_list *t)* this almost certainly polls too fast. */ limit =max (limit,periodic_bytes (dum, ep)); -/* FALLTHROUGH */ + fallthrough;default : treat_control_like_bulk:
@@ -2252,7 +2252,7 @@ static int dummy_hub_control( "supported for USB 2.0 roothub\n"); goto error; } -/* FALLS THROUGH */ + fallthrough;case USB_PORT_FEAT_RESET :/* if it's already enabled, disable */ if (hcd->speed ==HCD_USB3 ) {
@@ -2276,7 +2276,7 @@ static int dummy_hub_control(* interval? Is it still 50msec as for HS? */ dum_hcd->re_timeout = jiffies +msecs_to_jiffies (50 ); -/* FALLS THROUGH */ + fallthrough;default :if (hcd->speed ==HCD_USB3 ) { if ((dum_hcd->port_status &
drivers/usb/gadget/udc/goku_udc.c +6 -3
@@ -125,11 +125,14 @@ goku_ep_enable(struct usb_ep *_ep, const struct usb_endpoint_descriptor *desc) max =get_unaligned_le16 (&desc->wMaxPacketSize);switch (max) {case 64 : - mode++;/* fall through */ + mode++; + fallthrough;case 32 : - mode++;/* fall through */ + mode++; + fallthrough;case 16 : - mode++;/* fall through */ + mode++; + fallthrough;case 8 : mode <<=3 ;break ;
drivers/usb/gadget/udc/omap_udc.c +2 -2
@@ -2831,7 +2831,7 @@ static int omap_udc_probe(struct platform_device *pdev) type ="integrated" ;break ; } -/* FALL THROUGH */ + fallthrough;case 3 :case 11 :case 16 :
@@ -2848,7 +2848,7 @@ static int omap_udc_probe(struct platform_device *pdev)case 14 :/* transceiverless */ if (cpu_is_omap1710 ()) goto bad_on_1710; -/* FALL THROUGH */ + fallthrough;case 13 :case 15 : type ="no" ;
drivers/usb/gadget/udc/s3c2410_udc.c +2 -2
@@ -308,7 +308,7 @@ static int s3c2410_udc_write_fifo(struct s3c2410_ep *ep,switch (idx) {default : idx =0 ; -/* fall through */ + fallthrough;case 0 : fifo_reg =S3C2410_UDC_EP0_FIFO_REG ;break ;
@@ -413,7 +413,7 @@ static int s3c2410_udc_read_fifo(struct s3c2410_ep *ep,switch (idx) {default : idx =0 ; -/* fall through */ + fallthrough;case 0 : fifo_reg =S3C2410_UDC_EP0_FIFO_REG ;break ;
drivers/usb/gadget/udc/tegra-xudc.c +1 -1
@@ -2742,7 +2742,7 @@ static void tegra_xudc_handle_transfer_event(struct tegra_xudc *xudc,ep_wait_for_stopped (xudc, ep_index); ep->enq_ptr = ep->deq_ptr;tegra_xudc_ep_nuke (ep, -EIO ); -/* FALLTHROUGH */ + fallthrough;case TRB_CMPL_CODE_STREAM_NUMP_ERROR :case TRB_CMPL_CODE_CTRL_DIR_ERR :case TRB_CMPL_CODE_INVALID_STREAM_TYPE_ERR :