From: Joerg Roedel <joro@8bytes.org>
To: Dan Carpenter <dan.carpenter@linaro.org>
Cc: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>,
Will Deacon <will@kernel.org>,
Robin Murphy <robin.murphy@arm.com>,
iommu@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] iommu/amd: Return a literal in init_gcr3_table()
Date: Thu, 20 Mar 2025 09:03:05 +0100 [thread overview]
Message-ID: <Z9vLuWvzVJOyuuWu@8bytes.org> (raw)
In-Reply-To: <faa7edf4-a757-4390-8226-2604ef6476d6@stanley.mountain>
On Mon, Mar 17, 2025 at 09:43:32AM +0300, Dan Carpenter wrote:
> This code intentionally returns zero but it does it as "return ret;"
> Returning ret looks like an error path where return 0 is more
> clear and looks more intentional.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
> drivers/iommu/amd/iommu.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iommu/amd/iommu.c b/drivers/iommu/amd/iommu.c
> index ce2626801ddf..7cbcc4933c8b 100644
> --- a/drivers/iommu/amd/iommu.c
> +++ b/drivers/iommu/amd/iommu.c
> @@ -2150,7 +2150,7 @@ static int init_gcr3_table(struct iommu_dev_data *dev_data,
>
> /* Setup GCR3[0] only if domain is setup with v2 page table mode */
> if (!pdom_is_v2_pgtbl_mode(pdom))
> - return ret;
> + return 0;
There is another case of this a couple lines above in the same function.
Mind changing that as well?
Regards,
Joerg
next prev parent reply other threads:[~2025-03-20 8:03 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-17 6:42 [PATCH 0/2] iommu/amd: two tiny cleanups Dan Carpenter
2025-03-17 6:43 ` [PATCH 1/2] iommu/amd: Delete unnecessary NULL check Dan Carpenter
2025-03-17 6:43 ` [PATCH 2/2] iommu/amd: Return a literal in init_gcr3_table() Dan Carpenter
2025-03-20 8:03 ` Joerg Roedel [this message]
2025-03-20 8:53 ` Dan Carpenter
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=Z9vLuWvzVJOyuuWu@8bytes.org \
--to=joro@8bytes.org \
--cc=dan.carpenter@linaro.org \
--cc=iommu@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=robin.murphy@arm.com \
--cc=suravee.suthikulpanit@amd.com \
--cc=will@kernel.org \
/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.