Skip to contentSkip to conversation

drm/amdkfd: Identical code for different branches

PATCH In review Sunday Clement 3 participants 3 messages May 23, 2025 – May 26, 2025

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

PATCH 1/1 drm/amdkfd: Identical code for different branches

This patch removes the if/else statement in the cik_event_interrupt_wq function because it is redundant with both branches resulting in identical outcomes, this improves code readibility.

BUG:SWDEV-534537

---
 drivers/gpu/drm/amd/amdkfd/cik_event_interrupt.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/gpu/drm/amd/amdkfd/cik_event_interrupt.c +1 -5
index 981d9adcc5e1..25f32771b228 100644
@@ -125,11 +125,7 @@ static void cik_event_interrupt_wq(struct kfd_node *dev,
 			return;
 		}
 
-		if (info.vmid == vmid)
-			kfd_signal_vm_fault_event(pdd, &info, NULL);
-		else
-			kfd_signal_vm_fault_event(pdd, &info, NULL);
-
+		kfd_signal_vm_fault_event(pdd, &info, NULL);
 		kfd_unref_process(p);
 	}
 }
Signature · 1 line
2.43.0
Reviewed-by Harish Kasiviswanathan on v1 1/1
#1 lore raw

[Public]

You can remove BUG:SWDEV-534537 from commit message as it doesn't provide any information to public. With that this patch is

-----Original Message-----
From: Clement, Sunday <[email protected]>
Sent: Friday, May 23, 2025 7:54 PM
To: [email protected]
Cc: Tudor, Alexandru <[email protected]>; Kasiviswanathan, Harish <[email protected]>; Clement, Sunday <[email protected]>
Subject: [PATCH] drm/amdkfd: Identical code for different branches

This patch removes the if/else statement in the cik_event_interrupt_wq function because it is redundant with both branches resulting in identical outcomes, this improves code readibility.

BUG:SWDEV-534537

---
 drivers/gpu/drm/amd/amdkfd/cik_event_interrupt.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/gpu/drm/amd/amdkfd/cik_event_interrupt.c +1 -5
index 981d9adcc5e1..25f32771b228 100644
@@ -125,11 +125,7 @@ static void cik_event_interrupt_wq(struct kfd_node *dev,
                        return;
                }
 
-               if (info.vmid == vmid)
-                       kfd_signal_vm_fault_event(pdd, &info, NULL);
-               else
-                       kfd_signal_vm_fault_event(pdd, &info, NULL);
-
+               kfd_signal_vm_fault_event(pdd, &info, NULL);
                kfd_unref_process(p);
        }
 }

--
2.43.0

Reviewed-by Reviewed-by Harish Kasiviswanathan
#2 lore raw

[Public]

[Public]

With the change suggested by Harish below this patch looks good to me too.

________________________________
From: Kasiviswanathan, Harish <[email protected]>
Sent: Monday, May 26, 2025 1:48 PM
To: Clement, Sunday <[email protected]>; [email protected] <[email protected]>
Cc: Tudor, Alexandru <[email protected]>
Subject: RE: [PATCH] drm/amdkfd: Identical code for different branches

[Public]

You can remove BUG:SWDEV-534537 from commit message as it doesn’t provide any information to public. With that this patch is

-----Original Message-----
From: Clement, Sunday <[email protected]>
Sent: Friday, May 23, 2025 7:54 PM
To: [email protected]
Cc: Tudor, Alexandru <[email protected]>; Kasiviswanathan, Harish <[email protected]>; Clement, Sunday <[email protected]>
Subject: [PATCH] drm/amdkfd: Identical code for different branches

This patch removes the if/else statement in the cik_event_interrupt_wq function because it is redundant with both branches resulting in identical outcomes, this improves code readibility.

BUG:SWDEV-534537

---
 drivers/gpu/drm/amd/amdkfd/cik_event_interrupt.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/gpu/drm/amd/amdkfd/cik_event_interrupt.c +1 -5
index 981d9adcc5e1..25f32771b228 100644
@@ -125,11 +125,7 @@ static void cik_event_interrupt_wq(struct kfd_node *dev,
                        return;
                }
 
-               if (info.vmid == vmid)
-                       kfd_signal_vm_fault_event(pdd, &info, NULL);
-               else
-                       kfd_signal_vm_fault_event(pdd, &info, NULL);
-
+               kfd_signal_vm_fault_event(pdd, &info, NULL);
                kfd_unref_process(p);
        }
 }

--
2.43.0