From: Linus Walleij Date: Tue, 10 Mar 2026 08:53:12 +0000 (+0100) Subject: dma-buf: heaps: Clear CMA highages using helper X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=252b0e790d22dfef8c4d0c39a5bfc04e40b615ad;p=thirdparty%2Fkernel%2Flinux.git dma-buf: heaps: Clear CMA highages using helper Currently the CMA allocator clears highmem pages using kmap()->clear_page()->kunmap(), but there is a helper static inline in that does the same for us so use clear_highpage() instead of open coding this. Suggested-by: T.J. Mercier Reviewed-by: T.J. Mercier Reviewed-by: Christian König Reviewed-by: Maxime Ripard Signed-off-by: Linus Walleij Link: https://patch.msgid.link/20260310-cma-heap-clear-pages-v2-2-ecbbed3d7e6d@kernel.org --- diff --git a/drivers/dma-buf/heaps/cma_heap.c b/drivers/dma-buf/heaps/cma_heap.c index f0bacf25ed9dd..92865786cfc99 100644 --- a/drivers/dma-buf/heaps/cma_heap.c +++ b/drivers/dma-buf/heaps/cma_heap.c @@ -329,10 +329,7 @@ static struct dma_buf *cma_heap_allocate(struct dma_heap *heap, struct page *page = cma_pages; while (nr_clear_pages > 0) { - void *vaddr = kmap_local_page(page); - - clear_page(vaddr); - kunmap_local(vaddr); + clear_highpage(page); /* * Avoid wasting time zeroing memory if the process * has been killed by SIGKILL.