diff options
author | Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> | 2022-05-13 11:29:05 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-05-19 18:26:17 +0200 |
commit | 503f418b10040b9b1044734b21ab2a3bea810aad (patch) | |
tree | e28b3a5ae05d0fbcc3e1614a0bba5e8a3663fda8 /drivers/tty/serial | |
parent | 9cca25e2762f0436834695225a38bc90ae3ebdfc (diff) | |
download | linux-503f418b10040b9b1044734b21ab2a3bea810aad.tar.bz2 |
serial: fsl_lpuart: Remove unnecessary clearing for CRTSCTS
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>
Diffstat (limited to 'drivers/tty/serial')
-rw-r--r-- | drivers/tty/serial/fsl_lpuart.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c index 7b46b97a6ddd..0d6e62f6bb07 100644 --- a/drivers/tty/serial/fsl_lpuart.c +++ b/drivers/tty/serial/fsl_lpuart.c @@ -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; |