* [PATCH v1 1/1] radix-tree: Replace kernel.h with the necessary inclusions
@ 2021-10-27 15:05 Andy Shevchenko
[not found] ` <CAEemH2edgtA+XOY8WjgwFD-50qcw_MGFSgjjBjgKVi_dAwtR6w@mail.gmail.com>
0 siblings, 1 reply; 3+ messages in thread
From: Andy Shevchenko @ 2021-10-27 15:05 UTC (permalink / raw)
To: Andy Shevchenko, linux-kernel; +Cc: Andrew Morton
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.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
include/linux/radix-tree.h | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/include/linux/radix-tree.h b/include/linux/radix-tree.h
index 64ad900ac742..f7c1d21c2f39 100644
--- a/include/linux/radix-tree.h
+++ b/include/linux/radix-tree.h
@@ -9,8 +9,10 @@
#define _LINUX_RADIX_TREE_H
#include <linux/bitops.h>
-#include <linux/kernel.h>
+#include <linux/gfp.h>
#include <linux/list.h>
+#include <linux/lockdep.h>
+#include <linux/math.h>
#include <linux/percpu.h>
#include <linux/preempt.h>
#include <linux/rcupdate.h>
--
2.33.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v1 1/1] radix-tree: Replace kernel.h with the necessary inclusions
[not found] ` <CAEemH2edgtA+XOY8WjgwFD-50qcw_MGFSgjjBjgKVi_dAwtR6w@mail.gmail.com>
@ 2021-11-17 12:55 ` Andy Shevchenko
2021-12-13 20:44 ` Andy Shevchenko
0 siblings, 1 reply; 3+ messages in thread
From: Andy Shevchenko @ 2021-11-17 12:55 UTC (permalink / raw)
To: Li Wang; +Cc: linux-kernel, Andrew Morton
On Wed, Nov 17, 2021 at 03:01:12PM +0800, Li Wang wrote:
Thanks for the report! And do not top post next time, please.
> This patch breaks the radix tree test building.
Yes and no. The dirty tricks with kernel headers that tools/ do is what has
been revealed by this patch.
> # make -C tools/testing/radix-tree/
> make: Entering directory '/root/linux-5.16-rc1/tools/testing/radix-tree'
> cc -I. -I../../include -g -Og -Wall -D_LGPL_SOURCE -fsanitize=address
> -fsanitize=undefined -c -o main.o main.c
> In file included from ./linux/../../../../include/linux/radix-tree.h:14,
> from ./linux/radix-tree.h:5,
> from main.c:10:
> ./linux/lockdep.h:7:38: error: unknown type name ‘spinlock_t’; did you mean
> ‘clock_t’?
> 7 | static inline void lockdep_set_class(spinlock_t *lock,
> | ^~~~~~~~~~
> | clock_t
> In file included from ./linux/radix-tree.h:5,
> from main.c:10:
> ./linux/../../../../include/linux/radix-tree.h:15:10: fatal error:
> linux/math.h: No such file or directory
> 15 | #include <linux/math.h>
> | ^~~~~~~~~~~~~~
> compilation terminated.
> make: *** [<builtin>: main.o] Error 1
> make: Leaving directory '/root/linux-5.16-rc1/tools/testing/radix-tree'
So, add that header to the bunch of others in the tools/
Something like this? (not even compile-tested)
diff --git a/tools/testing/radix-tree/Makefile b/tools/testing/radix-tree/Makefile
index aa6abfe0749c..fa66853416d5 100644
--- a/tools/testing/radix-tree/Makefile
+++ b/tools/testing/radix-tree/Makefile
@@ -40,6 +40,7 @@ $(OFILES): Makefile *.h */*.h generated/map-shift.h \
../../include/asm/*.h \
../../../include/linux/xarray.h \
../../../include/linux/radix-tree.h \
+ ../../../include/linux/math.h \
../../../include/linux/idr.h
radix-tree.c: ../../../lib/radix-tree.c
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v1 1/1] radix-tree: Replace kernel.h with the necessary inclusions
2021-11-17 12:55 ` Andy Shevchenko
@ 2021-12-13 20:44 ` Andy Shevchenko
0 siblings, 0 replies; 3+ messages in thread
From: Andy Shevchenko @ 2021-12-13 20:44 UTC (permalink / raw)
To: Li Wang; +Cc: linux-kernel, Andrew Morton
On Wed, Nov 17, 2021 at 02:55:08PM +0200, Andy Shevchenko wrote:
> On Wed, Nov 17, 2021 at 03:01:12PM +0800, Li Wang wrote:
>
> Thanks for the report! And do not top post next time, please.
>
> > This patch breaks the radix tree test building.
>
> Yes and no. The dirty tricks with kernel headers that tools/ do is what has
> been revealed by this patch.
Should be fixed by Matthew's patch.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-12-13 20:45 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-27 15:05 [PATCH v1 1/1] radix-tree: Replace kernel.h with the necessary inclusions Andy Shevchenko
[not found] ` <CAEemH2edgtA+XOY8WjgwFD-50qcw_MGFSgjjBjgKVi_dAwtR6w@mail.gmail.com>
2021-11-17 12:55 ` Andy Shevchenko
2021-12-13 20:44 ` Andy Shevchenko
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.