[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen staging] iommu/arm: ipmmu-vmsa: Fix variable shadowing



commit af5495d7c6a5cc2d61fab8416710d800bcbacc5a
Author:     Michal Orzel <michal.orzel@xxxxxxx>
AuthorDate: Tue Apr 7 12:34:33 2026 +0200
Commit:     Michal Orzel <michal.orzel@xxxxxxx>
CommitDate: Wed Apr 8 08:12:42 2026 +0200

    iommu/arm: ipmmu-vmsa: Fix variable shadowing
    
    Rename 'pdev' to 'pci_dev' in the dev_print() macro to avoid
    shadowing local 'pdev' variables at call sites.
    
    Remove the unused 'ret' declaration from ipmmu_assign_device() where
    the function-scope 'ret' is sufficient.
    
    This fixes MISRA C R5.3.
    
    Signed-off-by: Michal Orzel <michal.orzel@xxxxxxx>
    Reviewed-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>
    Reviewed-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>
---
 xen/drivers/passthrough/arm/ipmmu-vmsa.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/xen/drivers/passthrough/arm/ipmmu-vmsa.c 
b/xen/drivers/passthrough/arm/ipmmu-vmsa.c
index ea9fa9ddf3..fa9ab9cb13 100644
--- a/xen/drivers/passthrough/arm/ipmmu-vmsa.c
+++ b/xen/drivers/passthrough/arm/ipmmu-vmsa.c
@@ -65,8 +65,8 @@
         printk(lvl "ipmmu: %s: " fmt, dev_name((dev)), ## __VA_ARGS__);  \
     else                                                                \
     {                                                                   \
-        struct pci_dev *pdev = dev_to_pci((dev));                       \
-        printk(lvl "ipmmu: %pp: " fmt, &pdev->sbdf, ## __VA_ARGS__);     \
+        struct pci_dev *pci_dev = dev_to_pci((dev));                       \
+        printk(lvl "ipmmu: %pp: " fmt, &pci_dev->sbdf, ## __VA_ARGS__);     \
     }                                                                   \
 })
 #endif
@@ -1171,8 +1171,6 @@ static int ipmmu_assign_device(struct domain *d, u8 
devfn, struct device *dev,
         /* dom_io is used as a sentinel for quarantined devices */
         if ( d == dom_io )
         {
-            int ret;
-
             /*
              * Try to de-assign: do not return error if it was already
              * de-assigned.
--
generated by git-patchbot for /home/xen/git/xen.git#staging



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.