tty: baudrate: Explicit usage of B0 for encoding input baudrate
PATCH 1/1 tty: baudrate: Explicit usage of B0 for encoding input baudrate
Function tty_termios_input_baud_rate() checks IBSHIFT & CBAUD against B0 constant to determinate if input speed equals to output speed. So do same B0 check also in tty_termios_encode_baud_rate() function to make these two functions compatible.
Currently macro B0 is defined to 0 so there is no functional change.
This change just make code more explicit to show that Bnnn constants are stored in CBAUD.
Signed-off-by Pali Rohár <[email protected]>
--- drivers/tty/tty_baudrate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/tty_baudrate.c +1 -1
@@ -154,7 +154,7 @@ void tty_termios_encode_baud_rate(struct ktermios *termios, termios->c_ospeed = obaud;#ifdef IBSHIFT -if ((termios->c_cflag >>IBSHIFT ) &CBAUD ) +if (((termios->c_cflag >>IBSHIFT ) &CBAUD ) !=B0 ) ibinput =1 ;/* An input speed was specified */ #endif #ifdef BOTHER
Signature · 1 line
2.20.1