From: Nathan Chancellor Date: Fri, 8 Mar 2019 18:37:44 +0000 (-0700) Subject: tty: serial: qcom_geni_serial: Initialize baud in qcom_geni_console_setup X-Git-Tag: v4.19.33~55 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=668ba38d895088f81a29aa3b3552f1534aadefe7;p=platform%2Fkernel%2Flinux-rpi3.git tty: serial: qcom_geni_serial: Initialize baud in qcom_geni_console_setup commit c5cbc78acf693f5605d4a85b1327fa7933daf092 upstream. When building with -Wsometimes-uninitialized, Clang warns: drivers/tty/serial/qcom_geni_serial.c:1079:6: warning: variable 'baud' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] It's not wrong; when options is NULL, baud has no default value. Use 9600 as that is a sane default. Link: https://github.com/ClangBuiltLinux/linux/issues/395 Suggested-by: Greg Kroah-Hartman Signed-off-by: Nathan Chancellor Reviewed-by: Nick Desaulniers Cc: stable Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qcom_geni_serial.c index 35d1f6fa..5b96df4 100644 --- a/drivers/tty/serial/qcom_geni_serial.c +++ b/drivers/tty/serial/qcom_geni_serial.c @@ -1052,7 +1052,7 @@ static int __init qcom_geni_console_setup(struct console *co, char *options) { struct uart_port *uport; struct qcom_geni_serial_port *port; - int baud; + int baud = 9600; int bits = 8; int parity = 'n'; int flow = 'n';