Skip to contentSkip to conversation

Fix cosmetic issue in powernow-k8 error handling

PATCH New Andi Kleen 1 participant 1 message Aug 9, 2004

lore
Share & tools
lore

Andi Kleen

author
#0 lore raw

PATCH 1/1 Fix cosmetic issue in powernow-k8 error handling

I tried to load the new SMP capable powernow k8 driver on a machine with an too old BIOS. I got a lot of cryptic "init not cpu 0" messages until the "MP systems not supported by PSB ..." message.

This patch switches the order of the checks around to print the other message first. It will be still printed multiple times because the cpufreq setup will probe all CPUs, but that's probably ok.

BTW I also looked at converting the code to smp_call_function (because Paul complained about the set_cpus_allowed in his OLS presentation). But the code would have been more complicated with this change so I left it like it is.

-Andi

arch/i386/kernel/cpu/cpufreq/powernow-k8.c renamed from arch/i386/kernel/cpu/cpufreq/powernow-k8.c-o +4 -4
diff -u linux-2.6.8rc3-amd64/arch/i386/kernel/cpu/cpufreq/powernow-k8.c-o linux-2.6.8rc3-amd64/arch/i386/kernel/cpu/cpufreq/powernow-k8.c
@@ -948,13 +948,13 @@
 		 * an UP version, and is deprecated by AMD.
 		 */
 
-		if (pol->cpu != 0) {
-			printk(KERN_ERR PFX "init not cpu 0\n");
+		if ((num_online_cpus() != 1) || (num_possible_cpus() != 1)) {
+			printk(KERN_INFO PFX "MP systems not supported by PSB BIOS structure\n");
 			kfree(data);
 			return -ENODEV;
 		}
-		if ((num_online_cpus() != 1) || (num_possible_cpus() != 1)) {
-			printk(KERN_INFO PFX "MP systems not supported by PSB BIOS structure\n");
+		if (pol->cpu != 0) {
+			printk(KERN_ERR PFX "init not cpu 0\n");
 			kfree(data);
 			return -ENODEV;
 		}