Skip to content

Commit b49efd7

Browse files
author
Christoph Hellwig
committed
dma-mapping: move dma_mark_clean to dma-direct.h
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 <[email protected]>
1 parent ea8c64a commit b49efd7

File tree

10 files changed

+10
-18
lines changed

10 files changed

+10
-18
lines changed

arch/arm/include/asm/dma-mapping.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,6 @@ static inline bool is_device_dma_coherent(struct device *dev)
109109
return dev->archdata.dma_coherent;
110110
}
111111

112-
static inline void dma_mark_clean(void *addr, size_t size) { }
113-
114112
/**
115113
* arm_dma_alloc - allocate consistent memory for DMA
116114
* @dev: valid struct device pointer, or NULL for ISA and EISA-like devices

arch/arm64/include/asm/dma-mapping.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,5 @@ static inline bool is_device_dma_coherent(struct device *dev)
5050
return dev->archdata.dma_coherent;
5151
}
5252

53-
static inline void dma_mark_clean(void *addr, size_t size)
54-
{
55-
}
56-
5753
#endif /* __KERNEL__ */
5854
#endif /* __ASM_DMA_MAPPING_H */

arch/ia64/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ config IA64
3333
select HAVE_MEMBLOCK
3434
select HAVE_MEMBLOCK_NODE_MAP
3535
select HAVE_VIRT_CPU_ACCOUNTING
36+
select ARCH_HAS_DMA_MARK_CLEAN
3637
select ARCH_HAS_SG_CHAIN
3738
select VIRT_TO_BUS
3839
select ARCH_DISCARD_MEMBLOCK

arch/ia64/include/asm/dma.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,4 @@ extern unsigned long MAX_DMA_ADDRESS;
2020

2121
#define free_dma(x)
2222

23-
void dma_mark_clean(void *addr, size_t size);
24-
2523
#endif /* _ASM_IA64_DMA_H */

arch/mips/include/asm/dma-mapping.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus)
1717
return mips_dma_map_ops;
1818
}
1919

20-
static inline void dma_mark_clean(void *addr, size_t size) {}
21-
2220
#define arch_setup_dma_ops arch_setup_dma_ops
2321
static inline void arch_setup_dma_ops(struct device *dev, u64 dma_base,
2422
u64 size, const struct iommu_ops *iommu,

arch/powerpc/include/asm/swiotlb.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515

1616
extern const struct dma_map_ops swiotlb_dma_ops;
1717

18-
static inline void dma_mark_clean(void *addr, size_t size) {}
19-
2018
extern unsigned int ppc_swiotlb_enable;
2119
int __init swiotlb_setup_bus_notifier(void);
2220

arch/tile/include/asm/dma-mapping.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ static inline void set_dma_offset(struct device *dev, dma_addr_t off)
4444
dev->archdata.dma_offset = off;
4545
}
4646

47-
static inline void dma_mark_clean(void *addr, size_t size) {}
48-
4947
#define HAVE_ARCH_DMA_SET_MASK 1
5048
int dma_set_mask(struct device *dev, u64 mask);
5149

arch/unicore32/include/asm/dma-mapping.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,5 @@ static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus)
2525
return &swiotlb_dma_map_ops;
2626
}
2727

28-
static inline void dma_mark_clean(void *addr, size_t size) {}
29-
3028
#endif /* __KERNEL__ */
3129
#endif

arch/x86/include/asm/swiotlb.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ static inline void pci_swiotlb_late_init(void)
2828
}
2929
#endif
3030

31-
static inline void dma_mark_clean(void *addr, size_t size) {}
32-
3331
extern void *x86_swiotlb_alloc_coherent(struct device *hwdev, size_t size,
3432
dma_addr_t *dma_handle, gfp_t flags,
3533
unsigned long attrs);

include/linux/dma-direct.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,13 @@ static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size)
2929
return addr + size - 1 <= *dev->dma_mask;
3030
}
3131
#endif /* !CONFIG_ARCH_HAS_PHYS_TO_DMA */
32+
33+
#ifdef CONFIG_ARCH_HAS_DMA_MARK_CLEAN
34+
void dma_mark_clean(void *addr, size_t size);
35+
#else
36+
static inline void dma_mark_clean(void *addr, size_t size)
37+
{
38+
}
39+
#endif /* CONFIG_ARCH_HAS_DMA_MARK_CLEAN */
40+
3241
#endif /* _LINUX_DMA_DIRECT_H */

0 commit comments

Comments
 (0)