On Friday, January 02, 2015 11:16:44 AM Viresh Kumar wrote:
cpufreq_stats_update_policy_cpu() doesn't do any useful stuff anymore and must be removed.
Well, "can be" sounds more appropriate than "must be". It wouldn't hurt to leave it as is, after all.
Along with it, also remove 'cpu' field from 'struct cpufreq_stats' as that isn't used as well.
It's the reverse. Because the cpu field is not necessary any more, it can be dropped *along* *with* cpufreq_stats_update_policy_cpu().
Modifying data structures is more important than dropping a trivial function and it should be described this way in the changelog.
Reviewed-by: Prarit Bhargava prarit@redhat.com Signed-off-by: Viresh Kumar viresh.kumar@linaro.org
drivers/cpufreq/cpufreq_stats.c | 14 -------------- 1 file changed, 14 deletions(-)
diff --git a/drivers/cpufreq/cpufreq_stats.c b/drivers/cpufreq/cpufreq_stats.c index 106c89ccef30..f458fdbc5bfd 100644 --- a/drivers/cpufreq/cpufreq_stats.c +++ b/drivers/cpufreq/cpufreq_stats.c @@ -18,7 +18,6 @@ static spinlock_t cpufreq_stats_lock; struct cpufreq_stats {
- unsigned int cpu; unsigned int total_trans; unsigned long long last_time; unsigned int max_state;
@@ -194,7 +193,6 @@ static int __cpufreq_stats_create_table(struct cpufreq_policy *policy) if (ret) goto error_out;
- stat->cpu = cpu; policy->stats_data = stat;
cpufreq_for_each_valid_entry(pos, table) @@ -251,24 +249,12 @@ static void cpufreq_stats_create_table(unsigned int cpu) cpufreq_cpu_put(policy); } -static void cpufreq_stats_update_policy_cpu(struct cpufreq_policy *policy) -{
- struct cpufreq_stats *stat = policy->stats_data;
- stat->cpu = policy->cpu;
Well, if you wrote it the way I suggested in the previous patch, it would be more obvious ...
-}
static int cpufreq_stat_notifier_policy(struct notifier_block *nb, unsigned long val, void *data) { int ret = 0; struct cpufreq_policy *policy = data;
- if (val == CPUFREQ_UPDATE_POLICY_CPU) {
cpufreq_stats_update_policy_cpu(policy);
return 0;
- }
- if (val == CPUFREQ_CREATE_POLICY) ret = __cpufreq_stats_create_table(policy); else if (val == CPUFREQ_REMOVE_POLICY)