aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/pci-nommu_64.c
diff options
context:
space:
mode:
authorGlauber Costa <gcosta@redhat.com>2008-04-08 12:20:49 -0400
committerIngo Molnar <mingo@elte.hu>2008-04-19 13:19:57 -0400
commit5b3e5b7273435f8a7f83d3556a09adfd6f247e36 (patch)
treebc2406c017d2e570d33e0e349e028a9213518b1e /arch/x86/kernel/pci-nommu_64.c
parent30db2cbf38d68f466fd34488f8312a151225c9ac (diff)
x86: use WARN_ON in mapping functions
In the very same way i386 do, we use WARN_ON functions in map_simple and map_sg. Signed-off-by: Glauber Costa <gcosta@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel/pci-nommu_64.c')
-rw-r--r--arch/x86/kernel/pci-nommu_64.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/x86/kernel/pci-nommu_64.c b/arch/x86/kernel/pci-nommu_64.c
index c6901e751770..8d036aee2a8d 100644
--- a/arch/x86/kernel/pci-nommu_64.c
+++ b/arch/x86/kernel/pci-nommu_64.c
@@ -30,6 +30,7 @@ nommu_map_single(struct device *hwdev, phys_addr_t paddr, size_t size,
30 int direction) 30 int direction)
31{ 31{
32 dma_addr_t bus = paddr; 32 dma_addr_t bus = paddr;
33 WARN_ON(size == 0);
33 if (!check_addr("map_single", hwdev, bus, size)) 34 if (!check_addr("map_single", hwdev, bus, size))
34 return bad_dma_address; 35 return bad_dma_address;
35 flush_write_buffers(); 36 flush_write_buffers();
@@ -58,6 +59,8 @@ static int nommu_map_sg(struct device *hwdev, struct scatterlist *sg,
58 struct scatterlist *s; 59 struct scatterlist *s;
59 int i; 60 int i;
60 61
62 WARN_ON(nents == 0 || sg[0].length == 0);
63
61 for_each_sg(sg, s, nents, i) { 64 for_each_sg(sg, s, nents, i) {
62 BUG_ON(!sg_page(s)); 65 BUG_ON(!sg_page(s));
63 s->dma_address = sg_phys(s); 66 s->dma_address = sg_phys(s);