From: Rafael J. Wysocki Date: Thu, 25 Feb 2016 23:22:57 +0000 (+0100) Subject: cpufreq: Simplify the cpufreq_for_each_valid_entry() X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=34b0870515aaac6b7ea1ffdc370516b0a8024c82;p=openwrt%2Fstaging%2Fblogic.git cpufreq: Simplify the cpufreq_for_each_valid_entry() That macro uses an internal static inline function that is first totally unnecessary and second hard to read, so simplify it and get rid of that monster. No functional changes. Signed-off-by: Rafael J. Wysocki Acked-by: Viresh Kumar --- diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index d0bf555b6bbf..4064cfcfbffd 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h @@ -504,16 +504,6 @@ static inline void dev_pm_opp_free_cpufreq_table(struct device *dev, } #endif -static inline bool cpufreq_next_valid(struct cpufreq_frequency_table **pos) -{ - while ((*pos)->frequency != CPUFREQ_TABLE_END) - if ((*pos)->frequency != CPUFREQ_ENTRY_INVALID) - return true; - else - (*pos)++; - return false; -} - /* * cpufreq_for_each_entry - iterate over a cpufreq_frequency_table * @pos: the cpufreq_frequency_table * to use as a loop cursor. @@ -530,8 +520,11 @@ static inline bool cpufreq_next_valid(struct cpufreq_frequency_table **pos) * @table: the cpufreq_frequency_table * to iterate over. */ -#define cpufreq_for_each_valid_entry(pos, table) \ - for (pos = table; cpufreq_next_valid(&pos); pos++) +#define cpufreq_for_each_valid_entry(pos, table) \ + for (pos = table; pos->frequency != CPUFREQ_TABLE_END; pos++) \ + if (pos->frequency == CPUFREQ_ENTRY_INVALID) \ + continue; \ + else int cpufreq_frequency_table_cpuinfo(struct cpufreq_policy *policy, struct cpufreq_frequency_table *table);