Skip to content

Commit c83a92d

Browse files
Lifeng Zhengrafaeljw
authored andcommitted
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>
1 parent 3d5978e commit c83a92d

1 file changed

Lines changed: 12 additions & 13 deletions

File tree

drivers/cpufreq/cppc_cpufreq.c

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,6 @@ static unsigned int cppc_cpufreq_get_transition_delay_us(unsigned int cpu)
344344
#if defined(CONFIG_ARM64) && defined(CONFIG_ENERGY_MODEL)
345345

346346
static DEFINE_PER_CPU(unsigned int, efficiency_class);
347-
static void cppc_cpufreq_register_em(struct cpufreq_policy *policy);
348347

349348
/* Create an artificial performance state every CPPC_EM_CAP_STEP capacity unit. */
350349
#define CPPC_EM_CAP_STEP (20)
@@ -480,6 +479,18 @@ static int cppc_get_cpu_cost(struct device *cpu_dev, unsigned long KHz,
480479
return 0;
481480
}
482481

482+
static void cppc_cpufreq_register_em(struct cpufreq_policy *policy)
483+
{
484+
struct cppc_cpudata *cpu_data;
485+
struct em_data_callback em_cb =
486+
EM_ADV_DATA_CB(cppc_get_cpu_power, cppc_get_cpu_cost);
487+
488+
cpu_data = policy->driver_data;
489+
em_dev_register_perf_domain(get_cpu_device(policy->cpu),
490+
get_perf_level_count(policy), &em_cb,
491+
cpu_data->shared_cpu_map, 0);
492+
}
493+
483494
static void populate_efficiency_class(void)
484495
{
485496
struct acpi_madt_generic_interrupt *gicc;
@@ -514,18 +525,6 @@ static void populate_efficiency_class(void)
514525
cppc_cpufreq_driver.register_em = cppc_cpufreq_register_em;
515526
}
516527

517-
static void cppc_cpufreq_register_em(struct cpufreq_policy *policy)
518-
{
519-
struct cppc_cpudata *cpu_data;
520-
struct em_data_callback em_cb =
521-
EM_ADV_DATA_CB(cppc_get_cpu_power, cppc_get_cpu_cost);
522-
523-
cpu_data = policy->driver_data;
524-
em_dev_register_perf_domain(get_cpu_device(policy->cpu),
525-
get_perf_level_count(policy), &em_cb,
526-
cpu_data->shared_cpu_map, 0);
527-
}
528-
529528
#else
530529
static void populate_efficiency_class(void)
531530
{

0 commit comments

Comments
 (0)