[PATCH v2] iommu/ipmmu-vmsa: Fix build with HAS_PCI=n

Mykyta Poturai posted 1 patch 2 months, 1 week ago
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/5ecb3da69ba1581971197388c6b9062b46900cff.1755775255.git.mykyta._5Fpoturai@epam.com
xen/arch/arm/pci/pci-host-rcar4.h | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
[PATCH v2] iommu/ipmmu-vmsa: Fix build with HAS_PCI=n
Posted by Mykyta Poturai 2 months, 1 week ago
With PCI disabled the build fails due to undefined struct
pci_host_bridge.

Add ifdef guard to pci-host-rcar4.h to not require the stuct being
defined when PCI support is disabled. All call sites are already covered
by HAS_PCI check, so no dummy implementations are needed.

Also move includes under the header guard to not break MISRA rules.

Reported-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Mykyta Poturai <mykyta_poturai@epam.com>
---
 xen/arch/arm/pci/pci-host-rcar4.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/pci/pci-host-rcar4.h b/xen/arch/arm/pci/pci-host-rcar4.h
index 8ac6626a22..31ef9d2d40 100644
--- a/xen/arch/arm/pci/pci-host-rcar4.h
+++ b/xen/arch/arm/pci/pci-host-rcar4.h
@@ -1,9 +1,10 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
-#include <asm/pci.h>
-
 #ifndef __PCI_HOST_RCAR4_H__
 #define __PCI_HOST_RCAR4_H__
 
+#include <asm/pci.h>
+
+#ifdef CONFIG_HAS_PCI
 void rcar4_pcie_osid_bdf_set(struct pci_host_bridge *bridge,
                              unsigned int reg_id, uint32_t osid, uint32_t bdf);
 void rcar4_pcie_osid_bdf_clear(struct pci_host_bridge *bridge,
@@ -14,5 +15,6 @@ int rcar4_pcie_osid_reg_alloc(struct pci_host_bridge *bridge);
 void rcar4_pcie_osid_reg_free(struct pci_host_bridge *bridge,
                               unsigned int reg_id);
 int rcar4_pcie_osid_regs_init(struct pci_host_bridge *bridge);
+#endif
 
 #endif /* __PCI_HOST_RCAR4_H__ */
-- 
2.34.1
Re: [PATCH v2] iommu/ipmmu-vmsa: Fix build with HAS_PCI=n
Posted by Jan Beulich 2 months, 1 week ago
On 21.08.2025 13:23, Mykyta Poturai wrote:
> With PCI disabled the build fails due to undefined struct
> pci_host_bridge.
> 
> Add ifdef guard to pci-host-rcar4.h to not require the stuct being
> defined when PCI support is disabled. All call sites are already covered
> by HAS_PCI check, so no dummy implementations are needed.
> 
> Also move includes under the header guard to not break MISRA rules.
> 
> Reported-by: Jan Beulich <jbeulich@suse.com>
> Signed-off-by: Mykyta Poturai <mykyta_poturai@epam.com>

Along with the Reported-by I thought a Fixes: tag would go without saying.
Can likely be added while committing.

Jan
Re: [PATCH v2] iommu/ipmmu-vmsa: Fix build with HAS_PCI=n
Posted by Stefano Stabellini 2 months, 1 week ago
On Thu, 21 Aug 2025, Jan Beulich wrote:
> On 21.08.2025 13:23, Mykyta Poturai wrote:
> > With PCI disabled the build fails due to undefined struct
> > pci_host_bridge.
> > 
> > Add ifdef guard to pci-host-rcar4.h to not require the stuct being
> > defined when PCI support is disabled. All call sites are already covered
> > by HAS_PCI check, so no dummy implementations are needed.
> > 
> > Also move includes under the header guard to not break MISRA rules.
> > 
> > Reported-by: Jan Beulich <jbeulich@suse.com>
> > Signed-off-by: Mykyta Poturai <mykyta_poturai@epam.com>
> 
> Along with the Reported-by I thought a Fixes: tag would go without saying.
> Can likely be added while committing.

I added Fixes and my Reviewed-by