diff options
| author | Lifeng Zheng <zhenglifeng1@huawei.com> | 2025-05-26 19:30:57 +0800 |
|---|---|---|
| committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2025-06-18 21:03:52 +0200 |
| commit | c83a92df2fc60bf0b3130cdf0bc2104d61750317 (patch) | |
| tree | c53197caae27e3ed40d35f4474c0557998696186 /drivers/cpufreq/cppc_cpufreq.c | |
| parent | cpufreq: CPPC: Do not return a value from populate_efficiency_class() (diff) | |
| download | linux-c83a92df2fc60bf0b3130cdf0bc2104d61750317.tar.gz linux-c83a92df2fc60bf0b3130cdf0bc2104d61750317.zip | |
cpufreq: CPPC: Remove forward declaration of cppc_cpufreq_register_em()
cppc_cpufreq_register_em() is only used in populate_efficiency_class(). A
forward declaration of it is not necessary.
Move cppc_cpufreq_register_em() in front of populate_efficiency_class()
and remove the forward declaration of cppc_cpufreq_register_em().
No functional change.
Signed-off-by: Lifeng Zheng <zhenglifeng1@huawei.com>
Link: https://patch.msgid.link/20250526113057.3086513-4-zhenglifeng1@huawei.com
[ rjw: Changelog edits ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpufreq/cppc_cpufreq.c')
| -rw-r--r-- | drivers/cpufreq/cppc_cpufreq.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/drivers/cpufreq/cppc_cpufreq.c b/drivers/cpufreq/cppc_cpufreq.c index c2be4b188a23..a1fd0ff22bc5 100644 --- a/drivers/cpufreq/cppc_cpufreq.c +++ b/drivers/cpufreq/cppc_cpufreq.c @@ -344,7 +344,6 @@ static unsigned int cppc_cpufreq_get_transition_delay_us(unsigned int cpu) #if defined(CONFIG_ARM64) && defined(CONFIG_ENERGY_MODEL) static DEFINE_PER_CPU(unsigned int, efficiency_class); -static void cppc_cpufreq_register_em(struct cpufreq_policy *policy); /* Create an artificial performance state every CPPC_EM_CAP_STEP capacity unit. */ #define CPPC_EM_CAP_STEP (20) @@ -480,6 +479,18 @@ static int cppc_get_cpu_cost(struct device *cpu_dev, unsigned long KHz, return 0; } +static void cppc_cpufreq_register_em(struct cpufreq_policy *policy) +{ + struct cppc_cpudata *cpu_data; + struct em_data_callback em_cb = + EM_ADV_DATA_CB(cppc_get_cpu_power, cppc_get_cpu_cost); + + cpu_data = policy->driver_data; + em_dev_register_perf_domain(get_cpu_device(policy->cpu), + get_perf_level_count(policy), &em_cb, + cpu_data->shared_cpu_map, 0); +} + static void populate_efficiency_class(void) { struct acpi_madt_generic_interrupt *gicc; @@ -514,18 +525,6 @@ static void populate_efficiency_class(void) cppc_cpufreq_driver.register_em = cppc_cpufreq_register_em; } -static void cppc_cpufreq_register_em(struct cpufreq_policy *policy) -{ - struct cppc_cpudata *cpu_data; - struct em_data_callback em_cb = - EM_ADV_DATA_CB(cppc_get_cpu_power, cppc_get_cpu_cost); - - cpu_data = policy->driver_data; - em_dev_register_perf_domain(get_cpu_device(policy->cpu), - get_perf_level_count(policy), &em_cb, - cpu_data->shared_cpu_map, 0); -} - #else static void populate_efficiency_class(void) { |
