From: Srinivas Pandruvada Date: Thu, 9 Jul 2020 20:05:22 +0000 (-0700) Subject: cpufreq: intel_pstate: Fix static checker warning for epp variable X-Git-Tag: v5.9-rc1~175^2~1^2~2^2~15 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3ff79754d7a2b27f6d2d56b3951fc9aa8080b063;p=thirdparty%2Fkernel%2Flinux.git cpufreq: intel_pstate: Fix static checker warning for epp variable Fix warning for: drivers/cpufreq/intel_pstate.c:731 store_energy_performance_preference() error: uninitialized symbol 'epp'. This warning is for a case, when energy_performance_preference attribute matches pre defined strings. In this case the value of raw epp will not be used to set EPP bits in MSR_HWP_REQUEST. So initializing with any value is fine. Reported-by: Dan Carpenter Signed-off-by: Srinivas Pandruvada Acked-by: Viresh Kumar Signed-off-by: Rafael J. Wysocki --- diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c index 44c7b4677675d..94cd07678ee35 100644 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c @@ -709,7 +709,7 @@ static ssize_t store_energy_performance_preference( struct cpudata *cpu_data = all_cpu_data[policy->cpu]; char str_preference[21]; bool raw = false; - u32 epp; + u32 epp = 0; int ret; ret = sscanf(buf, "%20s", str_preference);