Skip to content

Commit fbaf242

Browse files
committed
kbuild: move some helper headers from scripts/kconfig/ to scripts/include/
Move array_size.h, hashtable.h, list.h, list_types.h from scripts/kconfig/ to scripts/include/. These headers will be useful for other host programs. Remove scripts/mod/list.h. Signed-off-by: Masahiro Yamada <[email protected]>
1 parent 6e6ef2d commit fbaf242

File tree

18 files changed

+19
-226
lines changed

18 files changed

+19
-226
lines changed

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11943,6 +11943,7 @@ F: scripts/Makefile*
1194311943
F: scripts/basic/
1194411944
F: scripts/clang-tools/
1194511945
F: scripts/dummy-tools/
11946+
F: scripts/include/
1194611947
F: scripts/mk*
1194711948
F: scripts/mod/
1194811949
F: scripts/package/

Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -458,8 +458,10 @@ export rust_common_flags := --edition=2021 \
458458
-Dclippy::no_mangle_with_rust_abi \
459459
-Wclippy::dbg_macro
460460

461-
KBUILD_HOSTCFLAGS := $(KBUILD_USERHOSTCFLAGS) $(HOST_LFS_CFLAGS) $(HOSTCFLAGS)
462-
KBUILD_HOSTCXXFLAGS := -Wall -O2 $(HOST_LFS_CFLAGS) $(HOSTCXXFLAGS)
461+
KBUILD_HOSTCFLAGS := $(KBUILD_USERHOSTCFLAGS) $(HOST_LFS_CFLAGS) \
462+
$(HOSTCFLAGS) -I $(srctree)/scripts/include
463+
KBUILD_HOSTCXXFLAGS := -Wall -O2 $(HOST_LFS_CFLAGS) $(HOSTCXXFLAGS) \
464+
-I $(srctree)/scripts/include
463465
KBUILD_HOSTRUSTFLAGS := $(rust_common_flags) -O -Cstrip=debuginfo \
464466
-Zallow-features= $(HOSTRUSTFLAGS)
465467
KBUILD_HOSTLDFLAGS := $(HOST_LFS_LDFLAGS) $(HOSTLDFLAGS)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

scripts/kconfig/expr.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,11 @@ extern "C" {
1212

1313
#include <assert.h>
1414
#include <stdio.h>
15-
#include "list_types.h"
1615
#ifndef __cplusplus
1716
#include <stdbool.h>
1817
#endif
1918

20-
#include "list_types.h"
19+
#include <list_types.h>
2120

2221
typedef enum tristate {
2322
no, mod, yes

scripts/kconfig/internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#ifndef INTERNAL_H
33
#define INTERNAL_H
44

5-
#include "hashtable.h"
5+
#include <hashtable.h>
66

77
#define SYMBOL_HASHSIZE (1U << 14)
88

scripts/kconfig/mconf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#include <signal.h>
2020
#include <unistd.h>
2121

22-
#include "list.h"
22+
#include <list.h>
2323
#include "lkc.h"
2424
#include "lxdialog/dialog.h"
2525
#include "mnconf-common.h"

scripts/kconfig/menu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
#include <stdlib.h>
99
#include <string.h>
1010

11+
#include <list.h>
1112
#include "lkc.h"
1213
#include "internal.h"
13-
#include "list.h"
1414

1515
static const char nohelp_text[] = "There is no help available for this option.";
1616

scripts/kconfig/mnconf-common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0-only
2+
#include <list.h>
23
#include "expr.h"
3-
#include "list.h"
44
#include "mnconf-common.h"
55

66
int jump_key_char;

scripts/kconfig/mnconf-common.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
#include <stddef.h>
66

7+
#include <list_types.h>
8+
79
struct search_data {
810
struct list_head *head;
911
struct menu *target;

scripts/kconfig/nconf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#include <strings.h>
1212
#include <stdlib.h>
1313

14-
#include "list.h"
14+
#include <list.h>
1515
#include "lkc.h"
1616
#include "mnconf-common.h"
1717
#include "nconf.h"

scripts/kconfig/preprocess.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
#include <stdlib.h>
1010
#include <string.h>
1111

12-
#include "array_size.h"
12+
#include <array_size.h>
13+
#include <list.h>
1314
#include "internal.h"
14-
#include "list.h"
1515
#include "lkc.h"
1616
#include "preprocess.h"
1717

scripts/kconfig/util.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#include <stdlib.h>
99
#include <string.h>
1010

11-
#include "hashtable.h"
11+
#include <hashtable.h>
1212
#include "lkc.h"
1313

1414
unsigned int strhash(const char *s)

scripts/mod/list.h

Lines changed: 0 additions & 213 deletions
This file was deleted.

scripts/mod/modpost.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
#include <limits.h>
2121
#include <stdbool.h>
2222
#include <errno.h>
23+
24+
#include <list.h>
2325
#include "modpost.h"
2426
#include "../../include/linux/license.h"
2527

scripts/mod/modpost.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#include <elf.h>
1414
#include "../../include/linux/module_symbol.h"
1515

16-
#include "list.h"
16+
#include <list_types.h>
1717
#include "elfconfig.h"
1818

1919
/* On BSD-alike OSes elf.h defines these according to host's word size */

0 commit comments

Comments
 (0)