mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-07-28 02:09:43 -04:00
serial: core: simplify clipping logic in uart_get_baud_rate()
Simplify the clipping logic in uart_get_baud_rate() to improve code readability. Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com> Link: https://patch.msgid.link/20260410152022.2146488-5-hugo@hugovil.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
2f0c885310
commit
1097aedec7
@@ -543,11 +543,11 @@ uart_get_baud_rate(struct uart_port *port, struct ktermios *termios,
|
||||
*/
|
||||
if (!hung_up) {
|
||||
if (baud <= min)
|
||||
tty_termios_encode_baud_rate(termios,
|
||||
min + 1, min + 1);
|
||||
baud = min + 1;
|
||||
else
|
||||
tty_termios_encode_baud_rate(termios,
|
||||
max - 1, max - 1);
|
||||
baud = max - 1;
|
||||
|
||||
tty_termios_encode_baud_rate(termios, baud, baud);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user