[PATCH] xen/arm: fix build with HAS_PCI

Stewart Hildebrand posted 1 patch 4 months, 3 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/20250609205422.180717-1-stewart.hildebrand@amd.com
There is a newer version of this series
xen/arch/arm/include/asm/pci.h | 2 ++
1 file changed, 2 insertions(+)
[PATCH] xen/arm: fix build with HAS_PCI
Posted by Stewart Hildebrand 4 months, 3 weeks ago
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")
Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
---
 xen/arch/arm/include/asm/pci.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/xen/arch/arm/include/asm/pci.h b/xen/arch/arm/include/asm/pci.h
index 1605ec660d0b..1bbb9d780193 100644
--- a/xen/arch/arm/include/asm/pci.h
+++ b/xen/arch/arm/include/asm/pci.h
@@ -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
-- 
2.49.0


Re: [PATCH] xen/arm: fix build with HAS_PCI
Posted by Orzel, Michal 4 months, 3 weeks ago

On 09/06/2025 22:54, Stewart Hildebrand wrote:
> 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")
> Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
> ---
>  xen/arch/arm/include/asm/pci.h | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/xen/arch/arm/include/asm/pci.h b/xen/arch/arm/include/asm/pci.h
> index 1605ec660d0b..1bbb9d780193 100644
> --- a/xen/arch/arm/include/asm/pci.h
> +++ b/xen/arch/arm/include/asm/pci.h
> @@ -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:
Reviewed-by: Michal Orzel <michal.orzel@amd.com>

~Michal


Re: [PATCH] xen/arm: fix build with HAS_PCI
Posted by Stewart Hildebrand 4 months, 3 weeks ago
On 6/10/25 02:42, Orzel, Michal wrote:
> On 09/06/2025 22:54, Stewart Hildebrand wrote:
>> 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")
>> Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
>> ---
>>  xen/arch/arm/include/asm/pci.h | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/xen/arch/arm/include/asm/pci.h b/xen/arch/arm/include/asm/pci.h
>> index 1605ec660d0b..1bbb9d780193 100644
>> --- a/xen/arch/arm/include/asm/pci.h
>> +++ b/xen/arch/arm/include/asm/pci.h
>> @@ -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.

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

> That said, I don't find it mandatory, so with or without:
> Reviewed-by: Michal Orzel <michal.orzel@amd.com>
> 
> ~Michal