[CPUFREQ] powernow-k8 cleanup msg if BIOS does not export ACPI _PSS cpufreq data
[sfrench/cifs-2.6.git] / arch / x86 / kernel / cpu / cpufreq / powernow-k8.c
index a15ac94e0b9b8c2ad1ee540fc7bad1b5415aff36..feef10c085a1dee0bc7dc76ed9ea0cf047e79bf3 100644 (file)
@@ -54,7 +54,10 @@ static DEFINE_PER_CPU(struct powernow_k8_data *, powernow_data);
 static int cpu_family = CPU_OPTERON;
 
 #ifndef CONFIG_SMP
-DEFINE_PER_CPU(cpumask_t, cpu_core_map);
+static inline const struct cpumask *cpu_core_mask(int cpu)
+{
+       return cpumask_of(0);
+}
 #endif
 
 /* Return a frequency in MHz, given an input fid */
@@ -699,7 +702,7 @@ static int fill_powernow_table(struct powernow_k8_data *data,
 
        dprintk("cfid 0x%x, cvid 0x%x\n", data->currfid, data->currvid);
        data->powernow_table = powernow_table;
-       if (first_cpu(per_cpu(cpu_core_map, data->cpu)) == data->cpu)
+       if (cpumask_first(cpu_core_mask(data->cpu)) == data->cpu)
                print_basics(data);
 
        for (j = 0; j < data->numps; j++)
@@ -862,7 +865,7 @@ static int powernow_k8_cpu_init_acpi(struct powernow_k8_data *data)
 
        /* fill in data */
        data->numps = data->acpi_data.state_count;
-       if (first_cpu(per_cpu(cpu_core_map, data->cpu)) == data->cpu)
+       if (cpumask_first(cpu_core_mask(data->cpu)) == data->cpu)
                print_basics(data);
        powernow_k8_acpi_pst_values(data, 0);
 
@@ -1212,13 +1215,16 @@ static int powernowk8_verify(struct cpufreq_policy *pol)
        return cpufreq_frequency_table_verify(pol, data->powernow_table);
 }
 
+static const char ACPI_PSS_BIOS_BUG_MSG[] =
+       KERN_ERR FW_BUG PFX "No compatible ACPI _PSS objects found.\n"
+       KERN_ERR FW_BUG PFX "Try again with latest BIOS.\n";
+
 /* per CPU init entry point to the driver */
 static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol)
 {
        struct powernow_k8_data *data;
        cpumask_t oldmask;
        int rc;
-       static int print_once;
 
        if (!cpu_online(pol->cpu))
                return -ENODEV;
@@ -1241,19 +1247,7 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol)
                 * an UP version, and is deprecated by AMD.
                 */
                if (num_online_cpus() != 1) {
-                       /*
-                        * Replace this one with print_once as soon as such a
-                        * thing gets introduced
-                        */
-                       if (!print_once) {
-                               WARN_ONCE(1, KERN_ERR FW_BUG PFX "Your BIOS "
-                                       "does not provide ACPI _PSS objects "
-                                       "in a way that Linux understands. "
-                                       "Please report this to the Linux ACPI"
-                                       " maintainers and complain to your "
-                                       "BIOS vendor.\n");
-                               print_once++;
-                       }
+                       printk_once(ACPI_PSS_BIOS_BUG_MSG);
                        goto err_out;
                }
                if (pol->cpu != 0) {
@@ -1300,7 +1294,7 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol)
        if (cpu_family == CPU_HW_PSTATE)
                cpumask_copy(pol->cpus, cpumask_of(pol->cpu));
        else
-               cpumask_copy(pol->cpus, &per_cpu(cpu_core_map, pol->cpu));
+               cpumask_copy(pol->cpus, cpu_core_mask(pol->cpu));
        data->available_cores = pol->cpus;
 
        if (cpu_family == CPU_HW_PSTATE)
@@ -1365,7 +1359,7 @@ static unsigned int powernowk8_get(unsigned int cpu)
        unsigned int khz = 0;
        unsigned int first;
 
-       first = first_cpu(per_cpu(cpu_core_map, cpu));
+       first = cpumask_first(cpu_core_mask(cpu));
        data = per_cpu(powernow_data, first);
 
        if (!data)