mirror of
https://github.com/torvalds/linux.git
synced 2026-06-05 04:56:13 +02:00
media: staging: media: atomisp: Convert kmap() to kmap_local_page()
The use of kmap() is being deprecated in favor of kmap_local_page() where it is feasible. With kmap_local_page(), the mapping is per thread, CPU local and not globally visible. load_and_flush_by_kmap() is a function where the use of kmap_local_page() in place of kmap() is correctly suited. Convert load_and_flush_by_kmap() from kmap() to kmap_local_page(). Link: https://lore.kernel.org/linux-media/20220408223129.3844-1-fmdefrancesco@gmail.com Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com> Tested-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
This commit is contained in:
parent
5088bbde3a
commit
2ad935a15f
|
|
@ -295,7 +295,7 @@ static int load_and_flush_by_kmap(ia_css_ptr virt, void *data,
|
|||
idx = (virt - bo->start) >> PAGE_SHIFT;
|
||||
offset = (virt - bo->start) - (idx << PAGE_SHIFT);
|
||||
|
||||
src = (char *)kmap(bo->pages[idx]) + offset;
|
||||
src = (char *)kmap_local_page(bo->pages[idx]) + offset;
|
||||
|
||||
if ((bytes + offset) >= PAGE_SIZE) {
|
||||
len = PAGE_SIZE - offset;
|
||||
|
|
@ -314,7 +314,7 @@ static int load_and_flush_by_kmap(ia_css_ptr virt, void *data,
|
|||
|
||||
clflush_cache_range(src, len);
|
||||
|
||||
kunmap(bo->pages[idx]);
|
||||
kunmap_local(src);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user