Re: [PATCH v2 3/3] cpufreq: CPPC: Register EM based on efficiency class information

From: Pierre Gondois
Date: Mon Apr 11 2022 - 06:33:04 EST


Hello Viresh,

On 4/11/22 05:12, Viresh Kumar wrote:
On 07-04-22, 10:16, Pierre Gondois wrote:
+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);
+
+ if (!efficiency_class_populated)

Instead of a new variable for this, what about setting
cppc_cpufreq_driver.register_em = cppc_cpufreq_register_em, only if
you were able to populate the efficiency class in the first place ?


Yes right, this would be better,
Regards,
Pierre