USB: serial: use fallthrough pseudo-keyword
authorGustavo A. R. Silva <gustavoars@kernel.org>
Tue, 7 Jul 2020 19:57:47 +0000 (14:57 -0500)
committerJohan Hovold <johan@kernel.org>
Wed, 8 Jul 2020 12:55:35 +0000 (14:55 +0200)
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>
Signed-off-by: Johan Hovold <johan@kernel.org>
drivers/usb/serial/cypress_m8.c
drivers/usb/serial/io_edgeport.c
drivers/usb/serial/kobil_sct.c
drivers/usb/serial/upd78f0730.c

index 216edd5..53e3051 100644 (file)
@@ -1046,7 +1046,7 @@ static void cypress_read_int_callback(struct urb *urb)
                return;
        case -EPIPE:
                /* Can't call usb_clear_halt while in_interrupt */
-               /* FALLS THROUGH */
+               fallthrough;
        default:
                /* something ugly is going on... */
                dev_err(dev, "%s - unexpected nonzero read status received: %d\n",
@@ -1195,7 +1195,7 @@ static void cypress_write_int_callback(struct urb *urb)
                return;
        case -EPIPE:
                /* Cannot call usb_clear_halt while in_interrupt */
-               /* FALLTHROUGH */
+               fallthrough;
        default:
                dev_err(dev, "%s - unexpected nonzero write status received: %d\n",
                        __func__, status);
index 4cca0b8..ba5d8df 100644 (file)
@@ -1752,7 +1752,7 @@ static void process_rcvd_data(struct edgeport_serial *edge_serial,
                                edge_serial->rxState = EXPECT_HDR2;
                                break;
                        }
-                       /* Fall through */
+                       fallthrough;
                case EXPECT_HDR2:
                        edge_serial->rxHeader2 = *buffer;
                        ++buffer;
@@ -1804,7 +1804,7 @@ static void process_rcvd_data(struct edgeport_serial *edge_serial,
                                edge_serial->rxState = EXPECT_DATA;
                                break;
                        }
-                       /* Fall through */
+                       fallthrough;
                case EXPECT_DATA: /* Expect data */
                        if (bufferLength < edge_serial->rxBytesRemaining) {
                                rxLen = bufferLength;
index 79ce021..49aacb0 100644 (file)
@@ -499,7 +499,7 @@ static void kobil_set_termios(struct tty_struct *tty,
                break;
        default:
                speed = 9600;
-               /* fall through */
+               fallthrough;
        case 9600:
                urb_val = SUSBCR_SBR_9600;
                break;
index 1ba1401..0a2268c 100644 (file)
@@ -332,7 +332,7 @@ static void upd78f0730_set_termios(struct tty_struct *tty,
                tty->termios.c_cflag &= ~CSIZE;
                tty->termios.c_cflag |= CS8;
                dev_warn(dev, "data size is not supported, using 8 bits\n");
-               /* fall through */
+               fallthrough;
        case CS8:
                request.params |= UPD78F0730_DATA_SIZE_8_BITS;
                dev_dbg(dev, "%s - 8 data bits\n", __func__);