diff options
author | Viresh Kumar <viresh.kumar@linaro.org> | 2016-05-26 01:57:24 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2016-06-02 17:24:40 -0400 |
commit | 910c6e881c3a610dfd7575b96975d4df21e3a920 (patch) | |
tree | 3a9cad787f82d4d5086c67d04d40543edbbe8d70 /drivers/cpufreq/cpufreq.c | |
parent | 388612baba201bdcedfa66782f524dcc507d9f12 (diff) |
cpufreq: Use clamp_val() in __cpufreq_driver_target()
Use clamp_val() instead of open coding it.
Signed-off-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 | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 364922fda428..198416bc22de 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c | |||
@@ -1923,10 +1923,7 @@ int __cpufreq_driver_target(struct cpufreq_policy *policy, | |||
1923 | return -ENODEV; | 1923 | return -ENODEV; |
1924 | 1924 | ||
1925 | /* Make sure that target_freq is within supported range */ | 1925 | /* Make sure that target_freq is within supported range */ |
1926 | if (target_freq > policy->max) | 1926 | target_freq = clamp_val(target_freq, policy->min, policy->max); |
1927 | target_freq = policy->max; | ||
1928 | if (target_freq < policy->min) | ||
1929 | target_freq = policy->min; | ||
1930 | 1927 | ||
1931 | pr_debug("target for CPU %u: %u kHz, relation %u, requested %u kHz\n", | 1928 | pr_debug("target for CPU %u: %u kHz, relation %u, requested %u kHz\n", |
1932 | policy->cpu, target_freq, relation, old_target_freq); | 1929 | policy->cpu, target_freq, relation, old_target_freq); |