cpufreq: stats: pass 'stat' to cpufreq_stats_update()
authorViresh Kumar <viresh.kumar@linaro.org>
Tue, 6 Jan 2015 15:39:05 +0000 (21:09 +0530)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 23 Jan 2015 22:06:44 +0000 (23:06 +0100)
commit2aba0c1bae564a59fc38c407abf7985f9e347cc4
tree187084e0c331a68ca46754f57c868764032401f7
parentf93dbbbd108936b18b3230af36d9a36866ce69a7
cpufreq: stats: pass 'stat' to cpufreq_stats_update()

It is better to pass a struct cpufreq_stats pointer to cpufreq_stats_update()
instead of a CPU number, because that's all it needs.

Even if we pass a cpu number to cpufreq_stats_update(), it reads the per-cpu
variable to get 'stats' out of it. So we are doing these operations
unnecessarily:
- First getting the cpu number to pass to cpufreq_stats_update(), stat->cpu.
- And then getting stats from the cpu, per_cpu(cpufreq_stats_table, cpu).

Reviewed-by: Prarit Bhargava <prarit@redhat.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpufreq/cpufreq_stats.c