From: Dan Carpenter <error27@gmail.com>
To: Asad Kamal <asad.kamal@amd.com>
Cc: "Alex Deucher" <alexander.deucher@amd.com>,
"Christian König" <christian.koenig@amd.com>,
"David Airlie" <airlied@gmail.com>,
"Simona Vetter" <simona@ffwll.ch>,
"Hawking Zhang" <Hawking.Zhang@amd.com>,
"Lijo Lazar" <lijo.lazar@amd.com>,
"Likun Gao" <Likun.Gao@amd.com>,
"Sonny Jiang" <sonny.jiang@amd.com>,
"Gabriel Almeida" <gabrielsousa230@gmail.com>,
amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org
Subject: [PATCH 1/1] drm/amdgpu: Remove redundant mode2 restore check
Date: Sat, 12 Sep 2026 18:03:51 +0300 [thread overview]
Message-ID: <94ccd0e0f47be9ec1985cbc786093c01d7693aa5.1789224159.git.error27@gmail.com> (raw)
In-Reply-To: <cover.1789224159.git.error27@gmail.com>
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 <error27@gmail.com>
---
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(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/soc_v1_0.c b/drivers/gpu/drm/amd/amdgpu/soc_v1_0.c
index 757da0a30fdc..39a748e38e9c 100644
--- a/drivers/gpu/drm/amd/amdgpu/soc_v1_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/soc_v1_0.c
@@ -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;
}
}
--
2.53.0
parent reply other threads:[~2026-09-12 15:03 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <cover.1789224159.git.error27@gmail.com>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=94ccd0e0f47be9ec1985cbc786093c01d7693aa5.1789224159.git.error27@gmail.com \
--to=error27@gmail.com \
--cc=Hawking.Zhang@amd.com \
--cc=Likun.Gao@amd.com \
--cc=airlied@gmail.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=asad.kamal@amd.com \
--cc=christian.koenig@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=gabrielsousa230@gmail.com \
--cc=lijo.lazar@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=simona@ffwll.ch \
--cc=sonny.jiang@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.