summaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2015-02-19 12:32:05 +0100
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2015-05-07 23:29:57 +0200
commit1b947c904c4831d787c1f17a6a6cd40c7144ba85 (patch)
tree35b6136bf6557945b3568440be37ddf70256bcaa /drivers/cpufreq
parentcpufreq: Merge __cpufreq_add_dev() and cpufreq_add_dev() (diff)
downloadlinux-1b947c904c4831d787c1f17a6a6cd40c7144ba85.tar.xz
linux-1b947c904c4831d787c1f17a6a6cd40c7144ba85.zip
cpufreq: Throw warning when we try to get policy for an invalid CPU
Simply returning here with an error is not enough. It shouldn't be allowed at all to try calling cpufreq_cpu_get() for an invalid CPU. Add a WARN here to make it clear that it wouldn't be acceptable at all. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Acked-by: Saravana Kannan <skannan@codeaurora.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpufreq')
-rw-r--r--drivers/cpufreq/cpufreq.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index ee3d920ae207..48ca0764eb52 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -229,7 +229,7 @@ struct cpufreq_policy *cpufreq_cpu_get(unsigned int cpu)
struct cpufreq_policy *policy = NULL;
unsigned long flags;
- if (cpu >= nr_cpu_ids)
+ if (WARN_ON(cpu >= nr_cpu_ids))
return NULL;
if (!down_read_trylock(&cpufreq_rwsem))