aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
authorSimon Horman <horms+renesas@verge.net.au>2013-06-20 08:09:45 -0400
committerSimon Horman <horms+renesas@verge.net.au>2013-06-26 04:41:16 -0400
commitd4759ded3bdf3eb004d583011707fdc21aeda94e (patch)
tree2613c280fbd4216c4a4dae30822539ed0be5edfc /drivers/tty
parentc972f024c1097fa0798beafc21be1eeeba21ac34 (diff)
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>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/serial/sh-sci.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
index 931d6c3a792c..7477e0ea5cdb 100644
--- a/drivers/tty/serial/sh-sci.c
+++ b/drivers/tty/serial/sh-sci.c
@@ -1887,9 +1887,9 @@ static void sci_set_termios(struct uart_port *port, struct ktermios *termios,
1887{ 1887{
1888 struct sci_port *s = to_sci_port(port); 1888 struct sci_port *s = to_sci_port(port);
1889 struct plat_sci_reg *reg; 1889 struct plat_sci_reg *reg;
1890 unsigned int baud, smr_val, max_baud, cks; 1890 unsigned int baud, smr_val, max_baud, cks = 0;
1891 int t = -1; 1891 int t = -1;
1892 unsigned int srr; 1892 unsigned int srr = 15;
1893 1893
1894 /* 1894 /*
1895 * earlyprintk comes here early on with port->uartclk set to zero. 1895 * earlyprintk comes here early on with port->uartclk set to zero.