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

[xen staging] iommu/ipmmu-vmsa: Fix build with HAS_PCI=n



commit 3cf47a1e16343a79e2a796c504ac567c02acecde
Author:     Mykyta Poturai <Mykyta_Poturai@xxxxxxxx>
AuthorDate: Thu Aug 21 11:23:55 2025 +0000
Commit:     Stefano Stabellini <stefano.stabellini@xxxxxxx>
CommitDate: Thu Aug 21 14:47:01 2025 -0700

    iommu/ipmmu-vmsa: Fix build with HAS_PCI=n
    
    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.
    
    Fixes: 08b52c30bea5 ("iommu/ipmmu-vmsa: Implement basic PCIE-IPMMU OSID 
support")
    Reported-by: Jan Beulich <jbeulich@xxxxxxxx>
    Signed-off-by: Mykyta Poturai <mykyta_poturai@xxxxxxxx>
    Reviewed-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>
---
 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__ */
--
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®.