Skip to contentSkip to conversation

drm/amdkfd: Remove unnecessary condition in kfd_topology_add_device()

PATCH In review Dan Carpenter 2 participants 2 messages Nov 25, 2022

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

PATCH 1/1 drm/amdkfd: Remove unnecessary condition in kfd_topology_add_device()

We re-arranged this code recently so "ret" is always zero at this point.

---
 drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdkfd/kfd_topology.c +2 -3
index 6f01ebc8557b..bceb1a5b2518 100644
@@ -2012,10 +2012,9 @@ int kfd_topology_add_device(struct kfd_dev *gpu)
 
 	kfd_debug_print_topology();
 
-	if (!res)
-		kfd_notify_gpu_change(gpu_id, 1);
+	kfd_notify_gpu_change(gpu_id, 1);
 
-	return res;
+	return 0;
 }
 
 /**
Signature · 1 line
2.35.1
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 3 lines · Dan Carpenter

We re-arranged this code recently so "ret" is always zero at this point.

I'm applying your patch to amd-staging-drm-next. Thank you!

Felix

Quoted 21 lines
---
  drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 5 ++---
  1 file changed, 2 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdkfd/kfd_topology.c +2 -3
index 6f01ebc8557b..bceb1a5b2518 100644
@@ -2012,10 +2012,9 @@ int kfd_topology_add_device(struct kfd_dev *gpu)
 
  	kfd_debug_print_topology();
 
-	if (!res)
-		kfd_notify_gpu_change(gpu_id, 1);
+	kfd_notify_gpu_change(gpu_id, 1);
 
-	return res;
+	return 0;
  }
 
  /**