[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080708095156.6c769cfe@infradead.org>
Date: Tue, 8 Jul 2008 09:51:56 -0700
From: Arjan van de Ven <arjan@...radead.org>
To: Arjan van de Ven <arjan@...radead.org>,
linux-kernel@...r.kernel.org
Cc: akpm@...ux-foundation.org, mingo@...e.hu
Subject: [patch 11/17] Use WARN() in arch/x86/kernel
From: Arjan van de Ven <arjan@...ux.intel.com>
Subject: Use WARN instead of printk+WARN_ON 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@...ux.intel.com>
Acked-by: Ingo Molnar <mingo@...e.hu>
---
arch/x86/kernel/cpu/mtrr/main.c | 5 +----
arch/x86/kernel/pci-calgary_64.c | 3 +--
arch/x86/kernel/tsc_sync.c | 6 ++----
3 files changed, 4 insertions(+), 10 deletions(-)
Index: linux.trees.git/arch/x86/kernel/pci-calgary_64.c
===================================================================
--- linux.trees.git.orig/arch/x86/kernel/pci-calgary_64.c
+++ linux.trees.git/arch/x86/kernel/pci-calgary_64.c
@@ -339,9 +339,8 @@ static void iommu_free(struct iommu_tabl
/* were we called with bad_dma_address? */
badend = bad_dma_address + (EMERGENCY_PAGES * PAGE_SIZE);
if (unlikely((dma_addr >= bad_dma_address) && (dma_addr < badend))) {
- printk(KERN_ERR "Calgary: driver tried unmapping bad DMA "
+ WARN(1, KERN_ERR "Calgary: driver tried unmapping bad DMA "
"address 0x%Lx\n", dma_addr);
- WARN_ON(1);
return;
}
Index: linux.trees.git/arch/x86/kernel/tsc_sync.c
===================================================================
--- linux.trees.git.orig/arch/x86/kernel/tsc_sync.c
+++ linux.trees.git/arch/x86/kernel/tsc_sync.c
@@ -88,11 +88,9 @@ static __cpuinit void check_tsc_warp(voi
__raw_spin_unlock(&sync_lock);
}
}
- if (!(now-start)) {
- printk("Warning: zero tsc calibration delta: %Ld [max: %Ld]\n",
+ WARN(!(now-start),
+ "Warning: zero tsc calibration delta: %Ld [max: %Ld]\n",
now-start, end-start);
- WARN_ON(1);
- }
}
/*
Index: linux.trees.git/arch/x86/kernel/cpu/mtrr/main.c
===================================================================
--- linux.trees.git.orig/arch/x86/kernel/cpu/mtrr/main.c
+++ linux.trees.git/arch/x86/kernel/cpu/mtrr/main.c
@@ -1496,11 +1496,8 @@ int __init mtrr_trim_uncached_memory(uns
/* kvm/qemu doesn't have mtrr set right, don't trim them all */
if (!highest_pfn) {
- if (!kvm_para_available()) {
- printk(KERN_WARNING
+ WARN(!kvm_para_available(), KERN_WARNING
"WARNING: strange, CPU MTRRs all blank?\n");
- WARN_ON(1);
- }
return 0;
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists