Re: [PATCH RT] tty: serial: pl011: fix warning about uninitialized variable
From: Sebastian Andrzej Siewior
Date: Fri Oct 05 2018 - 10:35:35 EST
On 2018-09-24 10:29:01 [+0200], Kurt Kanzenbach wrote:
> Silence the following gcc warning:
>
> drivers/tty/serial/amba-pl011.c: In function âpl011_console_writeâ:
> ./include/linux/spinlock.h:260:3: warning: âflagsâ may be used uninitialized in this function [-Wmaybe-uninitialized]
> _raw_spin_unlock_irqrestore(lock, flags); \
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~
> drivers/tty/serial/amba-pl011.c:2214:16: note: âflagsâ was declared here
> unsigned long flags;
> ^~~~~
>
> The code is correct. Thus, initializing flags to zero doesn't change the
> behavior and resolves the warning.
>
> Signed-off-by: Kurt Kanzenbach <kurt@xxxxxxxxxxxxx>
applied.
Sebastian