linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: linux-serial@vger.kernel.org,
	Greg KH <gregkh@linuxfoundation.org>,
	Jiri Slaby <jirislaby@kernel.org>,
	linux-kernel@vger.kernel.org
Cc: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Subject: [PATCH 4/5] serial: fsl_lpuart: Remove unnecessary clearing for CRTSCTS
Date: Wed, 11 May 2022 13:11:38 +0300	[thread overview]
Message-ID: <20220511101139.5306-5-ilpo.jarvinen@linux.intel.com> (raw)
In-Reply-To: <20220511101139.5306-1-ilpo.jarvinen@linux.intel.com>

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@linux.intel.com>
---
 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


  parent reply	other threads:[~2022-05-11 10:12 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-11 10:11 [PATCH 0/5] tty/serial termbits cleanups Ilpo Järvinen
2022-05-11 10:11 ` [PATCH 1/5] tty/termbits: remove #ifdef CMSPAR that is always defined Ilpo Järvinen
2022-05-13  7:01   ` Johan Hovold
2022-05-11 10:11 ` [PATCH 2/5] tty/termbits: remove #ifdef BOTHER " Ilpo Järvinen
2022-05-13  7:07   ` Johan Hovold
2022-05-11 10:11 ` [PATCH 3/5] tty/termbits: remove #ifdef IBSHIFT " Ilpo Järvinen
2022-05-13  7:10   ` Johan Hovold
2022-05-11 10:11 ` Ilpo Järvinen [this message]
2022-05-13  7:11   ` [PATCH 4/5] serial: fsl_lpuart: Remove unnecessary clearing for CRTSCTS Johan Hovold
2022-05-11 10:11 ` [PATCH 5/5] serial: jsm: Use B0 instead of 0 Ilpo Järvinen
2022-05-13  7:14   ` Johan Hovold

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220511101139.5306-5-ilpo.jarvinen@linux.intel.com \
    --to=ilpo.jarvinen@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).