From 8959d2a951daab3bd14ad269a387e15a0cbb7758 Mon Sep 17 00:00:00 2001 From: Tao Huang Date: Tue, 15 Oct 2019 17:59:35 +0800 Subject: [PATCH] thermal: rk3368: fix gcc warning drivers/thermal/rk3368_thermal.c: In function 'rk3368_thermal_get_temp': drivers/thermal/rk3368_thermal.c:580:12: warning: 'val_cpu' may be used uninitialized in this function [-Wmaybe-uninitialized] old_data = tsadc_data; ~~~~~~~~~^~~~~~~~~~~~ drivers/thermal/rk3368_thermal.c:529:6: note: 'val_cpu' was declared here int val_cpu; ^~~~~~~ Change-Id: I365441507082cbbd0f7be01e5f0a09674af6230d Signed-off-by: Tao Huang --- drivers/thermal/rk3368_thermal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/thermal/rk3368_thermal.c b/drivers/thermal/rk3368_thermal.c index ec07b96fdb78..84a2cc70f8d1 100644 --- a/drivers/thermal/rk3368_thermal.c +++ b/drivers/thermal/rk3368_thermal.c @@ -526,7 +526,7 @@ static int predict_temp(int temp) static int get_raw_code_internal(void) { u32 val_cpu_pd; - int val_cpu; + int val_cpu = INVALID_TEMP; int i; struct rk3368_thermal_data *ctx = rk3368_thermal_get_data();