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 ipmmu_assign_device() where
the function-scope 'ret' is sufficient.
This fixes MISRA C R5.3.
Signed-off-by: Michal Orzel <michal.orzel@amd.com>
---
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 ea9fa9ddf3ce..fa9ab9cb1330 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.
--
2.43.0
On Tue, 7 Apr 2026, Michal Orzel wrote:
> 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 ipmmu_assign_device() where
> the function-scope 'ret' is sufficient.
>
> This fixes MISRA C R5.3.
>
> Signed-off-by: Michal Orzel <michal.orzel@amd.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
> ---
> 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 ea9fa9ddf3ce..fa9ab9cb1330 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.
> --
> 2.43.0
>
On 4/7/26 13:34, Michal Orzel wrote:
Hello Michal
> Rename 'pdev' to 'pci_dev' in the dev_print_pci() macro to avoid
NIT: The macro is named dev_print, not dev_print_pci.
> 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@amd.com>
Reviewed-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
> ---
> 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 ea9fa9ddf3ce..fa9ab9cb1330 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.
© 2016 - 2026 Red Hat, Inc.