Skip to contentSkip to conversation

xen/bitmap: Drop unused headers

PATCH In review Andrew Cooper 2 participants 3 messages Feb 1, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen/bitmap: Drop unused headers

Nothing in bitmap.h uses lib.h, and there's no point including types.h when we need to include bitops.h anyway.

---
CC: George Dunlap <[email protected]>
CC: Jan Beulich <[email protected]>
CC: Stefano Stabellini <[email protected]>
CC: Wei Liu <[email protected]>
CC: Julien Grall <[email protected]>

---
 xen/include/xen/bitmap.h | 2 --
 1 file changed, 2 deletions(-)
xen/include/xen/bitmap.h +0 -2
index b9f980e91930..9f749e3913d8 100644
@@ -3,8 +3,6 @@
 
 #ifndef __ASSEMBLY__
 
-#include <xen/lib.h>
-#include <xen/types.h>
 #include <xen/bitops.h>
 
 /*
Signature · 1 line
2.30.2
#2 lore raw
In reply to Andrew Cooper
Quoted 19 lines · Andrew Cooper

Nothing in bitmap.h uses lib.h, and there's no point including types.h when we need to include bitops.h anyway.

---
CC: George Dunlap <[email protected]>
CC: Jan Beulich <[email protected]>
CC: Stefano Stabellini <[email protected]>
CC: Wei Liu <[email protected]>
CC: Julien Grall <[email protected]>

---
 xen/include/xen/bitmap.h | 2 --
 1 file changed, 2 deletions(-)
xen/include/xen/bitmap.h +0 -0
index b9f980e91930..9f749e3913d8 100644

xen/include/xen/bitmap.h line 6

Quoted 6 lines
xen/include/xen/bitmap.h +0 -2
@@ -3,8 +3,6 @@
 
 #ifndef __ASSEMBLY__
 
-#include <xen/lib.h>
-#include <xen/types.h>
 #include <xen/bitops.h>

Turns out this went too far, and breaks PPC.  Other arches look ok.

https://gitlab.com/xen-project/people/andyhhp/xen/-/jobs/6076263594

bitmap.h uses mem{set,cpy}() so needs string.h.  That's a bug in this patch specifically.

However, cpumask.h transitively picks up IS_ALIGNED() (so needs macros.h) and ASSERT() which sadly is still in lib.h

I guess moving the mess from bitmap.h to cpumask.h is a (minor) improvement.

But this comes back to the header tangle which prevented moving BUG() in the first place.  Sadly there's been no reply to my question in the debugger.h removal, but I'm going to get that committed and then we can re-evaluate.

~Andrew