[lkml]   [2019]   [Jan]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH 2/7] cpufreq: dt: Register an Energy Model
On 30-01-19, 09:12, Quentin Perret wrote:
> What I had in mind is something as simple as:
> void of_dev_pm_opp_register_em(struct cpumask *cpus)
> {
> /* Bail out if an EM is there */
> if (em_cpu_get(cpumask_first(cpus)))
> return;
> /* Check prerequisites: dpc coeff in DT, ... */
> ...
> em_register_perf_domain(...);
> }
> IIUC, Matthias' point was that if the EM is already registered, there is
> no good reason to call em_register_perf_domain() again. Now, that should
> in fact be harmless because em_register_perf_domain() already does that
> check. It's just cleaner and easier to understand from a conceptual
> standpoint to not call that function several times for no reason I
> assume.

If there is no good reason to call em_register_perf_domain() several
times, then the same applies to of_dev_pm_opp_register_em() as well,
isn't it ?

This is init code anyway isn't going to run a lot, so I wouldn't
suggest adding any such (duplicate) checks in


 \ /
  Last update: 2019-01-30 11:17    [W:0.054 / U:15.176 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site