summaryrefslogtreecommitdiffstats
path: root/scripts/kconfig
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2024-02-03 00:58:17 +0900
committerMasahiro Yamada <masahiroy@kernel.org>2024-02-19 18:20:41 +0900
commit4dae9cf5cbb863c7ca23899446885dbc457f81ae (patch)
tree5aeb760348fa8b30930ca419a9a5d0007c2f122f /scripts/kconfig
parent5b058034e3aa600802ab609e8264dc2ca1300ebe (diff)
downloadlinux-stable-4dae9cf5cbb863c7ca23899446885dbc457f81ae.tar.gz
linux-stable-4dae9cf5cbb863c7ca23899446885dbc457f81ae.tar.bz2
linux-stable-4dae9cf5cbb863c7ca23899446885dbc457f81ae.zip
kconfig: split list_head into a separate header
The struct list_head is often embedded in other structures, while other code is used in C functions. By separating struct list_head into its own header, other headers are no longer required to include the entire list.h. This is similar to the kernel space, where struct list_head is defined in <linux/types.h> instead of <linux/list.h>. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Diffstat (limited to 'scripts/kconfig')
-rw-r--r--scripts/kconfig/expr.h2
-rw-r--r--scripts/kconfig/list.h8
-rw-r--r--scripts/kconfig/list_types.h9
-rw-r--r--scripts/kconfig/mconf.c1
-rw-r--r--scripts/kconfig/menu.c1
-rw-r--r--scripts/kconfig/nconf.c1
6 files changed, 15 insertions, 7 deletions
diff --git a/scripts/kconfig/expr.h b/scripts/kconfig/expr.h
index d667f9aa041e..dd3350aed302 100644
--- a/scripts/kconfig/expr.h
+++ b/scripts/kconfig/expr.h
@@ -12,7 +12,7 @@ extern "C" {
#include <assert.h>
#include <stdio.h>
-#include "list.h"
+#include "list_types.h"
#ifndef __cplusplus
#include <stdbool.h>
#endif
diff --git a/scripts/kconfig/list.h b/scripts/kconfig/list.h
index 45cb237ab7ef..babed0baf4ae 100644
--- a/scripts/kconfig/list.h
+++ b/scripts/kconfig/list.h
@@ -2,6 +2,8 @@
#ifndef LIST_H
#define LIST_H
+#include "list_types.h"
+
/*
* Copied from include/linux/...
*/
@@ -20,12 +22,6 @@
const typeof( ((type *)0)->member ) *__mptr = (ptr); \
(type *)( (char *)__mptr - offsetof(type,member) );})
-
-struct list_head {
- struct list_head *next, *prev;
-};
-
-
#define LIST_HEAD_INIT(name) { &(name), &(name) }
#define LIST_HEAD(name) \
diff --git a/scripts/kconfig/list_types.h b/scripts/kconfig/list_types.h
new file mode 100644
index 000000000000..32899f424983
--- /dev/null
+++ b/scripts/kconfig/list_types.h
@@ -0,0 +1,9 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef LIST_TYPES_H
+#define LIST_TYPES_H
+
+struct list_head {
+ struct list_head *next, *prev;
+};
+
+#endif /* LIST_TYPES_H */
diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c
index 5df32148a869..f4bb391d50cf 100644
--- a/scripts/kconfig/mconf.c
+++ b/scripts/kconfig/mconf.c
@@ -19,6 +19,7 @@
#include <signal.h>
#include <unistd.h>
+#include "list.h"
#include "lkc.h"
#include "lxdialog/dialog.h"
#include "mnconf-common.h"
diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c
index f701382f8a69..696803d944e0 100644
--- a/scripts/kconfig/menu.c
+++ b/scripts/kconfig/menu.c
@@ -10,6 +10,7 @@
#include "lkc.h"
#include "internal.h"
+#include "list.h"
static const char nohelp_text[] = "There is no help available for this option.";
diff --git a/scripts/kconfig/nconf.c b/scripts/kconfig/nconf.c
index 1148163cfa7e..9d22b0f3197b 100644
--- a/scripts/kconfig/nconf.c
+++ b/scripts/kconfig/nconf.c
@@ -11,6 +11,7 @@
#include <strings.h>
#include <stdlib.h>
+#include "list.h"
#include "lkc.h"
#include "mnconf-common.h"
#include "nconf.h"