]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/cpufreq/cpufreq_stats.c
parisc: types: use <asm-generic/int-*.h> for the parisc architecture
[linux-2.6-omap-h63xx.git] / drivers / cpufreq / cpufreq_stats.c
index 1b8312b0200675e81722def6d6b51134594e1250..ae70d63a8b26eabb2b02d8c2ea28721fcd934b2a 100644 (file)
@@ -114,7 +114,7 @@ show_trans_table(struct cpufreq_policy *policy, char *buf)
                                stat->freq_table[i]);
        }
        if (len >= PAGE_SIZE)
-               return len;
+               return PAGE_SIZE;
 
        len += snprintf(buf + len, PAGE_SIZE - len, "\n");
 
@@ -131,8 +131,12 @@ show_trans_table(struct cpufreq_policy *policy, char *buf)
                        len += snprintf(buf + len, PAGE_SIZE - len, "%9u ",
                                        stat->trans_table[i*stat->max_state+j]);
                }
+               if (len >= PAGE_SIZE)
+                       break;
                len += snprintf(buf + len, PAGE_SIZE - len, "\n");
        }
+       if (len >= PAGE_SIZE)
+               return PAGE_SIZE;
        return len;
 }
 CPUFREQ_STATDEVICE_ATTR(trans_table,0444,show_trans_table);
@@ -284,7 +288,7 @@ cpufreq_stat_notifier_trans (struct notifier_block *nb, unsigned long val,
        if (!stat)
                return 0;
 
-       old_index = freq_table_get_index(stat, freq->old);
+       old_index = stat->last_index;
        new_index = freq_table_get_index(stat, freq->new);
 
        cpufreq_stats_update(freq->cpu);
@@ -323,7 +327,7 @@ static int __cpuinit cpufreq_stat_cpu_callback(struct notifier_block *nfb,
        return NOTIFY_OK;
 }
 
-static struct notifier_block cpufreq_stat_cpu_notifier __cpuinitdata =
+static struct notifier_block cpufreq_stat_cpu_notifier __refdata =
 {
        .notifier_call = cpufreq_stat_cpu_callback,
 };