cpufreq: stats: initialize 'cur_time' on its definition
authorViresh Kumar <viresh.kumar@linaro.org>
Tue, 6 Jan 2015 15:39:03 +0000 (21:09 +0530)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 23 Jan 2015 22:06:43 +0000 (23:06 +0100)
'cur_time' is defined in the first line and is then assigned a value
in the next line. Initialize it while defining it.

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

index 14f8d858a63d792b975aba84c39f274dc91c431f..21bec770569df6ab336a8814334addd31078d740 100644 (file)
@@ -36,9 +36,8 @@ static DEFINE_PER_CPU(struct cpufreq_stats *, cpufreq_stats_table);
 static int cpufreq_stats_update(unsigned int cpu)
 {
        struct cpufreq_stats *stat;
-       unsigned long long cur_time;
+       unsigned long long cur_time = get_jiffies_64();
 
-       cur_time = get_jiffies_64();
        spin_lock(&cpufreq_stats_lock);
        stat = per_cpu(cpufreq_stats_table, cpu);
        if (stat->time_in_state)