Re: [PATCH v4 6/9] cpufreq: Add a new freq-table relation CPUFREQ_RELATION_E
From: Lukasz Luba <lukasz.luba@arm.com>
Date: 2021-07-22 08:17:11
From: Lukasz Luba <lukasz.luba@arm.com>
Date: 2021-07-22 08:17:11
On 7/8/21 11:09 AM, Vincent Donnefort wrote: [snip]
static inline int cpufreq_frequency_table_target(struct cpufreq_policy *policy,
unsigned int target_freq,
unsigned int relation)
{
+ unsigned int idx;
+
if (unlikely(policy->freq_table_sorted == CPUFREQ_TABLE_UNSORTED))
return cpufreq_table_index_unsorted(policy, target_freq,
relation);
+ relation = cpufreq_frequency_relation_efficient(policy, relation);
+
switch (relation) {
case CPUFREQ_RELATION_L:
- return cpufreq_table_find_index_l(policy, target_freq);Isn't a place where the 'fallthrough;' is needed? Any warnings seen maybe in other arch compiler?
+ case CPUFREQ_RELATION_E: + idx = cpufreq_table_find_index_l(policy, target_freq); + return relation == CPUFREQ_RELATION_L ? idx : + cpufreq_frequency_find_efficient(policy, idx); case CPUFREQ_RELATION_H: return cpufreq_table_find_index_h(policy, target_freq); case CPUFREQ_RELATION_C: