From 0d9c0a67b14401344183cc0f8239f8d1851637fd Mon Sep 17 00:00:00 2001 From: Thorsten Blum Date: Thu, 11 Jul 2024 10:43:16 +0200 Subject: [PATCH] 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 Signed-off-by: Masami Hiramatsu (Google) --- lib/bootconfig.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/lib/bootconfig.c b/lib/bootconfig.c index 97f8911ea339..81f29c29f47b 100644 --- a/lib/bootconfig.c +++ b/lib/bootconfig.c @@ -4,8 +4,16 @@ * Masami Hiramatsu */ -#ifdef __KERNEL__ +/* + * NOTE: This is only for tools/bootconfig, because tools/bootconfig will + * run the parser sanity test. + * This does NOT mean lib/bootconfig.c is available in the user space. + * However, if you change this file, please make sure the tools/bootconfig + * has no issue on building and running. + */ #include + +#ifdef __KERNEL__ #include #include #include @@ -24,16 +32,6 @@ const char * __init xbc_get_embedded_bootconfig(size_t *size) return (*size) ? embedded_bootconfig_data : NULL; } #endif - -#else /* !__KERNEL__ */ -/* - * NOTE: This is only for tools/bootconfig, because tools/bootconfig will - * run the parser sanity test. - * This does NOT mean lib/bootconfig.c is available in the user space. - * However, if you change this file, please make sure the tools/bootconfig - * has no issue on building and running. - */ -#include #endif /*