Skip to contentSkip to conversation

uml: fix compile error in dma_get_cache_alignment()

PATCH In review Miklos Szeredi 2 participants 2 messages Aug 12, 2010 – Aug 13, 2010 User-mode Linux (UML)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 uml: fix compile error in dma_get_cache_alignment()

From: Miklos Szeredi <[email protected]>

Fix uml compile error:

include/linux/dma-mapping.h:145: error: redefinition of 'dma_get_cache_alignment' /store/git/linux-2.6/arch/um/include/asm/dma-mapping.h:99: note: previous definition of 'dma_get_cache_alignment' was here

Introduced by this commit:

commit 4565f0170dfc849b3629c27d769db800467baa62

Author: FUJITA Tomonori <[email protected]>
Date:   Tue Aug 10 18:03:22 2010 -0700

dma-mapping: unify dma_get_cache_alignment implementations

---
 arch/um/include/asm/dma-mapping.h |    7 -------
 1 file changed, 7 deletions(-)
arch/um/include/asm/dma-mapping.h +0 -7
Index: linux-2.6/arch/um/include/asm/dma-mapping.h
===================================================================
@@ -95,13 +95,6 @@ dma_sync_sg_for_cpu(struct device *dev,
 #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
 #define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
 
-static inline int
-dma_get_cache_alignment(void)
-{
-	BUG();
-	return(0);
-}
-
 static inline void
 dma_cache_sync(struct device *dev, void *vaddr, size_t size,
 	       enum dma_data_direction direction)
#1 lore raw
Quoted 7 lines · On Thu, 12 Aug 2010 11:04:35 +0200 Miklos Szeredi <[email protected]> wrote:

From: Miklos Szeredi <[email protected]>

Fix uml compile error:

include/linux/dma-mapping.h:145: error: redefinition of 'dma_get_cache_alignment' /store/git/linux-2.6/arch/um/include/asm/dma-mapping.h:99: note: previous definition of 'dma_get_cache_alignment' was here

Quoted 7 lines

Introduced by this commit:

commit 4565f0170dfc849b3629c27d769db800467baa62

Author: FUJITA Tomonori <[email protected]>
Date:   Tue Aug 10 18:03:22 2010 -0700

dma-mapping: unify dma_get_cache_alignment implementations

Very sorry about that.

Quoted 10 lines
---
 arch/um/include/asm/dma-mapping.h |    7 -------
 1 file changed, 7 deletions(-)

Index: linux-2.6/arch/um/include/asm/dma-mapping.h
===================================================================

arch/um/include/asm/dma-mapping.h dma_sync_sg_for_cpu(struct device *dev, · line 104

Quoted 10 lines
arch/um/include/asm/dma-mapping.h +0 -7
@@ -95,13 +95,6 @@ dma_sync_sg_for_cpu(struct device *dev,
 #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
 #define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
 
-static inline int
-dma_get_cache_alignment(void)
-{
-	BUG();
-	return(0);
-}
-

this isn't strictly correct for uml, right? dma_get_cache_alignment() should fail on uml, I suppose.

Can we treat uml like other !HAS_DMA architectures? That is, why does uml need the own DMA API that just calls BUG()?

arch/um/Kconfig.um +3 -0
index ec2b8da..3de40b8 100644
@@ -147,3 +147,6 @@ config KERNEL_STACK_ORDER
 	  This option determines the size of UML kernel stacks.  They will
 	  be 1 << order pages.  The default is OK unless you're running Valgrind
 	  on UML, in which case, set this to 3.
+
+config HAS_DMA
+       def_bool n
arch/um/defconfig +0 -1
index 6bd456f..564f3de 100644
@@ -566,7 +566,6 @@ CONFIG_CRC32=m
 # CONFIG_CRC7 is not set
 # CONFIG_LIBCRC32C is not set
 CONFIG_PLIST=y
-CONFIG_HAS_DMA=y
 
 #
 # SCSI device support
arch/um/include/asm/dma-mapping.h deleted +0 -119

119 lines not on this page · raw message