Skip to content

Commit 0d9c0a6

Browse files
tobluxmhiramat
authored andcommitted
bootconfig: Remove duplicate included header file linux/bootconfig.h
The header file linux/bootconfig.h is included whether __KERNEL__ is defined or not. Include it only once before the #ifdef/#else/#endif preprocessor directives and remove the following make includecheck warning: linux/bootconfig.h is included more than once Move the comment to the top and delete the now empty #else block. Link: https://lore.kernel.org/all/[email protected]/ Signed-off-by: Thorsten Blum <[email protected]> Signed-off-by: Masami Hiramatsu (Google) <[email protected]>
1 parent 256abd8 commit 0d9c0a6

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

lib/bootconfig.c

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,16 @@
44
* Masami Hiramatsu <[email protected]>
55
*/
66

7-
#ifdef __KERNEL__
7+
/*
8+
* NOTE: This is only for tools/bootconfig, because tools/bootconfig will
9+
* run the parser sanity test.
10+
* This does NOT mean lib/bootconfig.c is available in the user space.
11+
* However, if you change this file, please make sure the tools/bootconfig
12+
* has no issue on building and running.
13+
*/
814
#include <linux/bootconfig.h>
15+
16+
#ifdef __KERNEL__
917
#include <linux/bug.h>
1018
#include <linux/ctype.h>
1119
#include <linux/errno.h>
@@ -24,16 +32,6 @@ const char * __init xbc_get_embedded_bootconfig(size_t *size)
2432
return (*size) ? embedded_bootconfig_data : NULL;
2533
}
2634
#endif
27-
28-
#else /* !__KERNEL__ */
29-
/*
30-
* NOTE: This is only for tools/bootconfig, because tools/bootconfig will
31-
* run the parser sanity test.
32-
* This does NOT mean lib/bootconfig.c is available in the user space.
33-
* However, if you change this file, please make sure the tools/bootconfig
34-
* has no issue on building and running.
35-
*/
36-
#include <linux/bootconfig.h>
3735
#endif
3836

3937
/*

0 commit comments

Comments
 (0)