dma-mapping: move dma_mark_clean to dma-direct.h
authorChristoph Hellwig <hch@lst.de>
Tue, 9 Jan 2018 21:11:31 +0000 (22:11 +0100)
committerChristoph Hellwig <hch@lst.de>
Wed, 10 Jan 2018 15:41:12 +0000 (16:41 +0100)
And unlike the other helpers we don't require a <asm/dma-direct.h> as
this helper is a special case for ia64 only, and this keeps it as
simple as possible.

Signed-off-by: Christoph Hellwig <hch@lst.de>
arch/arm/include/asm/dma-mapping.h
arch/arm64/include/asm/dma-mapping.h
arch/ia64/Kconfig
arch/ia64/include/asm/dma.h
arch/mips/include/asm/dma-mapping.h
arch/powerpc/include/asm/swiotlb.h
arch/tile/include/asm/dma-mapping.h
arch/unicore32/include/asm/dma-mapping.h
arch/x86/include/asm/swiotlb.h
include/linux/dma-direct.h

index 5fb1b7fbdfbe6509db853f6a93f1dc94912310d2..e5d9020c9ee18db7d07d5cc0c57f4e10c959d764 100644 (file)
@@ -109,8 +109,6 @@ static inline bool is_device_dma_coherent(struct device *dev)
        return dev->archdata.dma_coherent;
 }
 
-static inline void dma_mark_clean(void *addr, size_t size) { }
-
 /**
  * arm_dma_alloc - allocate consistent memory for DMA
  * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices
index 400fa67d3b5a75326e7c40db34b26b6dff7b3641..b7847eb8a7bb76d8602d7a328b478220e7e66120 100644 (file)
@@ -50,9 +50,5 @@ static inline bool is_device_dma_coherent(struct device *dev)
        return dev->archdata.dma_coherent;
 }
 
-static inline void dma_mark_clean(void *addr, size_t size)
-{
-}
-
 #endif /* __KERNEL__ */
 #endif /* __ASM_DMA_MAPPING_H */
index 49583c5a5d446afa2fec5b0ef220229848c53a01..4d18fca885ee701671d8bf1f1cda4e153c62a5b2 100644 (file)
@@ -33,6 +33,7 @@ config IA64
        select HAVE_MEMBLOCK
        select HAVE_MEMBLOCK_NODE_MAP
        select HAVE_VIRT_CPU_ACCOUNTING
+       select ARCH_HAS_DMA_MARK_CLEAN
        select ARCH_HAS_SG_CHAIN
        select VIRT_TO_BUS
        select ARCH_DISCARD_MEMBLOCK
index 186850eec934453c36798acdbf6a530047558fe1..23604d6a2cb2430e76dfbb6d501505fcd4f3afa3 100644 (file)
@@ -20,6 +20,4 @@ extern unsigned long MAX_DMA_ADDRESS;
 
 #define free_dma(x)
 
-void dma_mark_clean(void *addr, size_t size);
-
 #endif /* _ASM_IA64_DMA_H */
index 676c14cfc580ee3e57624dc642f35678501e2422..886e75a383f27c35d2bc85e9a42ad03106d1d3f8 100644 (file)
@@ -17,8 +17,6 @@ static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus)
        return mips_dma_map_ops;
 }
 
-static inline void dma_mark_clean(void *addr, size_t size) {}
-
 #define arch_setup_dma_ops arch_setup_dma_ops
 static inline void arch_setup_dma_ops(struct device *dev, u64 dma_base,
                                      u64 size, const struct iommu_ops *iommu,
index 01d45a5fd00b3dcfe7404f2bdbb32ba33bab86bc..9341ee804d19846a7c2cca3d9c83debe97565b27 100644 (file)
@@ -15,8 +15,6 @@
 
 extern const struct dma_map_ops swiotlb_dma_ops;
 
-static inline void dma_mark_clean(void *addr, size_t size) {}
-
 extern unsigned int ppc_swiotlb_enable;
 int __init swiotlb_setup_bus_notifier(void);
 
index 75b8aaa4e70bd64945dacf57ae28c3d1397b735d..d25fce101fc051c13aa65b9569fcd4f97806c7ac 100644 (file)
@@ -44,8 +44,6 @@ static inline void set_dma_offset(struct device *dev, dma_addr_t off)
        dev->archdata.dma_offset = off;
 }
 
-static inline void dma_mark_clean(void *addr, size_t size) {}
-
 #define HAVE_ARCH_DMA_SET_MASK 1
 int dma_set_mask(struct device *dev, u64 mask);
 
index 5cb250bf2d8cc3267e3b93bae30faea2f4fe35d0..f2bfec273aa7fe4d7458da918ee812bb27a91371 100644 (file)
@@ -25,7 +25,5 @@ static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus)
        return &swiotlb_dma_map_ops;
 }
 
-static inline void dma_mark_clean(void *addr, size_t size) {}
-
 #endif /* __KERNEL__ */
 #endif
index bdf9aed404030aab956bec27b29e2f4b9dd7c307..1c6a6cb230ffa1113d6aac27c52577cacdfb4a96 100644 (file)
@@ -28,8 +28,6 @@ static inline void pci_swiotlb_late_init(void)
 }
 #endif
 
-static inline void dma_mark_clean(void *addr, size_t size) {}
-
 extern void *x86_swiotlb_alloc_coherent(struct device *hwdev, size_t size,
                                        dma_addr_t *dma_handle, gfp_t flags,
                                        unsigned long attrs);
index 2cc1b6558944587c43f3cdd9aec1af3a57b8e797..10e924b7cba7ae2bde8fdfa5b618703e789c23a3 100644 (file)
@@ -29,4 +29,13 @@ static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size)
        return addr + size - 1 <= *dev->dma_mask;
 }
 #endif /* !CONFIG_ARCH_HAS_PHYS_TO_DMA */
+
+#ifdef CONFIG_ARCH_HAS_DMA_MARK_CLEAN
+void dma_mark_clean(void *addr, size_t size);
+#else
+static inline void dma_mark_clean(void *addr, size_t size)
+{
+}
+#endif /* CONFIG_ARCH_HAS_DMA_MARK_CLEAN */
+
 #endif /* _LINUX_DMA_DIRECT_H */