From: Lizhi Hou <lizhi.hou@amd.com>
To: Qianfeng Rong <rongqianfeng@vivo.com>, Min Ma <min.ma@amd.com>,
Oded Gabbay <ogabbay@kernel.org>,
<dri-devel@lists.freedesktop.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] accel/amdxdna: Use int instead of u32 to store error codes
Date: Tue, 26 Aug 2025 09:31:23 -0700 [thread overview]
Message-ID: <51440ea7-bbea-c890-057e-109685a72cb3@amd.com> (raw)
In-Reply-To: <20250826072917.186638-1-rongqianfeng@vivo.com>
On 8/26/25 00:29, Qianfeng Rong wrote:
> Change the 'ret' variable from u32 to int to store -EINVAL, reducing
> potential risks such as incorrect results when comparing 'ret' with
> error codes.
Sounds this fixes code issue. Could you add "Fixes" tag?
Thanks,
Lizhi
> Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.com>
> ---
> drivers/accel/amdxdna/aie2_ctx.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/accel/amdxdna/aie2_ctx.c b/drivers/accel/amdxdna/aie2_ctx.c
> index 420467a5325c..e9f9b1fa5dc1 100644
> --- a/drivers/accel/amdxdna/aie2_ctx.c
> +++ b/drivers/accel/amdxdna/aie2_ctx.c
> @@ -199,7 +199,7 @@ aie2_sched_resp_handler(void *handle, void __iomem *data, size_t size)
> {
> struct amdxdna_sched_job *job = handle;
> struct amdxdna_gem_obj *cmd_abo;
> - u32 ret = 0;
> + int ret = 0;
> u32 status;
>
> cmd_abo = job->cmd_bo;
> @@ -229,7 +229,7 @@ static int
> aie2_sched_nocmd_resp_handler(void *handle, void __iomem *data, size_t size)
> {
> struct amdxdna_sched_job *job = handle;
> - u32 ret = 0;
> + int ret = 0;
> u32 status;
>
> if (unlikely(!data))
> @@ -257,7 +257,7 @@ aie2_sched_cmdlist_resp_handler(void *handle, void __iomem *data, size_t size)
> u32 fail_cmd_status;
> u32 fail_cmd_idx;
> u32 cmd_status;
> - u32 ret = 0;
> + int ret = 0;
>
> cmd_abo = job->cmd_bo;
> if (unlikely(!data) || unlikely(size != sizeof(u32) * 3)) {
next prev parent reply other threads:[~2025-08-26 16:31 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-26 7:29 Qianfeng Rong
2025-08-26 16:31 ` Lizhi Hou [this message]
2025-08-27 2:15 ` Qianfeng Rong
2025-08-27 17:18 ` Lizhi Hou
2025-08-28 2:16 ` Qianfeng Rong
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=51440ea7-bbea-c890-057e-109685a72cb3@amd.com \
--to=lizhi.hou@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=min.ma@amd.com \
--cc=ogabbay@kernel.org \
--cc=rongqianfeng@vivo.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
all inboxes | Powered by JetHome®