serial: imx: fix uninitialized variable warning

Commit 677fe55 (serial: imx: Fix recursive locking bug) introduces an
uninitialized variable warning as below.

  CC      drivers/tty/serial/imx.o
drivers/tty/serial/imx.c: In function ‘imx_console_write’:
include/linux/spinlock.h:340:2: warning: ‘flags’ may be used uninitialized in this function [-Wuninitialized]
drivers/tty/serial/imx.c:1214:16: note: ‘flags’ was declared here

Initialize the variable to suppress the warning.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Dirk Behme <dirk.behme@de.bosch.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Shawn Guo 2013-02-18 13:15:36 +08:00 committed by Greg Kroah-Hartman
parent c3e1becebf
commit f30e826069
1 changed files with 1 additions and 1 deletions

View File

@ -1211,7 +1211,7 @@ imx_console_write(struct console *co, const char *s, unsigned int count)
struct imx_port *sport = imx_ports[co->index];
struct imx_port_ucrs old_ucr;
unsigned int ucr1;
unsigned long flags;
unsigned long flags = 0;
int locked = 1;
if (sport->port.sysrq)