public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* alpha: fix sg_page breakage
@ 2007-11-17  7:52 FUJITA Tomonori
  2007-11-19 13:46 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: FUJITA Tomonori @ 2007-11-17  7:52 UTC (permalink / raw)
  To: jens.axboe; +Cc: linux-kernel, fujita.tomonori

arch/alpha/kernel/pci-noop.c:167: warning: 'virt_to_bus' is deprecated (declared at include2/asm/io.h:117)
arch/alpha/kernel/pci-noop.c: In function 'dma_map_sg':
arch/alpha/kernel/pci-noop.c:183: error: 'struct scatterlist' has no member named 'page'
arch/alpha/kernel/pci-noop.c:184: error: 'struct scatterlist' has no member named 'page'
arch/alpha/kernel/pci-noop.c:185: warning: 'virt_to_bus' is deprecated (declared at include2/asm/io.h:11)

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
---
 arch/alpha/kernel/pci-noop.c |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/arch/alpha/kernel/pci-noop.c b/arch/alpha/kernel/pci-noop.c
index 174b729..8ac0831 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"
 
@@ -164,7 +165,7 @@ dma_alloc_coherent(struct device *dev, size_t size,
 	ret = (void *)__get_free_pages(gfp, get_order(size));
 	if (ret) {
 		memset(ret, 0, size);
-		*dma_handle = virt_to_bus(ret);
+		*dma_handle = virt_to_phys(ret);
 	}
 	return ret;
 }
@@ -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_phys(va);
+		sg_dma_len(sg) = sg->length;
 	}
 
 	return nents;
-- 
1.5.2.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: alpha: fix sg_page breakage
  2007-11-17  7:52 alpha: fix sg_page breakage FUJITA Tomonori
@ 2007-11-19 13:46 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2007-11-19 13:46 UTC (permalink / raw)
  To: FUJITA Tomonori; +Cc: linux-kernel, fujita.tomonori

On Sat, Nov 17 2007, FUJITA Tomonori wrote:
> arch/alpha/kernel/pci-noop.c:167: warning: 'virt_to_bus' is deprecated (declared at include2/asm/io.h:117)
> arch/alpha/kernel/pci-noop.c: In function 'dma_map_sg':
> arch/alpha/kernel/pci-noop.c:183: error: 'struct scatterlist' has no member named 'page'
> arch/alpha/kernel/pci-noop.c:184: error: 'struct scatterlist' has no member named 'page'
> arch/alpha/kernel/pci-noop.c:185: warning: 'virt_to_bus' is deprecated (declared at include2/asm/io.h:11)

I'd greatly prefer this being split in two, it's really two different
changes.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-11-19 13:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-17  7:52 alpha: fix sg_page breakage FUJITA Tomonori
2007-11-19 13:46 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox