x86: use WARN() in arch/x86/kernel

Use WARN() instead of a printk+WARN_ON() pair; this way the message
becomes part of the warning section for better reporting/collection.
This also allowed the folding of some if()'s into the WARN()

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Cc: akpm@linux-foundation.org
Signed-off-by: Ingo Molnar <mingo@elte.hu>

authored by Arjan van de Ven and committed by Ingo Molnar bde78a79 0c072bb4

+4 -10
+1 -4
arch/x86/kernel/cpu/mtrr/main.c
··· 1496 1497 /* kvm/qemu doesn't have mtrr set right, don't trim them all */ 1498 if (!highest_pfn) { 1499 - if (!kvm_para_available()) { 1500 - printk(KERN_WARNING 1501 "WARNING: strange, CPU MTRRs all blank?\n"); 1502 - WARN_ON(1); 1503 - } 1504 return 0; 1505 } 1506
··· 1496 1497 /* kvm/qemu doesn't have mtrr set right, don't trim them all */ 1498 if (!highest_pfn) { 1499 + WARN(!kvm_para_available(), KERN_WARNING 1500 "WARNING: strange, CPU MTRRs all blank?\n"); 1501 return 0; 1502 } 1503
+1 -2
arch/x86/kernel/pci-calgary_64.c
··· 343 /* were we called with bad_dma_address? */ 344 badend = bad_dma_address + (EMERGENCY_PAGES * PAGE_SIZE); 345 if (unlikely((dma_addr >= bad_dma_address) && (dma_addr < badend))) { 346 - printk(KERN_ERR "Calgary: driver tried unmapping bad DMA " 347 "address 0x%Lx\n", dma_addr); 348 - WARN_ON(1); 349 return; 350 } 351
··· 343 /* were we called with bad_dma_address? */ 344 badend = bad_dma_address + (EMERGENCY_PAGES * PAGE_SIZE); 345 if (unlikely((dma_addr >= bad_dma_address) && (dma_addr < badend))) { 346 + WARN(1, KERN_ERR "Calgary: driver tried unmapping bad DMA " 347 "address 0x%Lx\n", dma_addr); 348 return; 349 } 350
+2 -4
arch/x86/kernel/tsc_sync.c
··· 88 __raw_spin_unlock(&sync_lock); 89 } 90 } 91 - if (!(now-start)) { 92 - printk("Warning: zero tsc calibration delta: %Ld [max: %Ld]\n", 93 now-start, end-start); 94 - WARN_ON(1); 95 - } 96 } 97 98 /*
··· 88 __raw_spin_unlock(&sync_lock); 89 } 90 } 91 + WARN(!(now-start), 92 + "Warning: zero tsc calibration delta: %Ld [max: %Ld]\n", 93 now-start, end-start); 94 } 95 96 /*