Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dma-buf/heaps: replace kmap_atomic with kmap_local_page

Use of kmap_atomic/kunmap_atomic is deprecated, use
kmap_local_page/kunmap_local instead.

This is reported by checkpatch.
Also fix repeated word issue.

WARNING: Deprecated use of 'kmap_atomic', prefer 'kmap_local_page' instead
+ void *vaddr = kmap_atomic(page);

WARNING: Deprecated use of 'kunmap_atomic', prefer 'kunmap_local' instead
+ kunmap_atomic(vaddr);

WARNING: Possible repeated word: 'by'
+ * has been killed by by SIGKILL

total: 0 errors, 3 warnings, 405 lines checked

Signed-off-by: Pintu Kumar <quic_pintu@quicinc.com>
Reviewed-by: T.J. Mercier <tjmercier@google.com>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20241001175057.27172-1-quic_pintu@quicinc.com

authored by

Pintu Kumar and committed by
Sumit Semwal
4a1cb63b 16c51e42

+3 -3
+3 -3
drivers/dma-buf/heaps/cma_heap.c
··· 309 309 struct page *page = cma_pages; 310 310 311 311 while (nr_clear_pages > 0) { 312 - void *vaddr = kmap_atomic(page); 312 + void *vaddr = kmap_local_page(page); 313 313 314 314 memset(vaddr, 0, PAGE_SIZE); 315 - kunmap_atomic(vaddr); 315 + kunmap_local(vaddr); 316 316 /* 317 317 * Avoid wasting time zeroing memory if the process 318 - * has been killed by by SIGKILL 318 + * has been killed by SIGKILL. 319 319 */ 320 320 if (fatal_signal_pending(current)) 321 321 goto free_cma;