Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/66047 )
Change subject: util/kconfig: Uprev to Linux 5.18's kconfig ......................................................................
util/kconfig: Uprev to Linux 5.18's kconfig
Only minor changes in kconfig this time that shouldn't affect us.
TEST=`util/abuild/abuild -C` output (build.h and build.conf) remains the same
Change-Id: I46f43182ce9ec1b6a5923cb77dcd6e335e44c87a Signed-off-by: Patrick Georgi patrick@coreboot.org Reviewed-on: https://review.coreboot.org/c/coreboot/+/66047 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Elyes Haouas ehaouas@noos.fr --- M util/kconfig/confdata.c M util/kconfig/patches/0009-util-kconfig-Allow-emitting-false-booleans-into-kconfig-output.patch 2 files changed, 38 insertions(+), 24 deletions(-)
Approvals: build bot (Jenkins): Verified Elyes Haouas: Looks good to me, approved
diff --git a/util/kconfig/confdata.c b/util/kconfig/confdata.c index 102f716..95fb960 100644 --- a/util/kconfig/confdata.c +++ b/util/kconfig/confdata.c @@ -678,13 +678,6 @@ return out; }
-/* - * Kconfig configuration printer - * - * This printer is used when generating the resulting configuration after - * kconfig invocation and `defconfig' files. Unset symbol might be omitted by - * passing a non-NULL argument to the printer. - */ enum output_n { OUTPUT_N, OUTPUT_N_AS_UNSET, OUTPUT_N_NONE };
static void __print_symbol(FILE *fp, struct symbol *sym, enum output_n output_n, @@ -938,19 +931,20 @@ menu = menu->list; continue; } - if (menu->next) + +end_check: + if (!menu->sym && menu_is_visible(menu) && menu != &rootmenu && + menu->prompt->type == P_MENU) { + fprintf(out, "# end of %s\n", menu_get_prompt(menu)); + need_newline = true; + } + + if (menu->next) { menu = menu->next; - else while ((menu = menu->parent)) { - if (!menu->sym && menu_is_visible(menu) && - menu != &rootmenu) { - str = menu_get_prompt(menu); - fprintf(out, "# end of %s\n", str); - need_newline = true; - } - if (menu->next) { - menu = menu->next; - break; - } + } else { + menu = menu->parent; + if (menu) + goto end_check; } } fclose(out); @@ -1014,6 +1008,7 @@
fprintf(out, "\n$(deps_config): ;\n");
+ fflush(out); ret = ferror(out); /* error check for all fprintf() calls */ fclose(out); if (ret) @@ -1133,6 +1128,7 @@ if (((sym->flags & SYMBOL_WRITE) || (print_negatives && sym->type != S_STRING)) && sym->name) print_symbol(file, sym);
+ fflush(file); /* check possible errors in conf_write_heading() and print_symbol() */ ret = ferror(file); fclose(file); diff --git a/util/kconfig/patches/0009-util-kconfig-Allow-emitting-false-booleans-into-kconfig-output.patch b/util/kconfig/patches/0009-util-kconfig-Allow-emitting-false-booleans-into-kconfig-output.patch index f05c620..70e9d3f 100644 --- a/util/kconfig/patches/0009-util-kconfig-Allow-emitting-false-booleans-into-kconfig-output.patch +++ b/util/kconfig/patches/0009-util-kconfig-Allow-emitting-false-booleans-into-kconfig-output.patch @@ -27,7 +27,7 @@ =================================================================== --- kconfig.orig/confdata.c +++ kconfig/confdata.c -@@ -722,7 +722,12 @@ static void print_symbol_for_dotconfig(F +@@ -715,7 +715,12 @@ static void print_symbol_for_dotconfig(F
static void print_symbol_for_autoconf(FILE *fp, struct symbol *sym) { @@ -41,7 +41,7 @@ }
void print_symbol_for_listconfig(struct symbol *sym) -@@ -747,6 +752,10 @@ static void print_symbol_for_c(FILE *fp, +@@ -740,6 +745,10 @@ static void print_symbol_for_c(FILE *fp, case S_TRISTATE: switch (*val) { case 'n': @@ -52,7 +52,7 @@ return; case 'm': sym_suffix = "_MODULE"; -@@ -758,6 +767,12 @@ static void print_symbol_for_c(FILE *fp, +@@ -751,6 +760,12 @@ static void print_symbol_for_c(FILE *fp, case S_HEX: if (val[0] != '0' || (val[1] != 'x' && val[1] != 'X')) val_prefix = "0x"; @@ -65,7 +65,7 @@ break; case S_STRING: escaped = escape_string_value(val); -@@ -1113,8 +1128,9 @@ static int __conf_write_autoconf(const c +@@ -1108,8 +1123,9 @@ static int __conf_write_autoconf(const c
conf_write_heading(file, comment_style);
@@ -75,4 +75,4 @@ + if (((sym->flags & SYMBOL_WRITE) || (print_negatives && sym->type != S_STRING)) && sym->name) print_symbol(file, sym);
- /* check possible errors in conf_write_heading() and print_symbol() */ + fflush(file);