From 4d2b26fbcf74bf9df50b5c8cf13bd99e6eeca353 Mon Sep 17 00:00:00 2001 From: Puranam V G Tejaswi Date: Mon, 12 Aug 2019 16:08:22 +0530 Subject: [PATCH] msm: kgsl: remove redundant check for usermem type The check for usermem type, while updating the stat for memory mapped to userspace is not required. Memory with usermem type KGSL_MEM_ENTRY_ION is not mapped to user by kgsl and the mapsize would always be zero. So remove the unnecessary check for usermem type. Change-Id: Iaa0b86d1c7160657de1d802f2cc10c3bdbdf84b3 Signed-off-by: Puranam V G Tejaswi --- drivers/gpu/msm/kgsl.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/gpu/msm/kgsl.c b/drivers/gpu/msm/kgsl.c index e9edbc1dc2f7..f04150c6758b 100644 --- a/drivers/gpu/msm/kgsl.c +++ b/drivers/gpu/msm/kgsl.c @@ -494,8 +494,6 @@ static int kgsl_mem_entry_attach_process(struct kgsl_device *device, /* Detach a memory entry from a process and unmap it from the MMU */ static void kgsl_mem_entry_detach_process(struct kgsl_mem_entry *entry) { - unsigned int type; - if (entry == NULL) return; @@ -508,10 +506,7 @@ static void kgsl_mem_entry_detach_process(struct kgsl_mem_entry *entry) idr_remove(&entry->priv->mem_idr, entry->id); entry->id = 0; - type = kgsl_memdesc_usermem_type(&entry->memdesc); - - if (type != KGSL_MEM_ENTRY_ION) - entry->priv->gpumem_mapped -= entry->memdesc.mapsize; + entry->priv->gpumem_mapped -= entry->memdesc.mapsize; spin_unlock(&entry->priv->mem_lock);