Skip to contentSkip to conversation

dma-mapping: mark dma_alloc_need_uncached as __always_inline

PATCH In review Christoph Hellwig 2 participants 2 messages Jul 8, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dma-mapping: mark dma_alloc_need_uncached as __always_inline

Without the __always_inline at least i386 configs that have CONFIG_OPTIMIZE_INLINING set seem fail to inline dma_alloc_need_uncached, leading to a linker error because of undefined symbols.

---
 include/linux/dma-noncoherent.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/dma-noncoherent.h +1 -1
index 53ee36ecdf37..3813211a9aad 100644
@@ -23,7 +23,7 @@ static inline bool dev_is_dma_coherent(struct device *dev)
 /*
  * Check if an allocation needs to be marked uncached to be coherent.
  */
-static inline bool dma_alloc_need_uncached(struct device *dev,
+static __always_inline bool dma_alloc_need_uncached(struct device *dev,
 		unsigned long attrs)
 {
 	if (dev_is_dma_coherent(dev))
Signature · 1 line
2.20.1
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Christoph Hellwig

Without the __always_inline at least i386 configs that have CONFIG_OPTIMIZE_INLINING set seem fail to inline dma_alloc_need_uncached, leading to a linker error because of undefined symbols.

Thanks.

Quoted 18 lines
---
 include/linux/dma-noncoherent.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/dma-noncoherent.h +1 -1
index 53ee36ecdf37..3813211a9aad 100644
@@ -23,7 +23,7 @@ static inline bool dev_is_dma_coherent(struct device *dev)
 /*
  * Check if an allocation needs to be marked uncached to be coherent.
  */
-static inline bool dma_alloc_need_uncached(struct device *dev,
+static __always_inline bool dma_alloc_need_uncached(struct device *dev,
 		unsigned long attrs)
 {
 	if (dev_is_dma_coherent(dev))
Signature · 1 line
~Randy