[PATCH] dma-mapping: fix build errors on !HAS_DMA architectures

From: Heiko Carstens
Date: Fri Aug 13 2010 - 03:37:44 EST


From: Heiko Carstens <heiko.carstens@xxxxxxxxxx>

commit 4565f0170dfc849b3629c27d769db800467baa62 "dma-mapping: unify
dma_get_cache_alignment implementations" causes build errors on
!HAS_DMA architectures/platforms like s390 and sun3:

include/linux/dma-mapping.h:145: error: static declaration of 'dma_get_cache_alignment' follows non-static declaration
include/asm-generic/dma-mapping-broken.h:73: error: previous declaration of 'dma_get_cache_alignment' was here

Fix this by adding an explicit ifdef.

Cc: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>
Acked-by: FUJITA Tomonori <fujita.tomonori@xxxxxxxxxxxxx>
Signed-off-by: Heiko Carstens <heiko.carstens@xxxxxxxxxx>
---
include/linux/dma-mapping.h | 2 ++
1 file changed, 2 insertions(+)

--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -142,6 +142,7 @@ static inline int dma_set_seg_boundary(s
return -EIO;
}

+#ifdef CONFIG_HAS_DMA
static inline int dma_get_cache_alignment(void)
{
#ifdef ARCH_DMA_MINALIGN
@@ -149,6 +150,7 @@ static inline int dma_get_cache_alignmen
#endif
return 1;
}
+#endif

/* flags for the coherent memory api */
#define DMA_MEMORY_MAP 0x01
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/