From: Shixiong Ou <oushixi...@kylinos.cn>

The call to dma_resv_assert_held(shmem->base.resv) is duplicated
in the vmap() and vunamp() function.

Remove the duplicate call to clean up the code.

Signed-off-by: Shixiong Ou <oushixi...@kylinos.cn>
---
 drivers/gpu/drm/drm_gem_shmem_helper.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/gpu/drm/drm_gem_shmem_helper.c 
b/drivers/gpu/drm/drm_gem_shmem_helper.c
index 8ac0b1fa5287..10e20209f3b2 100644
--- a/drivers/gpu/drm/drm_gem_shmem_helper.c
+++ b/drivers/gpu/drm/drm_gem_shmem_helper.c
@@ -355,8 +355,6 @@ int drm_gem_shmem_vmap_locked(struct drm_gem_shmem_object 
*shmem,
        } else {
                pgprot_t prot = PAGE_KERNEL;
 
-               dma_resv_assert_held(shmem->base.resv);
-
                if (refcount_inc_not_zero(&shmem->vmap_use_count)) {
                        iosys_map_set_vaddr(map, shmem->vaddr);
                        return 0;
@@ -415,8 +413,6 @@ void drm_gem_shmem_vunmap_locked(struct 
drm_gem_shmem_object *shmem,
        if (drm_gem_is_imported(obj)) {
                dma_buf_vunmap(obj->dma_buf, map);
        } else {
-               dma_resv_assert_held(shmem->base.resv);
-
                if (refcount_dec_and_test(&shmem->vmap_use_count)) {
                        vunmap(shmem->vaddr);
                        shmem->vaddr = NULL;
-- 
2.25.1

Reply via email to