Skip to contentSkip to conversation

pci dma patch rediffed for 2.5.21

PATCH New Benjamin LaHaise 1 participant 1 message Jun 11, 2002

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pci dma patch rediffed for 2.5.21

Hello all,

This is the same patch as was posted against 2.4.19-pre10: pci_map_page was missing a cast on x86, which resulted in the high 32 bits of an address being silently discarded. This patch fixes that by casting the page number before multiplying it out.

-ben

Signature · 15 lines
"You will be reincarnated as a toad; and you will be much happier."

:r ~/patches/v2.5/v2.5.21-pci.diff
diff -urN v2.5.21/include/asm-i386/pci.h pci/include/asm-i386/pci.h
--- v2.5.21/include/asm-i386/pci.h	Mon Jun 10 21:41:10 2002
+++ pci/include/asm-i386/pci.h	Mon Jun 10 21:54:11 2002
@@ -109,7 +109,7 @@
 	if (direction == PCI_DMA_NONE)
 		BUG();
 
-	return (page - mem_map) * PAGE_SIZE + offset;
+	return (dma_addr_t)(page - mem_map) * PAGE_SIZE + offset;
 }
 
 static inline void pci_unmap_page(struct pci_dev *hwdev, dma_addr_t dma_address,