cpufreq: Use WARN_ON_ONCE() for invalid relation
The relation can't be invalid here, so if it turns out to be invalid, just WARN_ON_ONCE() and return 0. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
parent
681fe68448
commit
30b8e6b22f
|
@ -956,8 +956,8 @@ static inline int cpufreq_frequency_table_target(struct cpufreq_policy *policy,
|
||||||
case CPUFREQ_RELATION_C:
|
case CPUFREQ_RELATION_C:
|
||||||
return cpufreq_table_find_index_c(policy, target_freq);
|
return cpufreq_table_find_index_c(policy, target_freq);
|
||||||
default:
|
default:
|
||||||
pr_err("%s: Invalid relation: %d\n", __func__, relation);
|
WARN_ON_ONCE(1);
|
||||||
return -EINVAL;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue