From: Sunil Khatri <sunil.khatri@amd.com>
To: "Alex Deucher" <alexander.deucher@amd.com>,
"Christian König" <christian.koenig@amd.com>
Cc: amd-gfx@lists.freedesktop.org, Sunil Khatri <sunil.khatri@amd.com>
Subject: [Patch v1 3/4] drm/amdgpu/userq: no need to use local variable here for return
Date: Thu, 26 Mar 2026 14:26:00 +0530 [thread overview]
Message-ID: <20260326085601.2665215-4-sunil.khatri@amd.com> (raw)
In-Reply-To: <20260326085601.2665215-1-sunil.khatri@amd.com>
In function amdgpu_userq_gem_va_unmap_validate use function
return value directly in the if condition instead
of local variable ret.
Signed-off-by: Sunil Khatri <sunil.khatri@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
index 2b07c3941927..48cb2e21ce56 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
@@ -1478,7 +1478,6 @@ int amdgpu_userq_gem_va_unmap_validate(struct amdgpu_device *adev,
u32 ip_mask = amdgpu_userq_get_supported_ip_mask(adev);
struct amdgpu_bo_va *bo_va = mapping->bo_va;
struct dma_resv *resv = bo_va->base.bo->tbo.base.resv;
- int ret = 0;
if (!ip_mask)
return 0;
@@ -1493,9 +1492,8 @@ int amdgpu_userq_gem_va_unmap_validate(struct amdgpu_device *adev,
* the eviction fence is always unsignaled.
*/
if (!dma_resv_test_signaled(resv, DMA_RESV_USAGE_BOOKKEEP)) {
- ret = dma_resv_wait_timeout(resv, DMA_RESV_USAGE_BOOKKEEP, true,
- MAX_SCHEDULE_TIMEOUT);
- if (ret <= 0)
+ if (dma_resv_wait_timeout(resv, DMA_RESV_USAGE_BOOKKEEP, true,
+ MAX_SCHEDULE_TIMEOUT) <= 0)
return -EBUSY;
}
--
2.34.1
next prev parent reply other threads:[~2026-03-26 8:56 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-26 8:55 [Patch v1 0/4] Bunch of patches to do trivial clean up and Sunil Khatri
2026-03-26 8:55 ` [Patch v1 1/4] drm/amdgpu/userq: no need to use local variable ret Sunil Khatri
2026-03-26 12:08 ` Christian König
2026-03-26 12:26 ` Khatri, Sunil
2026-03-26 12:52 ` Christian König
2026-03-26 8:55 ` [Patch v1 2/4] drm/amdgpu/userq: no need to use local variable here for return Sunil Khatri
2026-03-26 12:09 ` Christian König
2026-03-26 12:30 ` Khatri, Sunil
2026-03-26 12:55 ` Christian König
2026-03-26 8:56 ` Sunil Khatri [this message]
2026-03-26 12:11 ` [Patch v1 3/4] " Christian König
2026-03-26 12:32 ` Khatri, Sunil
2026-03-26 8:56 ` [Patch v1 4/4] drm/amdgpu/userq: Fix the code alignment for readability Sunil Khatri
2026-03-26 12:12 ` Christian König
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=20260326085601.2665215-4-sunil.khatri@amd.com \
--to=sunil.khatri@amd.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox