lkml.org 
[lkml]   [2014]   [Jun]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] tty: serial: msm_serial.c: Cleaning up uninitialized variables
On Sun, Jun 01, 2014 at 03:38:24PM +0200, Rickard Strandqvist wrote:
> There is a risk that the variable will be used without being initialized.
>
> This was largely found by using a static code analysis program called cppcheck.
>
> Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
> ---
> drivers/tty/serial/msm_serial.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/tty/serial/msm_serial.c b/drivers/tty/serial/msm_serial.c
> index 053b98e..c67f5c5 100644
> --- a/drivers/tty/serial/msm_serial.c
> +++ b/drivers/tty/serial/msm_serial.c
> @@ -962,7 +962,7 @@ static int __init msm_console_setup(struct console *co, char *options)
> {
> struct uart_port *port;
> struct msm_port *msm_port;
> - int baud, flow, bits, parity;
> + int baud = 0, flow, bits, parity;
>

It looks valid .. We might want to just set it to 115200 which is what your change eventually does later in
the code.

Daniel


\
 
 \ /
  Last update: 2014-06-03 01:41    [W:0.050 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site