]> git.baikalelectronics.ru Git - kernel.git/commit
serial: core: Simplify console suspend logic in uart_suspend_port()
authorPeter Hurley <peter@hurleysoftware.com>
Thu, 22 Jan 2015 17:24:25 +0000 (12:24 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 2 Feb 2015 18:11:27 +0000 (10:11 -0800)
commitb9535ad0ad3349e5811de4675339cfbc5b5e8ca5
tree7d1705670475dea2d78db62f72f02f1708a03576
parentfff3767f1f9e53c802524182832d6ff35eae9ef2
serial: core: Simplify console suspend logic in uart_suspend_port()

When the uart port being suspended is a console and consoles are
not suspending (kernel command line contains no_console_suspend),
then no action is performed for that port, and the function can
return early.

If the function has not returned early, then one of the conditions
is not true, so the expression
   (console_suspend_enabled || !uart_console(uport))
must be true and can be eliminated.

Similarly, the expression
   (console_suspend_enabled && uart_console(uport))
simplifies to just uart_console(uport).

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/serial_core.c