Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 99ec899e authored by Srivatsa S. Bhat's avatar Srivatsa S. Bhat Committed by Rafael J. Wysocki
Browse files

cpufreq: Detect spurious invocations of update_policy_cpu()



The function update_policy_cpu() is expected to be called when the policy->cpu
of a cpufreq policy is to be changed: ie., the new CPU nominated to become the
policy->cpu is different from the old one.

Print a warning if it is invoked with new_cpu == old_cpu, since such an
invocation might hint at a faulty logic in the caller.

Suggested-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarSrivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 89108362
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -969,7 +969,7 @@ static void cpufreq_policy_free(struct cpufreq_policy *policy)

static void update_policy_cpu(struct cpufreq_policy *policy, unsigned int cpu)
{
	if (cpu == policy->cpu)
	if (WARN_ON(cpu == policy->cpu))
		return;

	/*