serial: core: Fix unused variable warnings from uart_console()
authorPeter Hurley <peter@hurleysoftware.com>
Sat, 11 Apr 2015 15:02:36 +0000 (11:02 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 6 May 2015 20:27:00 +0000 (22:27 +0200)
If CONFIG_SERIAL_CORE_CONSOLE=n, build warnings are generated by
uart_console() macro expansion:

drivers/tty/serial/of_serial.c: In function ‘of_serial_suspend_8250’:
drivers/tty/serial/of_serial.c:262:20: warning: unused variable ‘port’ [-Wunused-variable]
  struct uart_port *port = &port8250->port;
                    ^
drivers/tty/serial/of_serial.c: In function ‘of_serial_resume_8250’:
drivers/tty/serial/of_serial.c:272:20: warning: unused variable ‘port’ [-Wunused-variable]
  struct uart_port *port = &port8250->port;

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/linux/serial_core.h

index 025dad9dcde4edaacbb51e52d138c7f28b621458..297d4fa1cfe513d85340ae43c1217d47e9c7e881 100644 (file)
@@ -35,7 +35,7 @@
 #define uart_console(port) \
        ((port)->cons && (port)->cons->index == (port)->line)
 #else
-#define uart_console(port)      (0)
+#define uart_console(port)      ({ (void)port; 0; })
 #endif
 
 struct uart_port;