public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
* [PATCH] serial: imx: fix uninitialized variable warning
@ 2013-02-18  5:15 Shawn Guo
  2013-02-18  7:53 ` Dirk Behme
  0 siblings, 1 reply; 2+ messages in thread
From: Shawn Guo @ 2013-02-18  5:15 UTC (permalink / raw)
  To: linux-arm-kernel

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>
---
 drivers/tty/serial/imx.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index adf7611..147c9e1 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)
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH] serial: imx: fix uninitialized variable warning
  2013-02-18  5:15 [PATCH] serial: imx: fix uninitialized variable warning Shawn Guo
@ 2013-02-18  7:53 ` Dirk Behme
  0 siblings, 0 replies; 2+ messages in thread
From: Dirk Behme @ 2013-02-18  7:53 UTC (permalink / raw)
  To: linux-arm-kernel

On 18.02.2013 06:15, Shawn Guo wrote:
> 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>

Thanks

Dirk

> ---
>  drivers/tty/serial/imx.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
> index adf7611..147c9e1 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)

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-02-18  7:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-18  5:15 [PATCH] serial: imx: fix uninitialized variable warning Shawn Guo
2013-02-18  7:53 ` Dirk Behme

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox