tty: mxser: make mxser_change_speed() return void
authorJason Yan <yanaijie@huawei.com>
Wed, 6 May 2020 06:17:35 +0000 (14:17 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 15 May 2020 12:47:05 +0000 (14:47 +0200)
No other functions use the return value of mxser_change_speed() and the
return value is always 0 now. Make it return void. This fixes the
following coccicheck warning:

drivers/tty/mxser.c:645:5-8: Unneeded variable: "ret". Return "0" on
line 650

Signed-off-by: Jason Yan <yanaijie@huawei.com>
Link: https://lore.kernel.org/r/20200506061735.19369-1-yanaijie@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/mxser.c

index 9d00ff5ef9611431a09db1b2b44338f7d218628b..3703987c46661396bbf3c276a4ce295e3157ca0b 100644 (file)
@@ -638,16 +638,15 @@ static int mxser_set_baud(struct tty_struct *tty, long newspd)
  * This routine is called to set the UART divisor registers to match
  * the specified baud rate for a serial port.
  */
-static int mxser_change_speed(struct tty_struct *tty)
+static void mxser_change_speed(struct tty_struct *tty)
 {
        struct mxser_port *info = tty->driver_data;
        unsigned cflag, cval, fcr;
-       int ret = 0;
        unsigned char status;
 
        cflag = tty->termios.c_cflag;
        if (!info->ioaddr)
-               return ret;
+               return;
 
        if (mxser_set_baud_method[tty->index] == 0)
                mxser_set_baud(tty, tty_get_baud_rate(tty));
@@ -803,8 +802,6 @@ static int mxser_change_speed(struct tty_struct *tty)
 
        outb(fcr, info->ioaddr + UART_FCR);     /* set fcr */
        outb(cval, info->ioaddr + UART_LCR);
-
-       return ret;
 }
 
 static void mxser_check_modem_status(struct tty_struct *tty,