drm/amdgpu: Remove redundant mode2 restore check
Subsystems (2)
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/1 drm/amdgpu: Remove redundant mode2 restore check
The "r" variable is checked twice. We already know it is zero/success at this point so there is no need to check again. Delete the redundant check and pull the code in a tab.
Fixes 208e5d4b3f1e2 ("drm/amd/amdgpu: Add soc_v1_0 reset handler")
Assisted-by Codex:GPT-5
Signed-off-by Dan Carpenter <[email protected]>
---
In retrospect, I probably could have deleted these tabs without AI help.
drivers/gpu/drm/amd/amdgpu/soc_v1_0.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-)
drivers/gpu/drm/amd/amdgpu/soc_v1_0.c +9 -12
@@ -729,19 +729,16 @@ soc_v1_0_mode2_restore_hwcontext(struct amdgpu_reset_control *reset_ctl,amdgpu_ras_resume (tmp_adev); -if (!r) { -amdgpu_set_init_level (tmp_adev, -AMDGPU_INIT_LEVEL_DEFAULT ); -amdgpu_irq_gpu_reset_resume_helper (tmp_adev); +amdgpu_set_init_level (tmp_adev,AMDGPU_INIT_LEVEL_DEFAULT ); +amdgpu_irq_gpu_reset_resume_helper (tmp_adev); - r =amdgpu_ib_ring_tests (tmp_adev); -if (r) { -dev_err (tmp_adev->dev, -"ib ring test failed (%d).\n" , r); - r = -EAGAIN ; - tmp_adev->asic_reset_res = r; - goto end; - } + r =amdgpu_ib_ring_tests (tmp_adev); +if (r) { +dev_err (tmp_adev->dev, +"ib ring test failed (%d).\n" , r); + r = -EAGAIN ; + tmp_adev->asic_reset_res = r; + goto end; } }
Signature · 1 line
2.53.0