aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-11-27 17:21:19 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-11-27 17:21:19 -0500
commit9c8ff4f4dac189e4111238d54c2b12e7837f4818 (patch)
tree70bd1b82721b56e17ebdbb11b618c47864146061 /arch
parent86e67a07d4dc8cd40454698f2abb972fced06910 (diff)
parent645a8d94629fd812a220d54876339a1ddafd9bc2 (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.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/arch/alpha/kernel/pci-noop.c b/arch/alpha/kernel/pci-noop.c
index 174b729c50..468b76ce66 100644
--- a/arch/alpha/kernel/pci-noop.c
+++ b/arch/alpha/kernel/pci-noop.c
@@ -12,6 +12,7 @@
12#include <linux/errno.h> 12#include <linux/errno.h>
13#include <linux/sched.h> 13#include <linux/sched.h>
14#include <linux/dma-mapping.h> 14#include <linux/dma-mapping.h>
15#include <linux/scatterlist.h>
15 16
16#include "proto.h" 17#include "proto.h"
17 18
@@ -172,18 +173,19 @@ dma_alloc_coherent(struct device *dev, size_t size,
172EXPORT_SYMBOL(dma_alloc_coherent); 173EXPORT_SYMBOL(dma_alloc_coherent);
173 174
174int 175int
175dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, 176dma_map_sg(struct device *dev, struct scatterlist *sgl, int nents,
176 enum dma_data_direction direction) 177 enum dma_data_direction direction)
177{ 178{
178 int i; 179 int i;
180 struct scatterlist *sg;
179 181
180 for (i = 0; i < nents; i++ ) { 182 for_each_sg(sgl, sg, nents, i) {
181 void *va; 183 void *va;
182 184
183 BUG_ON(!sg[i].page); 185 BUG_ON(!sg_page(sg));
184 va = page_address(sg[i].page) + sg[i].offset; 186 va = sg_virt(sg);
185 sg_dma_address(sg + i) = (dma_addr_t)virt_to_bus(va); 187 sg_dma_address(sg) = (dma_addr_t)virt_to_bus(va);
186 sg_dma_len(sg + i) = sg[i].length; 188 sg_dma_len(sg) = sg->length;
187 } 189 }
188 190
189 return nents; 191 return nents;