Skip to contentSkip to conversation

xarray: Replace kernel.h with the necessary inclusions

PATCH Superseded Andy Shevchenko 2 participants 3 messages Jun 3, 2022

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xarray: Replace kernel.h with the necessary inclusions

When kernel.h is used in the headers it adds a lot into dependency hell, especially when there are circular dependencies are involved.

Replace kernel.h inclusion with the list of what is really being used.

---
 include/linux/xarray.h | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
include/linux/xarray.h +6 -1
index 72feab5ea8d4..e9fedaa3498a 100644
@@ -12,13 +12,18 @@
 #include <linux/bitmap.h>
 #include <linux/bug.h>
 #include <linux/compiler.h>
+#include <linux/err.h>
 #include <linux/gfp.h>
 #include <linux/kconfig.h>
-#include <linux/kernel.h>
+#include <linux/limits.h>
+#include <linux/lockdep.h>
+#include <linux/math.h>
 #include <linux/rcupdate.h>
 #include <linux/spinlock.h>
 #include <linux/types.h>
 
+#include <asm/bitsperlong.h>
+
 /*
  * The bottom two bits of the entry determine how the XArray interprets
  * the contents:
Signature · 1 line
2.35.1
maintainer
#1 lore raw
Quoted 4 lines · Andy Shevchenko

When kernel.h is used in the headers it adds a lot into dependency hell, especially when there are circular dependencies are involved.

Replace kernel.h inclusion with the list of what is really being used.

Thanks. Can you fix the test suite too?

(cd tools/testing/radix-tree; make)

#2 lore raw
Quoted 9 lines · Matthew Wilcox
Quoted 4 lines · Andy Shevchenko

When kernel.h is used in the headers it adds a lot into dependency hell, especially when there are circular dependencies are involved.

Replace kernel.h inclusion with the list of what is really being used.

Thanks. Can you fix the test suite too?

(cd tools/testing/radix-tree; make)

Works for me. Anything special I should try?

Signature · 2 lines
With Best Regards,
Andy Shevchenko