serial: fsl_lpuart: Remove unnecessary clearing for CRTSCTS
authorIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Fri, 13 May 2022 08:29:05 +0000 (11:29 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 19 May 2022 16:26:17 +0000 (18:26 +0200)
if (termios->c_cflag & CRTSCTS) guarantees that CRTSCTS is not ever set
in the else block so clearing it is unnecessary.

While at it, remove also one pair of extra parenthesis.

Reviewed-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20220513082906.11096-5-ilpo.jarvinen@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/fsl_lpuart.c

index 7b46b97..0d6e62f 100644 (file)
@@ -2110,12 +2110,10 @@ lpuart32_set_termios(struct uart_port *port, struct ktermios *termios,
        if (sport->port.rs485.flags & SER_RS485_ENABLED)
                termios->c_cflag &= ~CRTSCTS;
 
-       if (termios->c_cflag & CRTSCTS) {
-               modem |= (UARTMODIR_RXRTSE | UARTMODIR_TXCTSE);
-       } else {
-               termios->c_cflag &= ~CRTSCTS;
+       if (termios->c_cflag & CRTSCTS)
+               modem |= UARTMODIR_RXRTSE | UARTMODIR_TXCTSE;
+       else
                modem &= ~(UARTMODIR_RXRTSE | UARTMODIR_TXCTSE);
-       }
 
        if (termios->c_cflag & CSTOPB)
                bd |= UARTBAUD_SBNS;