Message ID | 53e8e4e9a40d2759ebdecfe4649f9ecee112a330.1420177186.git.viresh.kumar@linaro.org |
---|---|
State | New |
Headers | show |
On 4 January 2015 at 03:55, Rafael J. Wysocki <rjw@rjwysocki.net> wrote: > Well, "can be" sounds more appropriate than "must be". It wouldn't hurt to > leave it as is, after all. > 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. > Well, if you wrote it the way I suggested in the previous patch, it would be > more obvious ... Ack. -- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
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; -} - 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)