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 3/5] tty/termbits: remove #ifdef IBSHIFT that is always defined
Date: Wed, 11 May 2022 13:11:37 +0300 [thread overview]
Message-ID: <20220511101139.5306-4-ilpo.jarvinen@linux.intel.com> (raw)
In-Reply-To: <20220511101139.5306-1-ilpo.jarvinen@linux.intel.com>
IBSHIFT is defined by all architectures.
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
---
drivers/tty/tty_baudrate.c | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/drivers/tty/tty_baudrate.c b/drivers/tty/tty_baudrate.c
index 07bbbfee5635..d10318956c97 100644
--- a/drivers/tty/tty_baudrate.c
+++ b/drivers/tty/tty_baudrate.c
@@ -91,7 +91,6 @@ EXPORT_SYMBOL(tty_termios_baud_rate);
speed_t tty_termios_input_baud_rate(struct ktermios *termios)
{
-#ifdef IBSHIFT
unsigned int cbaud = (termios->c_cflag >> IBSHIFT) & CBAUD;
if (cbaud == B0)
@@ -110,9 +109,6 @@ speed_t tty_termios_input_baud_rate(struct ktermios *termios)
cbaud += 15;
}
return cbaud >= n_baud_table ? 0 : baud_table[cbaud];
-#else /* IBSHIFT */
- return tty_termios_baud_rate(termios);
-#endif /* IBSHIFT */
}
EXPORT_SYMBOL(tty_termios_input_baud_rate);
@@ -152,10 +148,9 @@ void tty_termios_encode_baud_rate(struct ktermios *termios,
termios->c_ispeed = ibaud;
termios->c_ospeed = obaud;
-#ifdef IBSHIFT
if (((termios->c_cflag >> IBSHIFT) & CBAUD) != B0)
ibinput = 1; /* An input speed was specified */
-#endif
+
/* If the user asked for a precise weird speed give a precise weird
* answer. If they asked for a Bfoo speed they may have problems
* digesting non-exact replies so fuzz a bit.
@@ -170,9 +165,7 @@ void tty_termios_encode_baud_rate(struct ktermios *termios,
iclose = 0;
termios->c_cflag &= ~CBAUD;
-#ifdef IBSHIFT
termios->c_cflag &= ~(CBAUD << IBSHIFT);
-#endif
/*
* Our goal is to find a close match to the standard baud rate
@@ -194,12 +187,10 @@ void tty_termios_encode_baud_rate(struct ktermios *termios,
*/
if (ofound == i && !ibinput)
ifound = i;
-#ifdef IBSHIFT
else {
ifound = i;
termios->c_cflag |= (baud_bits[i] << IBSHIFT);
}
-#endif
}
} while (++i < n_baud_table);
--
2.30.2
next prev parent reply other threads:[~2022-05-11 10:12 UTC|newest]
Thread overview: 13+ 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-11 10:11 ` Ilpo Järvinen
2022-05-13 7:07 ` Johan Hovold
2022-05-13 7:07 ` Johan Hovold
2022-05-11 10:11 ` Ilpo Järvinen [this message]
2022-05-13 7:10 ` [PATCH 3/5] tty/termbits: remove #ifdef IBSHIFT " Johan Hovold
2022-05-11 10:11 ` [PATCH 4/5] serial: fsl_lpuart: Remove unnecessary clearing for CRTSCTS Ilpo Järvinen
2022-05-13 7:11 ` 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-4-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.