]> Pileus Git - ~andy/linux/commitdiff
x86: Fix cpu_devs[] initialization in early_cpu_init()
authorIngo Molnar <mingo@elte.hu>
Sat, 14 Nov 2009 09:34:41 +0000 (10:34 +0100)
committerIngo Molnar <mingo@elte.hu>
Sat, 14 Nov 2009 09:36:50 +0000 (10:36 +0100)
Yinghai Lu noticed that this commit:

  0388423: x86: Minimise printk spew from per-vendor init code

mistakenly left out the initialization of cpu_devs[] in the
!PROCESSOR_SELECT case. Fix it.

Reported-by: Yinghai Lu <yinghai@kernel.org>
Cc: Dave Jones <davej@redhat.com>
LKML-Reference: <20091113203000.GA19160@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/x86/kernel/cpu/common.c

index 9db1e2425c27a836d1f40d1c39c8939dc1e5b7bc..61242a56c2d6db7de1f788c97a68e22003a3042f 100644 (file)
@@ -651,28 +651,34 @@ static void __init early_identify_cpu(struct cpuinfo_x86 *c)
 
 void __init early_cpu_init(void)
 {
-#ifdef PROCESSOR_SELECT
        const struct cpu_dev *const *cdev;
        int count = 0;
 
+#ifdef PROCESSOR_SELECT
        printk(KERN_INFO "KERNEL supported cpus:\n");
+#endif
+
        for (cdev = __x86_cpu_dev_start; cdev < __x86_cpu_dev_end; cdev++) {
                const struct cpu_dev *cpudev = *cdev;
-               unsigned int j;
 
                if (count >= X86_VENDOR_NUM)
                        break;
                cpu_devs[count] = cpudev;
                count++;
 
-               for (j = 0; j < 2; j++) {
-                       if (!cpudev->c_ident[j])
-                               continue;
-                       printk(KERN_INFO "  %s %s\n", cpudev->c_vendor,
-                               cpudev->c_ident[j]);
+#ifdef PROCESSOR_SELECT
+               {
+                       unsigned int j;
+
+                       for (j = 0; j < 2; j++) {
+                               if (!cpudev->c_ident[j])
+                                       continue;
+                               printk(KERN_INFO "  %s %s\n", cpudev->c_vendor,
+                                       cpudev->c_ident[j]);
+                       }
                }
-       }
 #endif
+       }
        early_identify_cpu(&boot_cpu_data);
 }