diff options
author | Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> | 2022-05-13 11:29:03 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-05-19 18:26:17 +0200 |
commit | 69648d7bda8636088db8bce742c1bb1c99a11cdd (patch) | |
tree | 1db514a18d2022b192bc3d8fadbfa5724877c98d /drivers/tty/tty_baudrate.c | |
parent | 9fafe733514b7c3eb51e46d8f494d32cbeb0924b (diff) |
tty: remove BOTHER ifdefs
BOTHER is defined by all architectures since commit d0ffb805b729
("arch/alpha, termios: implement BOTHER, IBSHIFT and termios2").
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-3-ilpo.jarvinen@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/tty_baudrate.c')
-rw-r--r-- | drivers/tty/tty_baudrate.c | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/drivers/tty/tty_baudrate.c b/drivers/tty/tty_baudrate.c index d903e111dbcb..07bbbfee5635 100644 --- a/drivers/tty/tty_baudrate.c +++ b/drivers/tty/tty_baudrate.c @@ -61,11 +61,10 @@ speed_t tty_termios_baud_rate(struct ktermios *termios) cbaud = termios->c_cflag & CBAUD; -#ifdef BOTHER /* Magic token for arbitrary speed via c_ispeed/c_ospeed */ if (cbaud == BOTHER) return termios->c_ospeed; -#endif + if (cbaud & CBAUDEX) { cbaud &= ~CBAUDEX; @@ -97,11 +96,11 @@ speed_t tty_termios_input_baud_rate(struct ktermios *termios) if (cbaud == B0) return tty_termios_baud_rate(termios); -#ifdef BOTHER + /* Magic token for arbitrary speed via c_ispeed*/ if (cbaud == BOTHER) return termios->c_ispeed; -#endif + if (cbaud & CBAUDEX) { cbaud &= ~CBAUDEX; @@ -157,7 +156,6 @@ void tty_termios_encode_baud_rate(struct ktermios *termios, if (((termios->c_cflag >> IBSHIFT) & CBAUD) != B0) ibinput = 1; /* An input speed was specified */ #endif -#ifdef BOTHER /* 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,7 +168,7 @@ void tty_termios_encode_baud_rate(struct ktermios *termios, } if (((termios->c_cflag >> IBSHIFT) & CBAUD) == BOTHER) iclose = 0; -#endif + termios->c_cflag &= ~CBAUD; #ifdef IBSHIFT termios->c_cflag &= ~(CBAUD << IBSHIFT); @@ -205,11 +203,7 @@ void tty_termios_encode_baud_rate(struct ktermios *termios, } } while (++i < n_baud_table); - /* - * If we found no match then use BOTHER if provided or warn - * the user their platform maintainer needs to wake up if not. - */ -#ifdef BOTHER + /* If we found no match then use BOTHER. */ if (ofound == -1) termios->c_cflag |= BOTHER; /* Set exact input bits only if the input and output differ or the @@ -217,10 +211,6 @@ void tty_termios_encode_baud_rate(struct ktermios *termios, */ if (ifound == -1 && (ibaud != obaud || ibinput)) termios->c_cflag |= (BOTHER << IBSHIFT); -#else - if (ifound == -1 || ofound == -1) - pr_warn_once("tty: Unable to return correct speed data as your architecture needs updating.\n"); -#endif } EXPORT_SYMBOL_GPL(tty_termios_encode_baud_rate); |