[RFC PATCH v2 08/10] dma: contiguous: Export is_from_cma helper for kunit
Samiullah Khawaja <[email protected]>
| Newsgroups | org.infradead.lists.kexec,dev.linux.lists.iommu,org.kernel.vger.linux-kernel,org.kvack.linux-mm |
|---|---|
| Message-ID | <[email protected]> |
The is_from_cm() can be used to check if a memory allocation is done from CMA. Export the helper when kunit is enabled so it can be used by the kunit tests. Signed-off-by: Samiullah Khawaja <[email protected]> --- kernel/dma/contiguous.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel/dma/contiguous.c b/kernel/dma/contiguous.c index 0b1702bf39ca..6d0cf9c7528c 100644 --- a/kernel/dma/contiguous.c +++ b/kernel/dma/contiguous.c @@ -37,6 +37,8 @@ #define pr_fmt(fmt) "cma: " fmt +#include <kunit/visibility.h> + #include <asm/page.h> #include <linux/memblock.h> @@ -153,6 +155,7 @@ bool dma_is_from_cma(phys_addr_t phys, size_t size) return cma_for_each_area(dma_cma_check_area, &chk) != 0; } +EXPORT_SYMBOL_IF_KUNIT(dma_is_from_cma); #ifdef CONFIG_DMA_NUMA_CMA -- 2.55.0.795.g602f6c329a-goog