From: Shawn Guo Date: Mon, 18 Feb 2013 05:15:36 +0000 (+0800) Subject: serial: imx: fix uninitialized variable warning X-Git-Tag: firefly_0821_release~3680^2~1078^2~1 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=f30e826069918da0876493e2de9ba13287b68e0a;p=firefly-linux-kernel-4.4.55.git 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 Acked-by: Dirk Behme Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index adf76117a733..147c9e193595 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c @@ -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)