cpufreq: intel_pstate: Fix static checker warning for epp variable
Srinivas Pandruvada
maintainerPATCH 1/1 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.
---
This patch is on top of bleed-edge branch at
https://kernel.googlesource.com/pub/scm/linux/kernel/git/rafael/linux-pm
drivers/cpufreq/intel_pstate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/cpufreq/intel_pstate.c +1 -1
@@ -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);
Signature · 1 line
2.25.4
Quoted 23 lines · Srinivas Pandruvada
Fix warning for:
drivers/cpufreq/intel_pstate.c:731store_energy_performance_preference()
error: uninitialized symbol 'epp'.This warning is for a case, when
energy_performance_preferenceattribute matches pre defined strings. In this case the value of raw epp will not be used to set EPP bits inMSR_HWP_REQUEST. So initializing with any value is fine.Reported-by Dan Carpenter <[email protected]>Signed-off-by Srinivas Pandruvada <[email protected]>---
This patch is on top of bleed-edge branch at
https://kernel.googlesource.com/pub/scm/linux/kernel/git/rafael/linux-pmdrivers/cpufreq/intel_pstate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/cpufreq/intel_pstate.c +0
-0
drivers/cpufreq/intel_pstate.c static ssize_t store_energy_performance_preference( · line 715
Quoted 8 lines
drivers/cpufreq/intel_pstate.c +1
-1@@ -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);
Signature · 1 line
viresh
Quoted 24 lines · Srinivas Pandruvada
Fix warning for:
drivers/cpufreq/intel_pstate.c:731store_energy_performance_preference()
error: uninitialized symbol 'epp'.This warning is for a case, when
energy_performance_preferenceattribute matches pre defined strings. In this case the value of raw epp will not be used to set EPP bits inMSR_HWP_REQUEST. So initializing with any value is fine.Reported-by Dan Carpenter <[email protected]>Signed-off-by Srinivas Pandruvada <[email protected]>---
This patch is on top of bleed-edge branch at
https://kernel.googlesource.com/pub/scm/linux/kernel/git/rafael/linux-pmdrivers/cpufreq/intel_pstate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/cpufreq/intel_pstate.c +0
-0
drivers/cpufreq/intel_pstate.c static ssize_t store_energy_performance_preference(
Quoted 9 lines
drivers/cpufreq/intel_pstate.c +1
-2@@ -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); --
Applied, thanks!