x86: use WARN_ONCE in workaround for mtrr mask
authorYinghai Lu <yhlu.kernel@gmail.com>
Fri, 19 Sep 2008 18:45:04 +0000 (11:45 -0700)
committerIngo Molnar <mingo@elte.hu>
Mon, 22 Sep 2008 11:09:56 +0000 (13:09 +0200)
so could help catch attention about bug in bios about mtrr mask setting.

WARN_ONCE got into mainline already, lets use it.

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/x86/kernel/cpu/mtrr/generic.c

index cb7d3b6a80eb879670bd8a74864d01b587561dec..4e8d77f01eeb0913527373ed38a71795cc0b7be1 100644 (file)
@@ -401,12 +401,7 @@ static void generic_get_mtrr(unsigned int reg, unsigned long *base,
                tmp |= ~((1<<(hi - 1)) - 1);
 
                if (tmp != mask_lo) {
-                       static int once = 1;
-
-                       if (once) {
-                               printk(KERN_INFO "mtrr: your BIOS has set up an incorrect mask, fixing it up.\n");
-                               once = 0;
-                       }
+                       WARN_ONCE(1, KERN_INFO "mtrr: your BIOS has set up an incorrect mask, fixing it up.\n");
                        mask_lo = tmp;
                }
        }