Skip to contentSkip to conversation

x86: use WARN_ONCE in workaround for mtrr mask

PATCH Applied Yinghai Lu 2 participants 2 messages Sep 19, 2008 – Sep 22, 2008 x86

lore
Share & tools
lore

Yinghai Lu

author
#0 lore raw

PATCH 1/1 x86: use WARN_ONCE in workaround for mtrr mask

so could help to catch attention about bug in bios about mtrr mask setting

WARN_ONCE get into mainline already. let use it.

---
 arch/x86/kernel/cpu/mtrr/generic.c |    7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
arch/x86/kernel/cpu/mtrr/generic.c +1 -6
Index: linux-2.6/arch/x86/kernel/cpu/mtrr/generic.c
===================================================================
@@ -401,12 +401,7 @@ static void generic_get_mtrr(unsigned in
 		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;
 		}
 	}
Applied
#1 lore raw
Quoted 5 lines · Yinghai Lu

so could help to catch attention about bug in bios about mtrr mask setting

WARN_ONCE get into mainline already. let use it.

applied to tip/x86/debug, thanks Yinghai!

Ingo