tty: serial: extract uart_change_port() from uart_set_info()
authorJiri Slaby (SUSE) <jirislaby@kernel.org>
Wed, 11 Dec 2024 07:49:33 +0000 (08:49 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 14 Dec 2024 14:40:16 +0000 (15:40 +0100)
commitd2740f7d878932a4b4aaf69d751baf3825c1b287
tree7d559fbc1bb9f02a4b018e028fb280914190dc47
parent4d0e56d571b8675e5a4863f394884c7db4387bcb
tty: serial: extract uart_change_port() from uart_set_info()

This "change_port" part of uart_set_info() is for no good reason
inlined there. It makes the function rather hard to read. Therefore,
extract it to a separate function.

This allows for flattening the ifs (with short path "return"s) and
avoiding two levels of indentation. Both making the code really flat and
comprehesible.

Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
Link: https://lore.kernel.org/r/20241211074933.92973-4-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/serial_core.c