LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH rebased] Use the new sg_page() helper
@ 2007-10-23 17:32 Emil Medve
  2007-10-23 22:32 ` Linus Torvalds
  0 siblings, 1 reply; 2+ messages in thread
From: Emil Medve @ 2007-10-23 17:32 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel, Emil Medve

Fix build error messages such as this:

In file included from include/linux/dma-mapping.h:52,
                 from include/linux/dmaengine.h:29,
                 from include/linux/skbuff.h:29,
                 from include/linux/netlink.h:155,
                 from include/linux/genetlink.h:4,
                 from include/net/genetlink.h:4,
                 from include/linux/taskstats_kern.h:12,
                 from init/main.c:46:
include/asm/dma-mapping.h: In function 'dma_map_sg':
include/asm/dma-mapping.h:288: error: 'struct scatterlist' has no member named 'page'
include/asm/dma-mapping.h:288: error: 'struct scatterlist' has no member named 'page'
include/asm/dma-mapping.h:288: error: 'struct scatterlist' has no member named 'page'
include/asm/dma-mapping.h:290: error: 'struct scatterlist' has no member named 'page'

This change in the struct scatterlist was introduced by this commit: 18dabf473e15850c0dbc8ff13ac1e2806d542c15

Signed-off-by: Emil Medve <Emilian.Medve@Freescale.com>
---

linux-2.6> scripts/checkpatch.pl 0001-Use-the-new-sg_page-helper.patch 
Your patch has no obvious style problems and is ready for submission.

 drivers/mmc/host/mmci.h          |    4 ++--
 include/asm-xtensa/dma-mapping.h |   10 +++++-----
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/mmc/host/mmci.h b/drivers/mmc/host/mmci.h
index 000e6a9..de3c223 100644
--- a/drivers/mmc/host/mmci.h
+++ b/drivers/mmc/host/mmci.h
@@ -112,7 +112,7 @@
  * The size of the FIFO in bytes.
  */
 #define MCI_FIFOSIZE	(16*4)
-	
+
 #define MCI_FIFOHALFSIZE (MCI_FIFOSIZE / 2)
 
 #define NR_SG		16
@@ -169,7 +169,7 @@ static inline char *mmci_kmap_atomic(struct mmci_host *host, unsigned long *flag
 	struct scatterlist *sg = host->sg_ptr;
 
 	local_irq_save(*flags);
-	return kmap_atomic(sg->page, KM_BIO_SRC_IRQ) + sg->offset;
+	return kmap_atomic(sg_page(sg), KM_BIO_SRC_IRQ) + sg->offset;
 }
 
 static inline void mmci_kunmap_atomic(struct mmci_host *host, void *buffer, unsigned long *flags)
diff --git a/include/asm-xtensa/dma-mapping.h b/include/asm-xtensa/dma-mapping.h
index 82b03b3..2b3e975 100644
--- a/include/asm-xtensa/dma-mapping.h
+++ b/include/asm-xtensa/dma-mapping.h
@@ -58,10 +58,10 @@ dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
 	BUG_ON(direction == DMA_NONE);
 
 	for (i = 0; i < nents; i++, sg++ ) {
-		BUG_ON(!sg->page);
+		BUG_ON(!sg_page(sg));
 
-		sg->dma_address = page_to_phys(sg->page) + sg->offset;
-		consistent_sync(page_address(sg->page) + sg->offset,
+		sg->dma_address = page_to_phys(sg_page(sg)) + sg->offset;
+		consistent_sync(page_address(sg_page(sg)) + sg->offset,
 				sg->length, direction);
 	}
 
@@ -128,7 +128,7 @@ dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nelems,
 {
 	int i;
 	for (i = 0; i < nelems; i++, sg++)
-		consistent_sync(page_address(sg->page) + sg->offset,
+		consistent_sync(page_address(sg_page(sg)) + sg->offset,
 				sg->length, dir);
 }
 
@@ -138,7 +138,7 @@ dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nelems,
 {
 	int i;
 	for (i = 0; i < nelems; i++, sg++)
-		consistent_sync(page_address(sg->page) + sg->offset,
+		consistent_sync(page_address(sg_page(sg)) + sg->offset,
 				sg->length, dir);
 }
 static inline int
-- 
1.5.3.GIT


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

* Re: [PATCH rebased] Use the new sg_page() helper
  2007-10-23 17:32 [PATCH rebased] Use the new sg_page() helper Emil Medve
@ 2007-10-23 22:32 ` Linus Torvalds
  0 siblings, 0 replies; 2+ messages in thread
From: Linus Torvalds @ 2007-10-23 22:32 UTC (permalink / raw)
  To: Emil Medve; +Cc: Linux Kernel Mailing List, Jens Axboe



On Tue, 23 Oct 2007, Emil Medve wrote:
>  
> -		sg->dma_address = page_to_phys(sg->page) + sg->offset;
> +		sg->dma_address = page_to_phys(sg_page(sg)) + sg->offset;

This is "sg_phys(sg)"

> -		consistent_sync(page_address(sg->page) + sg->offset,
> +		consistent_sync(page_address(sg_page(sg)) + sg->offset,
> -		consistent_sync(page_address(sg->page) + sg->offset,
> +		consistent_sync(page_address(sg_page(sg)) + sg->offset,
> -		consistent_sync(page_address(sg->page) + sg->offset,
> +		consistent_sync(page_address(sg_page(sg)) + sg->offset,

Please write "page_address(sg_page(sg)) + sg->offset" as "sg_virt(sg)" 
instead.

And send the patch to Jens, since he's the person who is in charge of 
getting this all sorted out ;)

Ok?

		Linus

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

end of thread, other threads:[~2007-10-23 22:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-10-23 17:32 [PATCH rebased] Use the new sg_page() helper Emil Medve
2007-10-23 22:32 ` Linus Torvalds

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).