serial: sh-sci: Initialise variables before access in sci_set_termios()
authorSimon Horman <horms+renesas@verge.net.au>
Thu, 20 Jun 2013 12:09:45 +0000 (21:09 +0900)
committerSimon Horman <horms+renesas@verge.net.au>
Wed, 26 Jun 2013 08:41:16 +0000 (17:41 +0900)
commitd4759ded3bdf3eb004d583011707fdc21aeda94e
tree2613c280fbd4216c4a4dae30822539ed0be5edfc
parentc972f024c1097fa0798beafc21be1eeeba21ac34
serial: sh-sci: Initialise variables before access in sci_set_termios()

This change addresses two warnings that are flagged by gcc relating to
potential access to the ssr and cks variables while they are uninitialised.

I have addressed this by initialising the values to
the defaults present in sci_baud_calc_hscif().

It is my analysis that cks is always initialised if used
but that without this change ssr may be accessed while uninitialised.

The code altered by this patch was introduced by commit
f303b364b41d3fc5bf879799128958400b7859aa ("serial: sh-sci: HSCIF support").

Reported-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
drivers/tty/serial/sh-sci.c