int ret, count = 0, i;
struct cpufreq_policy *policy = data;
struct cpufreq_frequency_table *table;
- unsigned int cpu = policy->cpu;
+ unsigned int cpu_num, cpu = policy->cpu;
if (val == CPUFREQ_UPDATE_POLICY_CPU) {
cpufreq_stats_update_policy_cpu(policy);
if (!per_cpu(all_cpufreq_stats, cpu))
cpufreq_allstats_create(cpu, table, count);
- if (!per_cpu(cpufreq_power_stats, cpu))
- cpufreq_powerstats_create(cpu, table, count);
+ for_each_possible_cpu(cpu_num) {
+ if (!per_cpu(cpufreq_power_stats, cpu_num))
+ cpufreq_powerstats_create(cpu_num, table, count);
+ }
ret = cpufreq_stats_create_table(policy, table, count);
if (ret)
{
struct cpufreq_policy *policy;
struct cpufreq_frequency_table *table;
- int ret = -ENODEV, i, count = 0;
+ int i, count, cpu_num, ret = -ENODEV;
policy = cpufreq_cpu_get(cpu);
if (!policy)
if (!table)
goto out;
+ count = 0;
for (i = 0; table[i].frequency != CPUFREQ_TABLE_END; i++) {
unsigned int freq = table[i].frequency;
- if (freq == CPUFREQ_ENTRY_INVALID)
- continue;
- count++;
+ if (freq != CPUFREQ_ENTRY_INVALID)
+ count++;
}
if (!per_cpu(all_cpufreq_stats, cpu))
cpufreq_allstats_create(cpu, table, count);
- if (!per_cpu(cpufreq_power_stats, cpu))
- cpufreq_powerstats_create(cpu, table, count);
+ for_each_possible_cpu(cpu_num) {
+ if (!per_cpu(cpufreq_power_stats, cpu_num))
+ cpufreq_powerstats_create(cpu_num, table, count);
+ }
ret = cpufreq_stats_create_table(policy, table, count);