From: Benjamin Gaignard <benjamin.gaignard@collabora.com>
To: Dan Carpenter <error27@gmail.com>
Cc: Joerg Roedel <joro@8bytes.org>, Will Deacon <will@kernel.org>,
Robin Murphy <robin.murphy@arm.com>,
iommu@lists.linux.dev, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] iommu/vsi: Use list_for_each_entry()
Date: Wed, 20 May 2026 14:58:20 +0200 [thread overview]
Message-ID: <9b5fe6af-0c06-4f51-bb33-9e0b47af7ea3@collabora.com> (raw)
In-Reply-To: <ag1N99H-xnmSh-hc@stanley.mountain>
Le 20/05/2026 à 08:00, Dan Carpenter a écrit :
> Smatch complains about the NULL check on "iommu" because list_entry()
> can't be NULL. Clean up this code by using list_for_each_entry().
>
> Signed-off-by: Dan Carpenter <error27@gmail.com>
Reviewed-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
> ---
> Untested, but it compiled on the first try (no typos!)
>
> drivers/iommu/vsi-iommu.c | 10 ++--------
> 1 file changed, 2 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/iommu/vsi-iommu.c b/drivers/iommu/vsi-iommu.c
> index 5d0721bd2c7a..9954ed414526 100644
> --- a/drivers/iommu/vsi-iommu.c
> +++ b/drivers/iommu/vsi-iommu.c
> @@ -366,15 +366,9 @@ static int vsi_iommu_map_iova(struct vsi_iommu_domain *vsi_domain, u32 *pte_addr
> static void vsi_iommu_flush_tlb(struct iommu_domain *domain)
> {
> struct vsi_iommu_domain *vsi_domain = to_vsi_domain(domain);
> - struct list_head *pos;
> -
> - list_for_each(pos, &vsi_domain->iommus) {
> - struct vsi_iommu *iommu;
> -
> - iommu = list_entry(pos, struct vsi_iommu, node);
> - if (!iommu)
> - continue;
> + struct vsi_iommu *iommu;
>
> + list_for_each_entry(iommu, &vsi_domain->iommus, node) {
> if (pm_runtime_get(iommu->dev) < 0)
> continue;
>
next prev parent reply other threads:[~2026-05-20 12:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-20 6:00 Dan Carpenter
2026-05-20 12:58 ` Benjamin Gaignard [this message]
2026-05-28 7:30 ` Joerg Roedel
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=9b5fe6af-0c06-4f51-bb33-9e0b47af7ea3@collabora.com \
--to=benjamin.gaignard@collabora.com \
--cc=error27@gmail.com \
--cc=iommu@lists.linux.dev \
--cc=joro@8bytes.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robin.murphy@arm.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 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®