Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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-through

Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Link: https://lore.kernel.org/r/20200707171500.GA13620@embeddedor
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Gustavo A. R. Silva and committed by
Greg Kroah-Hartman
a74005ab 8b84724e

+43 -41
+8 -8
drivers/usb/gadget/composite.c
··· 72 72 descriptors = f->ssp_descriptors; 73 73 if (descriptors) 74 74 break; 75 - /* FALLTHROUGH */ 75 + fallthrough; 76 76 case USB_SPEED_SUPER: 77 77 descriptors = f->ss_descriptors; 78 78 if (descriptors) 79 79 break; 80 - /* FALLTHROUGH */ 80 + fallthrough; 81 81 case USB_SPEED_HIGH: 82 82 descriptors = f->hs_descriptors; 83 83 if (descriptors) 84 84 break; 85 - /* FALLTHROUGH */ 85 + fallthrough; 86 86 default: 87 87 descriptors = f->fs_descriptors; 88 88 } ··· 170 170 want_comp_desc = 1; 171 171 break; 172 172 } 173 - /* fall through */ 173 + fallthrough; 174 174 case USB_SPEED_SUPER: 175 175 if (gadget_is_superspeed(g)) { 176 176 speed_desc = f->ss_descriptors; 177 177 want_comp_desc = 1; 178 178 break; 179 179 } 180 - /* fall through */ 180 + fallthrough; 181 181 case USB_SPEED_HIGH: 182 182 if (gadget_is_dualspeed(g)) { 183 183 speed_desc = f->hs_descriptors; 184 184 break; 185 185 } 186 - /* fall through */ 186 + fallthrough; 187 187 default: 188 188 speed_desc = f->fs_descriptors; 189 189 } ··· 237 237 case USB_ENDPOINT_XFER_ISOC: 238 238 /* mult: bits 1:0 of bmAttributes */ 239 239 _ep->mult = (comp_desc->bmAttributes & 0x3) + 1; 240 - /* fall through */ 240 + fallthrough; 241 241 case USB_ENDPOINT_XFER_BULK: 242 242 case USB_ENDPOINT_XFER_INT: 243 243 _ep->maxburst = comp_desc->bMaxBurst + 1; ··· 1697 1697 if (!gadget_is_dualspeed(gadget) || 1698 1698 gadget->speed >= USB_SPEED_SUPER) 1699 1699 break; 1700 - /* FALLTHROUGH */ 1700 + fallthrough; 1701 1701 case USB_DT_CONFIG: 1702 1702 value = config_desc(cdev, w_value); 1703 1703 if (value >= 0)
+1 -1
drivers/usb/gadget/function/f_fs.c
··· 2726 2726 switch (type) { 2727 2727 case FUNCTIONFS_RESUME: 2728 2728 rem_type2 = FUNCTIONFS_SUSPEND; 2729 - /* FALL THROUGH */ 2729 + fallthrough; 2730 2730 case FUNCTIONFS_SUSPEND: 2731 2731 case FUNCTIONFS_SETUP: 2732 2732 rem_type1 = type;
+1 -1
drivers/usb/gadget/function/f_hid.c
··· 477 477 break; 478 478 default: 479 479 ERROR(cdev, "Set report failed %d\n", req->status); 480 - /* FALLTHROUGH */ 480 + fallthrough; 481 481 case -ECONNABORTED: /* hardware forced ep reset */ 482 482 case -ECONNRESET: /* request dequeued */ 483 483 case -ESHUTDOWN: /* disconnect from host */
+1 -1
drivers/usb/gadget/function/f_mass_storage.c
··· 2039 2039 case RELEASE: 2040 2040 case RESERVE: 2041 2041 case SEND_DIAGNOSTIC: 2042 - /* Fall through */ 2042 + fallthrough; 2043 2043 2044 2044 default: 2045 2045 unknown_cmnd:
+2 -2
drivers/usb/gadget/function/f_phonet.c
··· 212 212 case -ESHUTDOWN: /* disconnected */ 213 213 case -ECONNRESET: /* disabled */ 214 214 dev->stats.tx_aborted_errors++; 215 - /* fall through */ 215 + fallthrough; 216 216 default: 217 217 dev->stats.tx_errors++; 218 218 } ··· 360 360 /* Do resubmit in these cases: */ 361 361 case -EOVERFLOW: /* request buffer overflow */ 362 362 dev->stats.rx_over_errors++; 363 - /* fall through */ 363 + fallthrough; 364 364 default: 365 365 dev->stats.rx_errors++; 366 366 break;
+3 -3
drivers/usb/gadget/function/f_printer.c
··· 285 285 286 286 /* data overrun */ 287 287 case -EOVERFLOW: 288 - /* FALLTHROUGH */ 288 + fallthrough; 289 289 290 290 default: 291 291 DBG(dev, "rx status %d\n", status); ··· 304 304 switch (req->status) { 305 305 default: 306 306 VDBG(dev, "tx err %d\n", req->status); 307 - /* FALLTHROUGH */ 307 + fallthrough; 308 308 case -ECONNRESET: /* unlink */ 309 309 case -ESHUTDOWN: /* disconnect etc */ 310 310 break; ··· 919 919 if (!w_value && !w_length && 920 920 !(USB_DIR_IN & ctrl->bRequestType)) 921 921 break; 922 - /* fall through */ 922 + fallthrough; 923 923 default: 924 924 return false; 925 925 }
+1 -1
drivers/usb/gadget/function/f_rndis.c
··· 426 426 DBG(cdev, "RNDIS %s response error %d, %d/%d\n", 427 427 ep->name, status, 428 428 req->actual, req->length); 429 - /* FALLTHROUGH */ 429 + fallthrough; 430 430 case 0: 431 431 if (ep != rndis->notify) 432 432 break;
+1 -1
drivers/usb/gadget/function/f_tcm.c
··· 1150 1150 default: 1151 1151 pr_debug_once("Unsupported prio_attr: %02x.\n", 1152 1152 cmd_iu->prio_attr); 1153 - /* fall through */ 1153 + fallthrough; 1154 1154 case UAS_SIMPLE_TAG: 1155 1155 cmd->prio_attr = TCM_SIMPLE_TAG; 1156 1156 break;
+2 -2
drivers/usb/gadget/function/u_ether.c
··· 321 321 /* data overrun */ 322 322 case -EOVERFLOW: 323 323 dev->net->stats.rx_over_errors++; 324 - /* FALLTHROUGH */ 324 + fallthrough; 325 325 326 326 default: 327 327 dev->net->stats.rx_errors++; ··· 444 444 default: 445 445 dev->net->stats.tx_errors++; 446 446 VDBG(dev, "tx err %d\n", req->status); 447 - /* FALLTHROUGH */ 447 + fallthrough; 448 448 case -ECONNRESET: /* unlink */ 449 449 case -ESHUTDOWN: /* disconnect etc */ 450 450 dev_kfree_skb_any(skb);
+3 -3
drivers/usb/gadget/function/u_serial.c
··· 386 386 /* presumably a transient fault */ 387 387 pr_warn("ttyGS%d: unexpected RX status %d\n", 388 388 port->port_num, req->status); 389 - /* FALLTHROUGH */ 389 + fallthrough; 390 390 case 0: 391 391 /* normal completion */ 392 392 break; ··· 472 472 /* presumably a transient fault */ 473 473 pr_warn("%s: unexpected %s status %d\n", 474 474 __func__, ep->name, req->status); 475 - /* FALL THROUGH */ 475 + fallthrough; 476 476 case 0: 477 477 /* normal completion */ 478 478 gs_start_tx(port); ··· 871 871 default: 872 872 pr_warn("%s: unexpected %s status %d\n", 873 873 __func__, ep->name, req->status); 874 - /* fall through */ 874 + fallthrough; 875 875 case 0: 876 876 /* normal completion */ 877 877 spin_lock(&cons->lock);
+3 -4
drivers/usb/gadget/legacy/inode.c
··· 312 312 case STATE_EP_READY: /* not configured yet */ 313 313 if (is_write) 314 314 return 0; 315 - // FALLTHRU 315 + fallthrough; 316 316 case STATE_EP_UNBOUND: /* clean disconnect */ 317 317 break; 318 318 // case STATE_EP_DISABLED: /* "can't happen" */ ··· 1084 1084 case GADGETFS_DISCONNECT: 1085 1085 if (dev->state == STATE_DEV_SETUP) 1086 1086 dev->setup_abort = 1; 1087 - // FALL THROUGH 1087 + fallthrough; 1088 1088 case GADGETFS_CONNECT: 1089 1089 dev->ev_next = 0; 1090 1090 break; ··· 1381 1381 make_qualifier (dev); 1382 1382 break; 1383 1383 case USB_DT_OTHER_SPEED_CONFIG: 1384 - // FALLTHROUGH 1385 1384 case USB_DT_CONFIG: 1386 1385 value = config_buf (dev, 1387 1386 w_value >> 8, ··· 1717 1718 case STATE_DEV_UNCONNECTED: 1718 1719 next_event (dev, GADGETFS_SUSPEND); 1719 1720 ep0_readable (dev); 1720 - /* FALLTHROUGH */ 1721 + fallthrough; 1721 1722 default: 1722 1723 break; 1723 1724 }
+6 -6
drivers/usb/gadget/udc/dummy_hcd.c
··· 567 567 if (max <= 1024) 568 568 break; 569 569 /* save a return statement */ 570 - /* fall through */ 570 + fallthrough; 571 571 case USB_SPEED_FULL: 572 572 if (max <= 64) 573 573 break; 574 574 /* save a return statement */ 575 - /* fall through */ 575 + fallthrough; 576 576 default: 577 577 if (max <= 8) 578 578 break; ··· 590 590 if (max <= 1024) 591 591 break; 592 592 /* save a return statement */ 593 - /* fall through */ 593 + fallthrough; 594 594 case USB_SPEED_FULL: 595 595 if (max <= 1023) 596 596 break; ··· 1943 1943 * this almost certainly polls too fast. 1944 1944 */ 1945 1945 limit = max(limit, periodic_bytes(dum, ep)); 1946 - /* FALLTHROUGH */ 1946 + fallthrough; 1947 1947 1948 1948 default: 1949 1949 treat_control_like_bulk: ··· 2252 2252 "supported for USB 2.0 roothub\n"); 2253 2253 goto error; 2254 2254 } 2255 - /* FALLS THROUGH */ 2255 + fallthrough; 2256 2256 case USB_PORT_FEAT_RESET: 2257 2257 /* if it's already enabled, disable */ 2258 2258 if (hcd->speed == HCD_USB3) { ··· 2276 2276 * interval? Is it still 50msec as for HS? 2277 2277 */ 2278 2278 dum_hcd->re_timeout = jiffies + msecs_to_jiffies(50); 2279 - /* FALLS THROUGH */ 2279 + fallthrough; 2280 2280 default: 2281 2281 if (hcd->speed == HCD_USB3) { 2282 2282 if ((dum_hcd->port_status &
+6 -3
drivers/usb/gadget/udc/goku_udc.c
··· 125 125 max = get_unaligned_le16(&desc->wMaxPacketSize); 126 126 switch (max) { 127 127 case 64: 128 - mode++; /* fall through */ 128 + mode++; 129 + fallthrough; 129 130 case 32: 130 - mode++; /* fall through */ 131 + mode++; 132 + fallthrough; 131 133 case 16: 132 - mode++; /* fall through */ 134 + mode++; 135 + fallthrough; 133 136 case 8: 134 137 mode <<= 3; 135 138 break;
+2 -2
drivers/usb/gadget/udc/omap_udc.c
··· 2831 2831 type = "integrated"; 2832 2832 break; 2833 2833 } 2834 - /* FALL THROUGH */ 2834 + fallthrough; 2835 2835 case 3: 2836 2836 case 11: 2837 2837 case 16: ··· 2848 2848 case 14: /* transceiverless */ 2849 2849 if (cpu_is_omap1710()) 2850 2850 goto bad_on_1710; 2851 - /* FALL THROUGH */ 2851 + fallthrough; 2852 2852 case 13: 2853 2853 case 15: 2854 2854 type = "no";
+2 -2
drivers/usb/gadget/udc/s3c2410_udc.c
··· 308 308 switch (idx) { 309 309 default: 310 310 idx = 0; 311 - /* fall through */ 311 + fallthrough; 312 312 case 0: 313 313 fifo_reg = S3C2410_UDC_EP0_FIFO_REG; 314 314 break; ··· 413 413 switch (idx) { 414 414 default: 415 415 idx = 0; 416 - /* fall through */ 416 + fallthrough; 417 417 case 0: 418 418 fifo_reg = S3C2410_UDC_EP0_FIFO_REG; 419 419 break;
+1 -1
drivers/usb/gadget/udc/tegra-xudc.c
··· 2742 2742 ep_wait_for_stopped(xudc, ep_index); 2743 2743 ep->enq_ptr = ep->deq_ptr; 2744 2744 tegra_xudc_ep_nuke(ep, -EIO); 2745 - /* FALLTHROUGH */ 2745 + fallthrough; 2746 2746 case TRB_CMPL_CODE_STREAM_NUMP_ERROR: 2747 2747 case TRB_CMPL_CODE_CTRL_DIR_ERR: 2748 2748 case TRB_CMPL_CODE_INVALID_STREAM_TYPE_ERR: