[PATCH 4/5] serial: fsl_lpuart: Remove unnecessary clearing for CRTSCTS

From: Ilpo Järvinen
Date: Wed May 11 2022 - 06:12:56 EST


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.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@xxxxxxxxxxxxxxx>
---
drivers/tty/serial/fsl_lpuart.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c
index 75b3c36c13bc..d3bb46cb7185 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;
--
2.30.2