summaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/arm_big_little.c
diff options
context:
space:
mode:
authorStratos Karafotis <stratosk@semaphore.gr>2014-04-25 22:15:38 +0200
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-04-30 00:06:21 +0200
commit041526f915a90b2b628cd0253e2c85da8040276d (patch)
tree0d2a0c45505584f942bd30723af84d2c09261de3 /drivers/cpufreq/arm_big_little.c
parentcpufreq: Introduce macros for cpufreq_frequency_table iteration (diff)
downloadlinux-041526f915a90b2b628cd0253e2c85da8040276d.tar.xz
linux-041526f915a90b2b628cd0253e2c85da8040276d.zip
cpufreq: Use cpufreq_for_each_* macros for frequency table iteration
The cpufreq core now supports the cpufreq_for_each_entry and cpufreq_for_each_valid_entry macros helpers for iteration over the cpufreq_frequency_table, so use them. It should have no functional changes. Signed-off-by: Stratos Karafotis <stratosk@semaphore.gr> Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpufreq/arm_big_little.c')
-rw-r--r--drivers/cpufreq/arm_big_little.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/cpufreq/arm_big_little.c b/drivers/cpufreq/arm_big_little.c
index bad2ed317ba2..1f4d4e315057 100644
--- a/drivers/cpufreq/arm_big_little.c
+++ b/drivers/cpufreq/arm_big_little.c
@@ -226,22 +226,22 @@ static inline u32 get_table_count(struct cpufreq_frequency_table *table)
/* get the minimum frequency in the cpufreq_frequency_table */
static inline u32 get_table_min(struct cpufreq_frequency_table *table)
{
- int i;
+ struct cpufreq_frequency_table *pos;
uint32_t min_freq = ~0;
- for (i = 0; (table[i].frequency != CPUFREQ_TABLE_END); i++)
- if (table[i].frequency < min_freq)
- min_freq = table[i].frequency;
+ cpufreq_for_each_entry(pos, table)
+ if (pos->frequency < min_freq)
+ min_freq = pos->frequency;
return min_freq;
}
/* get the maximum frequency in the cpufreq_frequency_table */
static inline u32 get_table_max(struct cpufreq_frequency_table *table)
{
- int i;
+ struct cpufreq_frequency_table *pos;
uint32_t max_freq = 0;
- for (i = 0; (table[i].frequency != CPUFREQ_TABLE_END); i++)
- if (table[i].frequency > max_freq)
- max_freq = table[i].frequency;
+ cpufreq_for_each_entry(pos, table)
+ if (pos->frequency > max_freq)
+ max_freq = pos->frequency;
return max_freq;
}