|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [xen staging] xen/bitmap: Drop unused headers
commit 9ad2c6572660611c0b9066bfd83851a272f351a0
Author: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
AuthorDate: Wed Jan 31 18:05:18 2024 +0000
Commit: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CommitDate: Sat Feb 14 01:01:33 2026 +0000
xen/bitmap: Drop unused headers
Nothing in bitmap.h uses lib.h. Reduce to just macros.h and string.h. Drop
types.h while at it, as it comes in through bitops.h
cpumask.h and nodemask.h only include kernel.h to get container_of(). Move
it
into macros.h where it belongs, cleaning it up as it goes.
acpi/numa.c was picking up printk() transitively through bitmap.h so include
lib.h directly.
No functional change.
Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
Acked-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
Acked-by: Julien Grall <jgrall@xxxxxxxxxx>
---
xen/drivers/acpi/numa.c | 1 +
xen/include/xen/bitmap.h | 4 ++--
xen/include/xen/cpumask.h | 1 -
xen/include/xen/kernel.h | 12 ------------
xen/include/xen/macros.h | 13 +++++++++++++
xen/include/xen/nodemask.h | 1 -
6 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/xen/drivers/acpi/numa.c b/xen/drivers/acpi/numa.c
index 77945f8744..5f161c32fb 100644
--- a/xen/drivers/acpi/numa.c
+++ b/xen/drivers/acpi/numa.c
@@ -22,6 +22,7 @@
*
*/
#include <xen/init.h>
+#include <xen/lib.h>
#include <xen/types.h>
#include <xen/errno.h>
#include <xen/acpi.h>
diff --git a/xen/include/xen/bitmap.h b/xen/include/xen/bitmap.h
index c69398a127..561b5da6af 100644
--- a/xen/include/xen/bitmap.h
+++ b/xen/include/xen/bitmap.h
@@ -3,9 +3,9 @@
#ifndef __ASSEMBLER__
-#include <xen/lib.h>
-#include <xen/types.h>
#include <xen/bitops.h>
+#include <xen/macros.h>
+#include <xen/string.h>
/*
* bitmaps provide bit arrays that consume one or more unsigned
diff --git a/xen/include/xen/cpumask.h b/xen/include/xen/cpumask.h
index f3a53d90e0..89d03e7ce1 100644
--- a/xen/include/xen/cpumask.h
+++ b/xen/include/xen/cpumask.h
@@ -57,7 +57,6 @@
#include <xen/bitmap.h>
#include <xen/bug.h>
-#include <xen/kernel.h>
#include <xen/random.h>
typedef struct cpumask{ DECLARE_BITMAP(bits, NR_CPUS); } cpumask_t;
diff --git a/xen/include/xen/kernel.h b/xen/include/xen/kernel.h
index c5b6cc9777..378f21c247 100644
--- a/xen/include/xen/kernel.h
+++ b/xen/include/xen/kernel.h
@@ -8,18 +8,6 @@
#include <xen/macros.h>
#include <xen/types.h>
-/**
- * container_of - cast a member of a structure out to the containing structure
- *
- * @ptr: the pointer to the member.
- * @type: the type of the container struct this is embedded in.
- * @member: the name of the member within the struct.
- *
- */
-#define container_of(ptr, type, member) ({ \
- typeof_field(type, member) *__mptr = (ptr); \
- (type *)( (char *)__mptr - offsetof(type,member) );})
-
/**
* __struct_group() - Create a mirrored named and anonyomous struct
*
diff --git a/xen/include/xen/macros.h b/xen/include/xen/macros.h
index 714a644f4e..acd451b335 100644
--- a/xen/include/xen/macros.h
+++ b/xen/include/xen/macros.h
@@ -96,6 +96,19 @@
#define endof_field(type, member) (offsetof(type, member) + sizeof_field(type,
member))
+/**
+ * container_of - cast a member of a structure out to the containing structure
+ *
+ * @ptr: the pointer to the member.
+ * @type: the type of the container struct this is embedded in.
+ * @member: the name of the member within the struct.
+ */
+#define container_of(ptr, type, member) \
+ ({ \
+ typeof_field(type, member) *__mptr = (ptr); \
+ (type *)((void *)__mptr - offsetof(type, member)); \
+ })
+
/* Cast an arbitrary integer to a pointer. */
#define _p(x) ((void *)(unsigned long)(x))
diff --git a/xen/include/xen/nodemask.h b/xen/include/xen/nodemask.h
index c9b18c47aa..b4718cb3bb 100644
--- a/xen/include/xen/nodemask.h
+++ b/xen/include/xen/nodemask.h
@@ -53,7 +53,6 @@
* for_each_online_node(node) for-loop node over node_online_map
*/
-#include <xen/kernel.h>
#include <xen/bitmap.h>
#include <xen/numa.h>
--
generated by git-patchbot for /home/xen/git/xen.git#staging
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |