Skip to contentSkip to conversation

: remove superflous BUG_ON's in nommu and gart

PATCH In review Muli Ben-Yehuda 2 participants 2 messages Aug 1, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 : remove superflous BUG_ON's in nommu and gart

There's no need to check for invalid DMA data direction in nommu and gart since we do it in dma-mapping.h anyway before calling the individual dma-ops.

arch/x86_64/kernel/pci-gart.c +0 -3
diff -r b90678f884c4 arch/x86_64/kernel/pci-gart.c
@@ -239,8 +239,6 @@ dma_addr_t gart_map_single(struct device
 {
 	unsigned long phys_mem, bus;
 
-	BUG_ON(dir == DMA_NONE);
-
 	if (!dev)
 		dev = &fallback_dev;
 
@@ -383,7 +381,6 @@ int gart_map_sg(struct device *dev, stru
 	unsigned long pages = 0;
 	int need = 0, nextneed;
 
-	BUG_ON(dir == DMA_NONE);
 	if (nents == 0) 
 		return 0;
 
arch/x86_64/kernel/pci-nommu.c +0 -1
diff -r b90678f884c4 arch/x86_64/kernel/pci-nommu.c
@@ -59,7 +59,6 @@ int nommu_map_sg(struct device *hwdev, s
 {
 	int i;
 
-	BUG_ON(direction == DMA_NONE);
  	for (i = 0; i < nents; i++ ) {
 		struct scatterlist *s = &sg[i];
 		BUG_ON(!s->page);
#1 lore raw
Quoted 3 lines · Muli Ben-Yehuda

There's no need to check for invalid DMA data direction in nommu and gart since we do it in dma-mapping.h anyway before calling the individual dma-ops.

Applied thanks

-Andi