diff options
| author | Nathan Chancellor <natechancellor@gmail.com> | 2019-03-08 11:37:44 -0700 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-04-03 06:27:32 +0200 |
| commit | 5bff7cb2bc8950c9882a07563ce9d87591597ce3 (patch) | |
| tree | 372aba6b6a96479dbb5b7d1713faecad1dc46c11 /drivers/tty | |
| parent | 36e47853d0e9dad0ef94bc7a611a485e24a4e775 (diff) | |
| download | blackbird-obmc-linux-5bff7cb2bc8950c9882a07563ce9d87591597ce3.tar.gz blackbird-obmc-linux-5bff7cb2bc8950c9882a07563ce9d87591597ce3.zip | |
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 <gregkh@linuxfoundation.org>
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
| -rw-r--r-- | drivers/tty/serial/qcom_geni_serial.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qcom_geni_serial.c index 38016609c7fa..d30502c58106 100644 --- a/drivers/tty/serial/qcom_geni_serial.c +++ b/drivers/tty/serial/qcom_geni_serial.c @@ -1117,7 +1117,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'; |

