Skip to contentSkip to conversation

x86/setup: Make setup.h header self contained

PATCH Superseded Frediano Ziglio 3 participants 5 messages Oct 30, 2024

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/setup: Make setup.h header self contained

The header uses rangeset structure typedef which definition is not included.

---
 xen/arch/x86/include/asm/setup.h | 1 +
 1 file changed, 1 insertion(+)
xen/arch/x86/include/asm/setup.h +1 -0
index 4874ee8936..e4e96b36bd 100644
@@ -2,6 +2,7 @@
 #define __X86_SETUP_H_
 
 #include <xen/multiboot.h>
+#include <xen/rangeset.h>
 #include <asm/numa.h>
 
 extern const char __2M_text_start[], __2M_text_end[];
Signature · 1 line
2.34.1
#1 lore raw
Quoted 2 lines · Frediano Ziglio

The header uses rangeset structure typedef which definition is not included.

And it doesn't need to be. For

int remove_xen_ranges(struct rangeset *r);

we don't need ...

xen/arch/x86/include/asm/setup.h line 8

Quoted 10 lines
xen/arch/x86/include/asm/setup.h +1 -0
@@ -2,6 +2,7 @@
 #define __X86_SETUP_H_
 
 #include <xen/multiboot.h>
+#include <xen/rangeset.h>
 #include <asm/numa.h>
 
 extern const char __2M_text_start[], __2M_text_end[];

... this, a mere

struct rangeset;

forward decl will suffice.

Jan

#2 lore raw
Quoted 24 lines · Jan Beulich
Quoted 2 lines · Frediano Ziglio

The header uses rangeset structure typedef which definition is not included.

And it doesn't need to be. For

int remove_xen_ranges(struct rangeset *r);

we don't need ...

xen/arch/x86/include/asm/setup.h line 8

Quoted 10 lines
xen/arch/x86/include/asm/setup.h +1 -0
@@ -2,6 +2,7 @@
 #define __X86_SETUP_H_
 
 #include <xen/multiboot.h>
+#include <xen/rangeset.h>
 #include <asm/numa.h>
 
 extern const char __2M_text_start[], __2M_text_end[];

... this, a mere

Quoted 6 lines

struct rangeset;

forward decl will suffice.

Jan

It's true, but for the same reason, we could avoid including "xen/multiboot.h" and use "struct module" instead of "module_t".

Frediano

#3 lore raw
Quoted 27 lines · Frediano Ziglio
Quoted 26 lines · Jan Beulich
Quoted 2 lines · Frediano Ziglio

The header uses rangeset structure typedef which definition is not included.

And it doesn't need to be. For

int remove_xen_ranges(struct rangeset *r);

we don't need ...

xen/arch/x86/include/asm/setup.h line 8

Quoted 10 lines
xen/arch/x86/include/asm/setup.h +1 -0
@@ -2,6 +2,7 @@
 #define __X86_SETUP_H_
 
 #include <xen/multiboot.h>
+#include <xen/rangeset.h>
 #include <asm/numa.h>
 
 extern const char __2M_text_start[], __2M_text_end[];

... this, a mere

struct rangeset;

Quoted 7 lines
Quoted 4 lines

forward decl will suffice.

Jan

It's true, but for the same reason, we could avoid including "xen/multiboot.h" and use "struct module" instead of "module_t".

Indeed. I'd even question the need for that typedef.

Jan

#4 lore raw
Quoted 25 lines · Jan Beulich
Quoted 24 lines · Frediano Ziglio
Quoted 23 lines · Jan Beulich
Quoted 2 lines · Frediano Ziglio

The header uses rangeset structure typedef which definition is not included.

And it doesn't need to be. For

int remove_xen_ranges(struct rangeset *r);

we don't need ...

xen/arch/x86/include/asm/setup.h line 8

Quoted 10 lines
xen/arch/x86/include/asm/setup.h +1 -0
@@ -2,6 +2,7 @@
 #define __X86_SETUP_H_
 
 #include <xen/multiboot.h>
+#include <xen/rangeset.h>
 #include <asm/numa.h>
 
 extern const char __2M_text_start[], __2M_text_end[];

... this, a mere

struct rangeset;

Quoted 7 lines
Quoted 6 lines
Quoted 4 lines

forward decl will suffice.

Jan

It's true, but for the same reason, we could avoid including "xen/multiboot.h" and use "struct module" instead of "module_t".

Indeed. I'd even question the need for that typedef.

Please don't got playing with includes of multiboot.h.  All you'll do is interfere with Daniel's in-progress series.

Most includes are getting removed.

~Andrew