diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-11-27 14:21:19 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-11-27 14:21:19 -0800 |
commit | 9c8ff4f4dac189e4111238d54c2b12e7837f4818 (patch) | |
tree | 70bd1b82721b56e17ebdbb11b618c47864146061 /arch | |
parent | 86e67a07d4dc8cd40454698f2abb972fced06910 (diff) | |
parent | 645a8d94629fd812a220d54876339a1ddafd9bc2 (diff) |
Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block
* 'for-linus' of git://git.kernel.dk/linux-2.6-block:
scatterlist: add more safeguards
Revert "ll_rw_blk: temporarily enable max_segments tweaking"
mmc: Add missing sg_init_table() call
block: Fix memory leak in alloc_disk_node()
alpha: fix sg_page breakage
blktrace: Make sure BLKTRACETEARDOWN does the full cleanup.
Diffstat (limited to 'arch')
-rw-r--r-- | arch/alpha/kernel/pci-noop.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/arch/alpha/kernel/pci-noop.c b/arch/alpha/kernel/pci-noop.c index 174b729c504..468b76ce66a 100644 --- a/arch/alpha/kernel/pci-noop.c +++ b/arch/alpha/kernel/pci-noop.c @@ -12,6 +12,7 @@ #include <linux/errno.h> #include <linux/sched.h> #include <linux/dma-mapping.h> +#include <linux/scatterlist.h> #include "proto.h" @@ -172,18 +173,19 @@ dma_alloc_coherent(struct device *dev, size_t size, EXPORT_SYMBOL(dma_alloc_coherent); int -dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, +dma_map_sg(struct device *dev, struct scatterlist *sgl, int nents, enum dma_data_direction direction) { int i; + struct scatterlist *sg; - for (i = 0; i < nents; i++ ) { + for_each_sg(sgl, sg, nents, i) { void *va; - BUG_ON(!sg[i].page); - va = page_address(sg[i].page) + sg[i].offset; - sg_dma_address(sg + i) = (dma_addr_t)virt_to_bus(va); - sg_dma_len(sg + i) = sg[i].length; + BUG_ON(!sg_page(sg)); + va = sg_virt(sg); + sg_dma_address(sg) = (dma_addr_t)virt_to_bus(va); + sg_dma_len(sg) = sg->length; } return nents; |