Skip to contentSkip to conversation

drm/amdkfd: remove logically dead code

PATCH In review Jesse Zhang 2 participants 2 messages Jun 3, 2024 – Jun 4, 2024

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 11/12 drm/amdkfd: remove logically dead code

idr_for_each_entry can ensure that mem is not empty during the loop. So don't need check mem again.

---
 drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 5 -----
 1 file changed, 5 deletions(-)
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c +0 -5
index fdf171ad4a3c..32e5db509560 100644
@@ -1913,11 +1913,6 @@ static int criu_checkpoint_bos(struct kfd_process *p,
 			struct kfd_criu_bo_priv_data *bo_priv;
 			int i, dev_idx = 0;
 
-			if (!mem) {
-				ret = -ENOMEM;
-				goto exit;
-			}
-
 			kgd_mem = (struct kgd_mem *)mem;
 			dumper_bo = kgd_mem->bo;
 
Signature · 1 line
2.25.1
maintainer Reviewed-by on v1 11/12
#1 lore raw
Quoted 4 lines · Jesse Zhang

idr_for_each_entry can ensure that mem is not empty during the loop. So don't need check mem again.

Quoted 20 lines
---
  drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 5 -----
  1 file changed, 5 deletions(-)
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c +0 -5
index fdf171ad4a3c..32e5db509560 100644
@@ -1913,11 +1913,6 @@ static int criu_checkpoint_bos(struct kfd_process *p,
  			struct kfd_criu_bo_priv_data *bo_priv;
  			int i, dev_idx = 0;
 
-			if (!mem) {
-				ret = -ENOMEM;
-				goto exit;
-			}
-
  			kgd_mem = (struct kgd_mem *)mem;
  			dumper_bo = kgd_mem->bo;