]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
serial: serial_core: simplify uart_ioctl() returns
authorJiri Slaby (SUSE) <jirislaby@kernel.org>
Wed, 19 Nov 2025 10:01:39 +0000 (11:01 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Nov 2025 17:30:40 +0000 (18:30 +0100)
commitf374a33e90e6cc17b05629636e68a012dc8347ed
treee064787e1e8faa1af8c6a43029b9bcd1a7ff002b
parentdee7e10498c76490bb3bd5039c7c12d54585c26d
serial: serial_core: simplify uart_ioctl() returns

Neither uart_do_autoconfig(), nor uart_wait_modem_status() can return
-ENOIOCTLCMD. The ENOIOCTLCMD checks are there to check if 'cmd' matched
against TIOCSERCONFIG, and TIOCMIWAIT respectively. (With 0 or error in
'ret', it does not matter.)

Therefore, the code can simply return from the TIOCSERCONFIG and
TIOCMIWAIT spots immediately.

To be more explicit, use 'if' instead of switch-case for those single
values.

And return without jumping to the 'out' label -- it can be removed too.

Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
Link: https://patch.msgid.link/20251119100140.830761-10-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/serial_core.c