kconfig: header inclusion cleanups
cover kconfig: header inclusion cleanups
Add missing and remove no longer necessary header inclusions.
Boris Kolpackov (2):
kconfig: make lkc.h self-sufficient #include-wise
kconfig: clean up header inclusion
scripts/kconfig/conf.c | 6 +++--- scripts/kconfig/confdata.c | 4 +++- scripts/kconfig/lexer.l | 1 - scripts/kconfig/lkc.h | 4 ++++ scripts/kconfig/symbol.c | 3 ++- 5 files changed, 12 insertions(+), 6 deletions(-)
--
2.29.0
PATCH 1/2 kconfig: make lkc.h self-sufficient #include-wise
--- scripts/kconfig/lkc.h | 4 ++++ 1 file changed, 4 insertions(+)
scripts/kconfig/lkc.h +4 -0
@@ -6,6 +6,10 @@#ifndef LKC_H #define LKC_H +#include <stdio.h> +#include <assert.h> +#include <stdlib.h> +#include "expr.h" #ifdef __cplusplus
Signature · 1 line
2.29.0
PATCH 2/2 kconfig: clean up header inclusion
In reply to Boris Kolpackov- Add missing includes.
- Remove no longer necessary includes.
- Separate non-portable header includes for easier porting.
--- scripts/kconfig/conf.c | 6 +++--- scripts/kconfig/confdata.c | 4 +++- scripts/kconfig/lexer.l | 1 - scripts/kconfig/symbol.c | 3 ++- 4 files changed, 8 insertions(+), 6 deletions(-)
scripts/kconfig/conf.c +3 -3
@@ -9,12 +9,12 @@#include <stdlib.h> #include <string.h> #include <time.h> -#include <unistd.h> #include <getopt.h> -#include <sys/stat.h> -#include <sys/time.h> #include <errno.h> +#include <unistd.h> +#include <sys/time.h> +#include "lkc.h" static void conf (struct menu *menu);
scripts/kconfig/confdata.c +3 -1
@@ -3,7 +3,7 @@* Copyright (C) 2002 Roman Zippel <[email protected]> */ -#include <sys/mman.h> +#include <sys/types.h> #include <sys/stat.h> #include <ctype.h> #include <errno.h>
@@ -14,7 +14,9 @@#include <stdlib.h> #include <string.h> #include <time.h> +#include <unistd.h> +#include <sys/mman.h> #include "lkc.h"
scripts/kconfig/lexer.l +0 -1
@@ -12,7 +12,6 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> -#include <unistd.h> #include "lkc.h" #include "parser.tab.h"
scripts/kconfig/symbol.c +2 -1
@@ -6,8 +6,9 @@#include <ctype.h> #include <stdlib.h> #include <string.h> +#include <sys/types.h> // off_t +#include <regex.h> -#include <sys/utsname.h> #include "lkc.h"
Signature · 1 line
2.29.0
Re: [PATCH 1/2] kconfig: make lkc.h self-sufficient #include-wise
In reply to Boris KolpackovQuoted 22 lines · Boris Kolpackov
Signed-off-by Boris Kolpackov <[email protected]>--- scripts/kconfig/lkc.h | 4 ++++ 1 file changed, 4 insertions(+)scripts/kconfig/lkc.h +4
-1@@ -6,6 +6,10 @@#ifndef LKC_H #define LKC_H +#include <stdio.h> +#include <assert.h> +#include <stdlib.h> +#include "expr.h" #ifdef __cplusplus --
Quoted 2 lines
2.29.0
Applied to linux-kbuild.
Signature · 2 lines
Best Regards Masahiro Yamada
Re: [PATCH 2/2] kconfig: clean up header inclusion
In reply to Boris KolpackovQuoted 4 lines · Boris Kolpackov
- Add missing includes.
- Remove no longer necessary includes.
- Separate non-portable header includes for easier porting.
I think the definition of "non-portable" depends on how far we expand the supported system.
I guess you want to segregate <unistd.h> and <sys/mmap.h> because you do not have them on Windows, correct?
Quoted 82 lines
Signed-off-by Boris Kolpackov <[email protected]>--- scripts/kconfig/conf.c | 6 +++--- scripts/kconfig/confdata.c | 4 +++- scripts/kconfig/lexer.l | 1 - scripts/kconfig/symbol.c | 3 ++- 4 files changed, 8 insertions(+), 6 deletions(-)scripts/kconfig/conf.c +3
-3@@ -9,12 +9,12 @@#include <stdlib.h> #include <string.h> #include <time.h> -#include <unistd.h> #include <getopt.h> -#include <sys/stat.h> -#include <sys/time.h> #include <errno.h> +#include <unistd.h> +#include <sys/time.h> +#include "lkc.h" static void conf (struct menu *menu);scripts/kconfig/confdata.c +3
-1@@ -3,7 +3,7 @@* Copyright (C) 2002 Roman Zippel <[email protected]> */ -#include <sys/mman.h> +#include <sys/types.h> #include <sys/stat.h> #include <ctype.h> #include <errno.h> @@ -14,7 +14,9 @@#include <stdlib.h> #include <string.h> #include <time.h> +#include <unistd.h> +#include <sys/mman.h> #include "lkc.h" scripts/kconfig/lexer.l +0
-1@@ -12,7 +12,6 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> -#include <unistd.h> #include "lkc.h" #include "parser.tab.h"scripts/kconfig/symbol.c +2
-2@@ -6,8 +6,9 @@#include <ctype.h> #include <stdlib.h> #include <string.h> +#include <sys/types.h> // off_t +#include <regex.h> -#include <sys/utsname.h> #include "lkc.h" --2.29.0
Signature · 2 lines
Best Regards Masahiro Yamada
Re: [PATCH 2/2] kconfig: clean up header inclusion
Quoted 7 lines · Masahiro Yamada
Quoted 4 lines · Boris Kolpackov
- Add missing includes.
- Remove no longer necessary includes.
- Separate non-portable header includes for easier porting.
Quoted 5 lines
I think the definition of "non-portable" depends on how far we expand the supported system.
I guess you want to segregate <
unistd.h> and <sys/mmap.h> because you do not have them on Windows, correct?
Correct. I have a set of patches that make kconfig portable to Windows. I assume there is no interest in these patches here so I will be maintaining them out of tree (but let me know if my assumption is wrong and I will happily submit them). Splitting the header inclusions into two blocks make these patches a bit cleaner and more resilient to changes.
Let me know if you would like me to change the patch to (1) clarify the non-portable part or (2) get rid of the split.
Re: [PATCH 2/2] kconfig: clean up header inclusion
Quoted 23 lines · Boris Kolpackov
Quoted 7 lines · Masahiro Yamada
Quoted 4 lines · Boris Kolpackov
- Add missing includes.
- Remove no longer necessary includes.
- Separate non-portable header includes for easier porting.Quoted 5 lines
I think the definition of "non-portable" depends on how far we expand the supported system.
I guess you want to segregate <
unistd.h> and <sys/mmap.h> because you do not have them on Windows, correct?Correct. I have a set of patches that make kconfig portable to Windows. I assume there is no interest in these patches here so I will be maintaining them out of tree (but let me know if my assumption is wrong and I will happily submit them). Splitting the header inclusions into two blocks make these patches a bit cleaner and more resilient to changes.
Quoted 2 lines
Let me know if you would like me to change the patch to (1) clarify the non-portable part or (2) get rid of the split.
If you send v2 with the first two items:
- Add missing includes.
- Remove no longer necessary includes.
I will accept it.
I am not interested in the last one because
running kconfig on Windows
is not officially supported.
Signature · 2 lines
Best Regards Masahiro Yamada
PATCH v2 2/2 kconfig: clean up header inclusion
- Add missing includes.
- Remove no longer necessary includes.
---
v2: Don't re-arrange includes.
scripts/kconfig/conf.c | 1 - scripts/kconfig/confdata.c | 1 + scripts/kconfig/lexer.l | 1 - scripts/kconfig/symbol.c | 2 +- 4 files changed, 2 insertions(+), 3 deletions(-)
scripts/kconfig/conf.c +0 -1
@@ -11,7 +11,6 @@#include <time.h> #include <unistd.h> #include <getopt.h> -#include <sys/stat.h> #include <sys/time.h> #include <errno.h>
scripts/kconfig/confdata.c +1 -0
@@ -5,6 +5,7 @@#include <sys/mman.h> #include <sys/stat.h> +#include <sys/types.h> #include <ctype.h> #include <errno.h> #include <fcntl.h>
scripts/kconfig/lexer.l +0 -1
@@ -12,7 +12,6 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> -#include <unistd.h> #include "lkc.h" #include "parser.tab.h"
scripts/kconfig/symbol.c +1 -1
@@ -3,11 +3,11 @@* Copyright (C) 2002 Roman Zippel <[email protected]> */ +#include <sys/types.h> #include <ctype.h> #include <stdlib.h> #include <string.h> #include <regex.h> -#include <sys/utsname.h> #include "lkc.h"
Signature · 1 line
2.29.0
Re: [PATCH v2 2/2] kconfig: clean up header inclusion
Quoted 4 lines · Boris Kolpackov
- Add missing includes.
- Remove no longer necessary includes.
---
Applied to linux-kbuild. Thanks.
Quoted 64 lines
v2: Don't re-arrange includes.
scripts/kconfig/conf.c | 1 - scripts/kconfig/confdata.c | 1 + scripts/kconfig/lexer.l | 1 - scripts/kconfig/symbol.c | 2 +- 4 files changed, 2 insertions(+), 3 deletions(-)scripts/kconfig/conf.c +0
-1@@ -11,7 +11,6 @@#include <time.h> #include <unistd.h> #include <getopt.h> -#include <sys/stat.h> #include <sys/time.h> #include <errno.h> scripts/kconfig/confdata.c +1
-0@@ -5,6 +5,7 @@#include <sys/mman.h> #include <sys/stat.h> +#include <sys/types.h> #include <ctype.h> #include <errno.h> #include <fcntl.h> scripts/kconfig/lexer.l +0
-1@@ -12,7 +12,6 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> -#include <unistd.h> #include "lkc.h" #include "parser.tab.h"scripts/kconfig/symbol.c +1
-2@@ -3,11 +3,11 @@* Copyright (C) 2002 Roman Zippel <[email protected]> */ +#include <sys/types.h> #include <ctype.h> #include <stdlib.h> #include <string.h> #include <regex.h> -#include <sys/utsname.h> #include "lkc.h" --2.29.0
Signature · 2 lines
Best Regards Masahiro Yamada