linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cpufreq: intel_pstate: Fix static checker warning for epp variable
@ 2020-07-09 20:05 Srinivas Pandruvada
  2020-07-10  3:32 ` Viresh Kumar
  2020-07-13 13:52 ` Rafael J. Wysocki
  0 siblings, 2 replies; 3+ messages in thread
From: Srinivas Pandruvada @ 2020-07-09 20:05 UTC (permalink / raw)
  To: rjw, lenb, viresh.kumar
  Cc: linux-pm, linux-kernel, dan.carpenter, kernel-janitors,
	Srinivas Pandruvada

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 <dan.carpenter@oracle.com>
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
---
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(-)

diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
index 44c7b4677675..94cd07678ee3 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);
-- 
2.25.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-07-13 13:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-09 20:05 [PATCH] cpufreq: intel_pstate: Fix static checker warning for epp variable Srinivas Pandruvada
2020-07-10  3:32 ` Viresh Kumar
2020-07-13 13:52 ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).