]> git.baikalelectronics.ru Git - kernel.git/commit
cpufreq: CPPC: Fix unused-function warning
authorPierre Gondois <pierre.gondois@arm.com>
Mon, 30 May 2022 10:04:24 +0000 (12:04 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 30 May 2022 13:33:42 +0000 (15:33 +0200)
commited5825fbac0bf36bc93e767bcaa36f01cf54dbeb
treee241f3a4e9f6661367e88399faea808db74f3b8a
parentfd2f55b19db73f44932509ab152b7714c940ed28
cpufreq: CPPC: Fix unused-function warning

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,
       |            ^~~~~~~~~~~~~~~~~~

Move the Energy Model related functions into specific guards.
This allows to fix the warning and prevent doing extra work
when the Energy Model is not present.

Fixes: 21baa9c72795 ("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>
Tested-by: Shaokun Zhang <zhangshaokun@hisilicon.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpufreq/cppc_cpufreq.c