From: Dan Carpenter <error27@gmail.com>
To: Benjamin Gaignard <benjamin.gaignard@collabora.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: [PATCH] iommu/vsi: Use list_for_each_entry()
Date: Wed, 20 May 2026 09:00:23 +0300 [thread overview]
Message-ID: <ag1N99H-xnmSh-hc@stanley.mountain> (raw)
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>
---
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;
--
2.53.0
next reply other threads:[~2026-05-20 6:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-20 6:00 Dan Carpenter [this message]
2026-05-20 12:58 ` Benjamin Gaignard
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=ag1N99H-xnmSh-hc@stanley.mountain \
--to=error27@gmail.com \
--cc=benjamin.gaignard@collabora.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
Powered by JetHome