Skip to contentSkip to conversation

xen/arm: fix build with HAS_PCI

PATCH Superseded Stewart Hildebrand 2 participants 3 messages Jun 9, 2025 – Jun 10, 2025

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen/arm: fix build with HAS_PCI

In file included from ./include/xen/pci.h:72,
from drivers/pci/pci.c:8:
./arch/arm/include/asm/pci.h:131:50: error: ‘struct rangeset’ declared inside parameter list will not be visible outside of this definition or declaration [-Werror]
131 | static inline int pci_sanitize_bar_memory(struct rangeset *r)
| ^~~~~~~~
cc1: all warnings being treated as errors

Fixes 4acab25a9300 ("x86/vpci: fix handling of BAR overlaps with non-hole regions")
---
 xen/arch/arm/include/asm/pci.h | 2 ++
 1 file changed, 2 insertions(+)
xen/arch/arm/include/asm/pci.h +2 -0
index 1605ec660d0b..1bbb9d780193 100644
@@ -17,6 +17,8 @@
 
 #ifdef CONFIG_HAS_PCI
 
+#include <xen/rangeset.h>
+
 #include <asm/p2m.h>
 
 #define pci_to_dev(pcidev) (&(pcidev)->arch.dev)

base-commit: 86a12671c5d33063b6f958bdcca7c9d14cd5aac8

Signature · 1 line
2.49.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 18 lines · Stewart Hildebrand

In file included from ./include/xen/pci.h:72,
from drivers/pci/pci.c:8:
./arch/arm/include/asm/pci.h:131:50: error: ‘struct rangeset’ declared inside parameter list will not be visible outside of this definition or declaration [-Werror]
131 | static inline int pci_sanitize_bar_memory(struct rangeset *r)
| ^~~~~~~~
cc1: all warnings being treated as errors

Fixes 4acab25a9300 ("x86/vpci: fix handling of BAR overlaps with non-hole regions")
---
 xen/arch/arm/include/asm/pci.h | 2 ++
 1 file changed, 2 insertions(+)
xen/arch/arm/include/asm/pci.h +0 -0
index 1605ec660d0b..1bbb9d780193 100644

xen/arch/arm/include/asm/pci.h line 20

Quoted 4 lines
xen/arch/arm/include/asm/pci.h +1 -0
@@ -17,6 +17,8 @@
 
 #ifdef CONFIG_HAS_PCI
 
+#include <xen/rangeset.h>

Just for the struct, I think it would be better to forward declare it (at least this is what we recently started to prefer). Especially given that rangeset.h also forward declares it.

That said, I don't find it mandatory, so with or without:

~Michal

#2 lore raw
Quoted 20 lines · Michal
Quoted 19 lines · Stewart Hildebrand

In file included from ./include/xen/pci.h:72,
from drivers/pci/pci.c:8:
./arch/arm/include/asm/pci.h:131:50: error: ‘struct rangeset’ declared inside parameter list will not be visible outside of this definition or declaration [-Werror]
131 | static inline int pci_sanitize_bar_memory(struct rangeset *r)
| ^~~~~~~~
cc1: all warnings being treated as errors

Fixes 4acab25a9300 ("x86/vpci: fix handling of BAR overlaps with non-hole regions")
---
 xen/arch/arm/include/asm/pci.h | 2 ++
 1 file changed, 2 insertions(+)
xen/arch/arm/include/asm/pci.h +0 -0
index 1605ec660d0b..1bbb9d780193 100644
@@ -17,6 +17,8 @@
 
Quoted 6 lines

xen/arch/arm/include/asm/pci.h line 20

Quoted 3 lines
xen/arch/arm/include/asm/pci.h +1 -0
 #ifdef CONFIG_HAS_PCI
 
+#include <xen/rangeset.h>

Just for the struct, I think it would be better to forward declare it (at least this is what we recently started to prefer). Especially given that rangeset.h also forward declares it.

Forward declaring it does seem better. I'll send v2.

Quoted 4 lines

That said, I don't find it mandatory, so with or without:

~Michal