All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Orzel <michal.orzel@amd.com>
To: <xen-devel@lists.xenproject.org>
Cc: Michal Orzel <michal.orzel@amd.com>,
	Julien Grall <julien@xen.org>,
	"Rahul Singh" <rahul.singh@arm.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: [PATCH 1/2] iommu/arm: smmu: Fix variable shadowing
Date: Tue, 7 Apr 2026 12:34:32 +0200	[thread overview]
Message-ID: <20260407103434.90838-2-michal.orzel@amd.com> (raw)
In-Reply-To: <20260407103434.90838-1-michal.orzel@amd.com>

Rename 'pdev' to 'pci_dev' in the dev_print_pci() macro to avoid
shadowing local 'pdev' variables at call sites.

Remove the unused 'ret' declaration from arm_smmu_dt_add_device_generic()
where the function-scope 'ret' is sufficient.

Fix shadowing of 'domain' in arm_smmu_assign_dev() by removing the
inner-scope redeclaration, using the function-scope variable instead.

This fixes MISRA C R5.3.

Signed-off-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/drivers/passthrough/arm/smmu.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/xen/drivers/passthrough/arm/smmu.c b/xen/drivers/passthrough/arm/smmu.c
index 22d306d0cb80..d63c9015510e 100644
--- a/xen/drivers/passthrough/arm/smmu.c
+++ b/xen/drivers/passthrough/arm/smmu.c
@@ -130,8 +130,8 @@ typedef enum irqreturn irqreturn_t;
         printk(lvl "smmu: %s: " fmt, dev_name((dev)), ## __VA_ARGS__);  \
     else                                                                \
     {                                                                   \
-        struct pci_dev *pdev = dev_to_pci((dev));                       \
-        printk(lvl "smmu: %pp: " fmt, &pdev->sbdf, ## __VA_ARGS__);     \
+        struct pci_dev *pci_dev = dev_to_pci((dev));                    \
+        printk(lvl "smmu: %pp: " fmt, &pci_dev->sbdf, ## __VA_ARGS__);  \
     }                                                                   \
 })
 #endif
@@ -927,7 +927,6 @@ static int arm_smmu_dt_add_device_generic(u8 devfn, struct device *dev)
 	if ( dev_is_pci(dev) )
 	{
 		struct pci_dev *pdev = dev_to_pci(dev);
-		int ret;
 
 		/* Ignore calls for phantom functions */
 		if ( devfn != pdev->devfn )
@@ -2788,7 +2787,7 @@ static int arm_smmu_assign_dev(struct domain *d, u8 devfn,
 		/* dom_io is used as a sentinel for quarantined devices */
 		if ( d == dom_io )
 		{
-			struct iommu_domain *domain = dev_iommu_domain(dev);
+			domain = dev_iommu_domain(dev);
 			if ( !iommu_quarantine )
 				return 0;
 
-- 
2.43.0



  reply	other threads:[~2026-04-07 10:35 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-07 10:34 [PATCH 0/2] Final series to make Arm MISRA allcode green Michal Orzel
2026-04-07 10:34 ` Michal Orzel [this message]
2026-04-07 20:30   ` [PATCH 1/2] iommu/arm: smmu: Fix variable shadowing Stefano Stabellini
2026-04-07 10:34 ` [PATCH 2/2] iommu/arm: ipmmu-vmsa: " Michal Orzel
2026-04-07 13:48   ` Oleksandr Tyshchenko
2026-04-07 20:32   ` Stefano Stabellini
2026-04-08  9:22 ` [PATCH 0/2] Final series to make Arm MISRA allcode green Andrew Cooper
2026-04-08  9:46   ` Nicola Vetrini
2026-04-08  9:51     ` Andrew Cooper
2026-04-08 10:21       ` Nicola Vetrini
2026-04-08 10:36         ` Orzel, Michal
2026-04-08 10:42           ` Andrew Cooper
2026-04-08 11:01             ` Orzel, Michal

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=20260407103434.90838-2-michal.orzel@amd.com \
    --to=michal.orzel@amd.com \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=bertrand.marquis@arm.com \
    --cc=julien@xen.org \
    --cc=rahul.singh@arm.com \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.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.