Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tty: remove IBSHIFT ifdefs

IBSHIFT 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-4-ilpo.jarvinen@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Ilpo Järvinen and committed by
Greg Kroah-Hartman
9cca25e2 69648d7b

+3 -12
+3 -12
drivers/tty/tty_baudrate.c
··· 91 91 92 92 speed_t tty_termios_input_baud_rate(struct ktermios *termios) 93 93 { 94 - #ifdef IBSHIFT 95 94 unsigned int cbaud = (termios->c_cflag >> IBSHIFT) & CBAUD; 96 95 97 96 if (cbaud == B0) ··· 109 110 cbaud += 15; 110 111 } 111 112 return cbaud >= n_baud_table ? 0 : baud_table[cbaud]; 112 - #else /* IBSHIFT */ 113 - return tty_termios_baud_rate(termios); 114 - #endif /* IBSHIFT */ 115 113 } 116 114 EXPORT_SYMBOL(tty_termios_input_baud_rate); 117 115 ··· 148 152 termios->c_ispeed = ibaud; 149 153 termios->c_ospeed = obaud; 150 154 151 - #ifdef IBSHIFT 152 155 if (((termios->c_cflag >> IBSHIFT) & CBAUD) != B0) 153 156 ibinput = 1; /* An input speed was specified */ 154 - #endif 157 + 155 158 /* If the user asked for a precise weird speed give a precise weird 156 159 * answer. If they asked for a Bfoo speed they may have problems 157 160 * digesting non-exact replies so fuzz a bit. ··· 165 170 iclose = 0; 166 171 167 172 termios->c_cflag &= ~CBAUD; 168 - #ifdef IBSHIFT 169 173 termios->c_cflag &= ~(CBAUD << IBSHIFT); 170 - #endif 171 174 172 175 /* 173 176 * Our goal is to find a close match to the standard baud rate ··· 185 192 /* For the case input == output don't set IBAUD bits 186 193 * if the user didn't do so. 187 194 */ 188 - if (ofound == i && !ibinput) 195 + if (ofound == i && !ibinput) { 189 196 ifound = i; 190 - #ifdef IBSHIFT 191 - else { 197 + } else { 192 198 ifound = i; 193 199 termios->c_cflag |= (baud_bits[i] << IBSHIFT); 194 200 } 195 - #endif 196 201 } 197 202 } while (++i < n_baud_table); 198 203