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)
commitb164c9721e3ea4c08a4738cd4d0538bbb0c24419
tree7d1705670475dea2d78db62f72f02f1708a03576
parentea9e9d8029020d438b0717ffddf65140fda16051
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