Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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/20240711084315.1507-1-thorsten.blum@toblux.com/

Signed-off-by: Thorsten Blum <thorsten.blum@toblux.com>
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>

authored by

Thorsten Blum and committed by
Masami Hiramatsu (Google)
0d9c0a67 256abd8e

+9 -11
+9 -11
lib/bootconfig.c
··· 4 4 * Masami Hiramatsu <mhiramat@kernel.org> 5 5 */ 6 6 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 + */ 8 14 #include <linux/bootconfig.h> 15 + 16 + #ifdef __KERNEL__ 9 17 #include <linux/bug.h> 10 18 #include <linux/ctype.h> 11 19 #include <linux/errno.h> ··· 32 24 return (*size) ? embedded_bootconfig_data : NULL; 33 25 } 34 26 #endif 35 - 36 - #else /* !__KERNEL__ */ 37 - /* 38 - * NOTE: This is only for tools/bootconfig, because tools/bootconfig will 39 - * run the parser sanity test. 40 - * This does NOT mean lib/bootconfig.c is available in the user space. 41 - * However, if you change this file, please make sure the tools/bootconfig 42 - * has no issue on building and running. 43 - */ 44 - #include <linux/bootconfig.h> 45 27 #endif 46 28 47 29 /*