From: Pali Rohár Date: Mon, 27 Sep 2021 13:35:16 +0000 (+0200) Subject: tty: baudrate: Explicit usage of B0 for encoding input baudrate X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=4545b069aa2cd3287bf9399c02bdb3c829b75b75;p=linux.git 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 Link: https://lore.kernel.org/r/20210927133516.8671-1-pali@kernel.org Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/tty/tty_baudrate.c b/drivers/tty/tty_baudrate.c index 426b1252781a7..d903e111dbcb0 100644 --- a/drivers/tty/tty_baudrate.c +++ b/drivers/tty/tty_baudrate.c @@ -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