path: root/arch/x86
diff options
authorAhmad Fatoum <>2022-06-14 11:15:55 +0200
committerSascha Hauer <>2022-06-17 08:25:43 +0200
commitc50731ebca48c6216b183bd1e0272dd75033ba41 (patch)
treea7378917dab0fa9a25c3f3632b569b640348de46 /arch/x86
parent339737fcf0a7c4be1d1984283619cb14aaee6aff (diff)
dma: avoid clash between static inline and extern dma_alloc declarations
dma_alloc/dma_sync/dma_free can be either either static inline definitions usually supplied per arch or extern definitions that can be either generic or supplied per arch. To avoid clashes, expect static inline definitions to define a preprocessor symbol for now. There is much duplication in the static inline helpers, which we can remove in future. Signed-off-by: Ahmad Fatoum <> Link: Signed-off-by: Sascha Hauer <>
Diffstat (limited to 'arch/x86')
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/x86/include/asm/dma.h b/arch/x86/include/asm/dma.h
index 8a3b044f3a..90791ecf3e 100644
--- a/arch/x86/include/asm/dma.h
+++ b/arch/x86/include/asm/dma.h
@@ -13,6 +13,7 @@
* x86 is cache coherent, so we need not do anything special here
+#define dma_alloc_coherent dma_alloc_coherent
static inline void *dma_alloc_coherent(size_t size, dma_addr_t *dma_handle)
void *ret = xmemalign(4096, size);
@@ -24,17 +25,20 @@ static inline void *dma_alloc_coherent(size_t size, dma_addr_t *dma_handle)
return ret;
+#define dma_free_coherent dma_free_coherent
static inline void dma_free_coherent(void *mem, dma_addr_t dma_handle,
size_t size)
+#define dma_sync_single_for_cpu dma_sync_single_for_cpu
static inline void dma_sync_single_for_cpu(dma_addr_t address, size_t size,
enum dma_data_direction dir)
+#define dma_sync_single_for_device dma_sync_single_for_device
static inline void dma_sync_single_for_device(dma_addr_t address, size_t size,
enum dma_data_direction dir)