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 --- 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 + #include #include @@ -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