Skip to contentSkip to conversation

drm/amdgpu: Move the dumping log out of for loop

PATCH In review Sunil Khatri 2 participants 2 messages Aug 28, 2024

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

PATCH 1/1 drm/amdgpu: Move the dumping log out of for loop

log message "Dumping IP State Completed" needs to be logged only once when state dumping is complete.

Hence moving it out of the for loop.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_job.c +2 -3
index 3000a49b3e5c..381c886298bf 100644
@@ -39,12 +39,11 @@ static void amdgpu_job_do_core_dump(struct amdgpu_device *adev,
 	int i;
 
 	dev_info(adev->dev, "Dumping IP State\n");
-	for (i = 0; i < adev->num_ip_blocks; i++) {
+	for (i = 0; i < adev->num_ip_blocks; i++)
 		if (adev->ip_blocks[i].version->funcs->dump_ip_state)
 			adev->ip_blocks[i].version->funcs
 				->dump_ip_state((void *)adev);
-		dev_info(adev->dev, "Dumping IP State Completed\n");
-	}
+	dev_info(adev->dev, "Dumping IP State Completed\n");
 
 	amdgpu_coredump(adev, true, false, job);
 }
Signature · 1 line
2.34.1
Acked-by on v1 1/1
#1 lore raw

[AMD Official Use Only - AMD Internal Distribution Only]

Quoted 40 lines

-----Original Message-----
From: Sunil Khatri <[email protected]>
Sent: Wednesday, August 28, 2024 4:09 PM
To: Deucher, Alexander <[email protected]>; Huang, Trigger <[email protected]>
Cc: [email protected]; Khatri, Sunil <[email protected]>
Subject: [PATCH] drm/amdgpu: Move the dumping log out of for loop

log message "Dumping IP State Completed" needs to be logged only once when state dumping is complete.

Hence moving it out of the for loop.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_job.c +2 -4
index 3000a49b3e5c..381c886298bf 100644
@@ -39,12 +39,11 @@ static void amdgpu_job_do_core_dump(struct
 amdgpu_device *adev,
      int i;
 
      dev_info(adev->dev, "Dumping IP State\n");
-     for (i = 0; i < adev->num_ip_blocks; i++) {
+     for (i = 0; i < adev->num_ip_blocks; i++)
              if (adev->ip_blocks[i].version->funcs->dump_ip_state)
                      adev->ip_blocks[i].version->funcs
                              ->dump_ip_state((void *)adev);
-             dev_info(adev->dev, "Dumping IP State Completed\n");
-     }
+     dev_info(adev->dev, "Dumping IP State Completed\n");
 
      amdgpu_coredump(adev, true, false, job);  }
--

2.34.1