Skip to contentSkip to conversation

mips: fail if DMA coherency is unspecified

PATCH New Paul Gortmaker 1 participant 1 message Jan 11, 2008 MIPS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mips: fail if DMA coherency is unspecified

Currently, if the DMA coherency is unspecified, you simply get a warning about no return in a function returning int, which can be easily overlooked. This makes sure that if the platform hasn't specified it, that it will get the required visibility.

---
 include/asm-mips/mach-generic/dma-coherence.h |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
include/asm-mips/mach-generic/dma-coherence.h +5 -3
index 76e04e7..02492a6 100644
@@ -34,11 +34,13 @@ static inline void plat_unmap_dma_mem(dma_addr_t dma_addr)
 
 static inline int plat_device_is_coherent(struct device *dev)
 {
-#ifdef CONFIG_DMA_COHERENT
+#if defined(CONFIG_DMA_COHERENT)
 	return 1;
-#endif
-#ifdef CONFIG_DMA_NONCOHERENT
+#elif defined(CONFIG_DMA_NONCOHERENT)
 	return 0;
+#else
+#error DMA coherency of platform is not defined.
+	return 0xbad;
 #endif
 }
 
Signature · 1 line
1.5.0.rc1.gf4b6c