mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-16 11:32:41 +00:00
cpufreq: create cpufreq_table_count_valid_entries()
We need such a routine at two places already, lets create one. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Lukasz Luba <lukasz.luba@arm.com> Tested-by: Lukasz Luba <lukasz.luba@arm.com> Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
This commit is contained in:
parent
4d753aa7b6
commit
55d8529313
3 changed files with 27 additions and 22 deletions
|
@ -862,6 +862,20 @@ static inline int cpufreq_frequency_table_target(struct cpufreq_policy *policy,
|
|||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
static inline int cpufreq_table_count_valid_entries(const struct cpufreq_policy *policy)
|
||||
{
|
||||
struct cpufreq_frequency_table *pos;
|
||||
int count = 0;
|
||||
|
||||
if (unlikely(!policy->freq_table))
|
||||
return 0;
|
||||
|
||||
cpufreq_for_each_valid_entry(pos, policy->freq_table)
|
||||
count++;
|
||||
|
||||
return count;
|
||||
}
|
||||
#else
|
||||
static inline int cpufreq_boost_trigger_state(int state)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue