From: "Khatri, Sunil" <sukhatri@amd.com>
To: "Christian König" <christian.koenig@amd.com>,
"Sunil Khatri" <sunil.khatri@amd.com>,
"Alex Deucher" <alexander.deucher@amd.com>
Cc: amd-gfx@lists.freedesktop.org
Subject: Re: [Patch v1 2/4] drm/amdgpu/userq: no need to use local variable here for return
Date: Thu, 26 Mar 2026 18:00:25 +0530 [thread overview]
Message-ID: <26bef1cf-e636-46f8-b27a-e2840d0bd04d@amd.com> (raw)
In-Reply-To: <23d8f2a6-b705-4380-8897-93d0612f1237@amd.com>
[-- Attachment #1: Type: text/plain, Size: 1957 bytes --]
On 26-03-2026 05:39 pm, Christian König wrote:
>
> On 3/26/26 09:55, Sunil Khatri wrote:
>> In function amdgpu_userq_restore_worker use directly
>> the function's return value 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 | 7 ++-----
>> 1 file changed, 2 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
>> index 2a1832fce6d2..2b07c3941927 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
>> @@ -1222,20 +1222,17 @@ static void amdgpu_userq_restore_worker(struct work_struct *work)
>> struct amdgpu_userq_mgr *uq_mgr = work_to_uq_mgr(work, resume_work.work);
>> struct amdgpu_fpriv *fpriv = uq_mgr_to_fpriv(uq_mgr);
>> struct dma_fence *ev_fence;
>> - int ret;
>>
>> ev_fence = amdgpu_evf_mgr_get_fence(&fpriv->evf_mgr);
>> if (!dma_fence_is_signaled(ev_fence))
>> goto put_fence;
>>
>> - ret = amdgpu_userq_vm_validate(uq_mgr);
>> - if (ret) {
>> + if (amdgpu_userq_vm_validate(uq_mgr)) {
>> drm_file_err(uq_mgr->file, "Failed to validate BOs to restore\n");
> Again, probably a good idea to print the error code here.
since this is a void function and all the functions called here are
already printing the failures and we could just remove the if and let
the called function print error.
>
> Regards,
> Christian.
>
>> goto put_fence;
>> }
>>
>> - ret = amdgpu_userq_restore_all(uq_mgr);
>> - if (ret)
>> + if (amdgpu_userq_restore_all(uq_mgr))
>> drm_file_err(uq_mgr->file, "Failed to restore all queues\n");
Could avoid printing this error all together as we are printing the
error in the function. We could update the error message.
if(ret)
drm_file_err(uq_mgr->file, "Failed to map all the queues\n");
returnret;
>>
>> put_fence:
[-- Attachment #2: Type: text/html, Size: 4039 bytes --]
next prev parent reply other threads:[~2026-03-26 12:30 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 [this message]
2026-03-26 12:55 ` Christian König
2026-03-26 8:56 ` [Patch v1 3/4] " Sunil Khatri
2026-03-26 12:11 ` 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=26bef1cf-e636-46f8-b27a-e2840d0bd04d@amd.com \
--to=sukhatri@amd.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=sunil.khatri@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