From 5d150355d1be27e947ea6abb0ec3d2b9c82711e3 Mon Sep 17 00:00:00 2001 From: Cho KyongHo Date: Wed, 7 Feb 2018 01:17:40 +0900 Subject: [PATCH] android: ion-test: change vmap() to map_vm_ram() map_vm_ram() is faster than vmap() and is safe for short lived mappings. Change-Id: Iec262ade2ebf232b7cd4719e1ddf21f23c5474ae Signed-off-by: Cho KyongHo --- drivers/staging/android/ion/ion_test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/android/ion/ion_test.c b/drivers/staging/android/ion/ion_test.c index 655166ae361c..8e8485c81eee 100644 --- a/drivers/staging/android/ion/ion_test.c +++ b/drivers/staging/android/ion/ion_test.c @@ -66,7 +66,7 @@ static int ion_handle_test_dma(struct device *dev, struct dma_buf *dma_buf, for_each_sg_page(table->sgl, &sg_iter, table->nents, offset_page) { struct page *page = sg_page_iter_page(&sg_iter); - void *vaddr = vmap(&page, 1, VM_MAP, pgprot); + void *vaddr = vm_map_ram(&page, 1, -1, pgprot); size_t to_copy = PAGE_SIZE - offset; to_copy = min(to_copy, size); @@ -80,7 +80,7 @@ static int ion_handle_test_dma(struct device *dev, struct dma_buf *dma_buf, else ret = copy_to_user(ptr, vaddr + offset, to_copy); - vunmap(vaddr); + vm_unmap_ram(vaddr, 1); if (ret) { ret = -EFAULT; goto err; -- 2.20.1