[PATCH 8/8] include: list: replace full kernel.h inclusion with smaller container_of.h

Ahmad Fatoum a.fatoum at pengutronix.de
Tue Jul 16 04:58:34 PDT 2024


<linux/kernel.h> defines a lot of things that go beyond what's needed for
<linux/list.h>. The only thing actually needed for the list
implementation is <linux/container_of.h>, so include that directly.

This is also what Linux has been doing for a while.

Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
 include/linux/list.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/list.h b/include/linux/list.h
index e47a8188e807..e28f54a0d413 100644
--- a/include/linux/list.h
+++ b/include/linux/list.h
@@ -2,11 +2,11 @@
 #ifndef _LINUX_LIST_H
 #define _LINUX_LIST_H
 
+#include <linux/container_of.h>
 #include <linux/types.h>
 #include <linux/stddef.h>
 #include <linux/poison.h>
 #include <linux/const.h>
-#include <linux/kernel.h>
 
 /*
  * Simple doubly linked list implementation.
-- 
2.39.2




More information about the barebox mailing list