diff options
author | Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com> | 2013-09-12 17:29:09 +0530 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-10-17 01:09:16 +0200 |
commit | 99ec899eafe2ec0a7dd96e9de5fa0a2bea3032ba (patch) | |
tree | f3772a586e3cdd622df90deb551b8bda31397cd5 /drivers/cpufreq/cpufreq.c | |
parent | 891083622621bfe114ec4d40711a7d3a68fdc6fc (diff) | |
download | lwn-99ec899eafe2ec0a7dd96e9de5fa0a2bea3032ba.tar.gz lwn-99ec899eafe2ec0a7dd96e9de5fa0a2bea3032ba.zip |
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: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpufreq/cpufreq.c')
-rw-r--r-- | drivers/cpufreq/cpufreq.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index f0897c75468b..ec391d7f010b 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -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; /* |