summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2025-11-30 11:54:48 +0100
committerLinus Walleij <linusw@kernel.org>2026-01-08 08:52:29 +0100
commitd42d701e132905d69be3a7808f2ec86bdb4c48d8 (patch)
treeb33d3fa27701d5b9450893ad12fa9b5f82c30703
parent6a0b99e9fb45f403c3097a9047963d2dd5b0fab2 (diff)
dma-buf: heaps: Clear CMA pages with clear_page()
clear_page() translates into memset(*p, 0, PAGE_SIZE) on some architectures, but on the major architectures it will call an optimized assembly snippet so use this instead of open coding a memset(). Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Nirmoy Das <nirmoyd@nvidia.com> Reviewed-by: T.J. Mercier <tjmercier@google.com> Signed-off-by: Linus Walleij <linusw@kernel.org> Link: https://patch.msgid.link/20251130-dma-buf-heap-clear-page-v1-1-a8dcea2a88ee@linaro.org
-rw-r--r--drivers/dma-buf/heaps/cma_heap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/dma-buf/heaps/cma_heap.c b/drivers/dma-buf/heaps/cma_heap.c
index 42f88193eab9..49cc45fb42dd 100644
--- a/drivers/dma-buf/heaps/cma_heap.c
+++ b/drivers/dma-buf/heaps/cma_heap.c
@@ -331,7 +331,7 @@ static struct dma_buf *cma_heap_allocate(struct dma_heap *heap,
while (nr_clear_pages > 0) {
void *vaddr = kmap_local_page(page);
- memset(vaddr, 0, PAGE_SIZE);
+ clear_page(vaddr);
kunmap_local(vaddr);
/*
* Avoid wasting time zeroing memory if the process