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>
This commit is contained in:
committed by
Rafael J. Wysocki
parent
388612baba
commit
910c6e881c
@@ -1923,10 +1923,7 @@ int __cpufreq_driver_target(struct cpufreq_policy *policy,
|
|||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
/* Make sure that target_freq is within supported range */
|
/* Make sure that target_freq is within supported range */
|
||||||
if (target_freq > policy->max)
|
target_freq = clamp_val(target_freq, policy->min, policy->max);
|
||||||
target_freq = policy->max;
|
|
||||||
if (target_freq < policy->min)
|
|
||||||
target_freq = policy->min;
|
|
||||||
|
|
||||||
pr_debug("target for CPU %u: %u kHz, relation %u, requested %u kHz\n",
|
pr_debug("target for CPU %u: %u kHz, relation %u, requested %u kHz\n",
|
||||||
policy->cpu, target_freq, relation, old_target_freq);
|
policy->cpu, target_freq, relation, old_target_freq);
|
||||||
|
|||||||
Reference in New Issue
Block a user