Linux Power Management development
 help / color / mirror / Atom feed
* [PATCH v1] cpufreq: CPPC: Fix unused-function warning
@ 2022-05-30  8:12 Pierre Gondois
  2022-05-30  8:20 ` Viresh Kumar
  0 siblings, 1 reply; 6+ messages in thread
From: Pierre Gondois @ 2022-05-30  8:12 UTC (permalink / raw)
  To: linux-kernel
  Cc: Ionela.Voinescu, Dietmar.Eggemann, Pierre Gondois, Shaokun Zhang,
	Rafael J. Wysocki, Viresh Kumar, Pierre Gondois, linux-pm

Building the cppc_cpufreq driver with for arm64 with
CONFIG_ENERGY_MODEL=n triggers the following warnings:
 drivers/cpufreq/cppc_cpufreq.c:550:12: error: ‘cppc_get_cpu_cost’ defined but not used
[-Werror=unused-function]
   550 | static int cppc_get_cpu_cost(struct device *cpu_dev, unsigned long KHz,
       |            ^~~~~~~~~~~~~~~~~
 drivers/cpufreq/cppc_cpufreq.c:481:12: error: ‘cppc_get_cpu_power’ defined but not used
[-Werror=unused-function]
   481 | static int cppc_get_cpu_power(struct device *cpu_dev,
       |            ^~~~~~~~~~~~~~~~~~

Fixes: 740fcdc2c20e ("cpufreq: CPPC: Register EM based on efficiency class information")
Reported-by: Shaokun Zhang <zhangshaokun@hisilicon.com>
Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
---
 drivers/cpufreq/cppc_cpufreq.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/cpufreq/cppc_cpufreq.c b/drivers/cpufreq/cppc_cpufreq.c
index d092c9bb4ba3..ecd0d3ee48c5 100644
--- a/drivers/cpufreq/cppc_cpufreq.c
+++ b/drivers/cpufreq/cppc_cpufreq.c
@@ -478,7 +478,7 @@ static inline unsigned long compute_cost(int cpu, int step)
 			step * CPPC_EM_COST_STEP;
 }
 
-static int cppc_get_cpu_power(struct device *cpu_dev,
+static __maybe_unused int cppc_get_cpu_power(struct device *cpu_dev,
 		unsigned long *power, unsigned long *KHz)
 {
 	unsigned long perf_step, perf_prev, perf, perf_check;
@@ -547,8 +547,8 @@ static int cppc_get_cpu_power(struct device *cpu_dev,
 	return 0;
 }
 
-static int cppc_get_cpu_cost(struct device *cpu_dev, unsigned long KHz,
-		unsigned long *cost)
+static __maybe_unused int cppc_get_cpu_cost(struct device *cpu_dev,
+		unsigned long KHz, unsigned long *cost)
 {
 	unsigned long perf_step, perf_prev;
 	struct cppc_perf_caps *perf_caps;
-- 
2.25.1


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

end of thread, other threads:[~2022-05-30  9:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-30  8:12 [PATCH v1] cpufreq: CPPC: Fix unused-function warning Pierre Gondois
2022-05-30  8:20 ` Viresh Kumar
2022-05-30  8:44   ` Pierre Gondois
2022-05-30  9:07     ` Viresh Kumar
2022-05-30  9:42       ` Pierre Gondois
2022-05-30  9:46         ` Viresh Kumar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox