Patrick Georgi has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/80263?usp=email )
Change subject: util/kconfig: Uprev to Linux 6.7's kconfig ......................................................................
util/kconfig: Uprev to Linux 6.7's kconfig
Just a memory leak fix in Linux 6.7.
Change-Id: I1ff302dafa01e78429a30ff18e21ffe0b45ce46e Signed-off-by: Patrick Georgi patrick@coreboot.org --- M util/kconfig/patches/0007-kconfig-Allow-KCONFIG_STRICT-outside-of-confdata.c.patch M util/kconfig/patches/0008-kconfig-Add-wildcard-support-for-source.patch M util/kconfig/symbol.c 3 files changed, 21 insertions(+), 23 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/63/80263/1
diff --git a/util/kconfig/patches/0007-kconfig-Allow-KCONFIG_STRICT-outside-of-confdata.c.patch b/util/kconfig/patches/0007-kconfig-Allow-KCONFIG_STRICT-outside-of-confdata.c.patch index f98729e..a9f3218 100644 --- a/util/kconfig/patches/0007-kconfig-Allow-KCONFIG_STRICT-outside-of-confdata.c.patch +++ b/util/kconfig/patches/0007-kconfig-Allow-KCONFIG_STRICT-outside-of-confdata.c.patch @@ -26,43 +26,43 @@ --- kconfig.orig/symbol.c +++ kconfig/symbol.c @@ -37,6 +37,7 @@ static struct symbol symbol_empty = { - + struct symbol *modules_sym; static tristate modules_val; +static int sym_warnings; - + enum symbol_type sym_get_type(struct symbol *sym) { -@@ -319,12 +320,14 @@ static void sym_warn_unmet_dep(struct sy +@@ -317,12 +318,14 @@ static void sym_warn_unmet_dep(struct sy " Selected by [m]:\n"); - + fputs(str_get(&gs), stderr); + sym_warnings++; } - + void sym_calc_value(struct symbol *sym) { struct symbol_value newval, oldval; struct property *prop; + const char *werror; struct expr *e; - + if (!sym) -@@ -340,8 +343,9 @@ void sym_calc_value(struct symbol *sym) +@@ -338,8 +341,9 @@ void sym_calc_value(struct symbol *sym) sym_calc_value(prop_get_symbol(prop)); } - + + werror = getenv("KCONFIG_WERROR"); + sym_warnings = 0; sym->flags |= SYMBOL_VALID; - oldval = sym->curr; - + switch (sym->type) { -@@ -432,6 +436,9 @@ void sym_calc_value(struct symbol *sym) +@@ -430,6 +434,9 @@ void sym_calc_value(struct symbol *sym) ; } - + + if (sym_warnings && werror) + exit(1); + diff --git a/util/kconfig/patches/0008-kconfig-Add-wildcard-support-for-source.patch b/util/kconfig/patches/0008-kconfig-Add-wildcard-support-for-source.patch index b476bc1..2e6a24f 100644 --- a/util/kconfig/patches/0008-kconfig-Add-wildcard-support-for-source.patch +++ b/util/kconfig/patches/0008-kconfig-Add-wildcard-support-for-source.patch @@ -28,7 +28,7 @@ +++ kconfig/lexer.l @@ -8,6 +8,7 @@ %{ - + #include <assert.h> +#include <glob.h> #include <limits.h> @@ -37,7 +37,7 @@ @@ -439,6 +440,32 @@ void zconf_nextfile(const char *name) current_file = file; } - + +void zconf_nextfiles(const char *wildcard) +{ + glob_t g; @@ -78,7 +78,7 @@ +void zconf_nextfiles(const char *name); int zconf_lineno(void); const char *zconf_curname(void); - + Index: kconfig/parser.y =================================================================== --- kconfig.orig/parser.y @@ -91,4 +91,4 @@ + zconf_nextfiles($2); free($2); }; - + diff --git a/util/kconfig/symbol.c b/util/kconfig/symbol.c index a50f131..34fc66e 100644 --- a/util/kconfig/symbol.c +++ b/util/kconfig/symbol.c @@ -123,9 +123,9 @@ static void sym_validate_range(struct symbol *sym) { struct property *prop; + struct symbol *range_sym; int base; long long val, val2; - char str[64];
switch (sym->type) { case S_INT: @@ -141,17 +141,15 @@ if (!prop) return; val = strtoll(sym->curr.val, NULL, base); - val2 = sym_get_range_val(prop->expr->left.sym, base); + range_sym = prop->expr->left.sym; + val2 = sym_get_range_val(range_sym, base); if (val >= val2) { - val2 = sym_get_range_val(prop->expr->right.sym, base); + range_sym = prop->expr->right.sym; + val2 = sym_get_range_val(range_sym, base); if (val <= val2) return; } - if (sym->type == S_INT) - sprintf(str, "%lld", val2); - else - sprintf(str, "0x%llx", val2); - sym->curr.val = xstrdup(str); + sym->curr.val = range_sym->curr.val; }
static void sym_set_changed(struct symbol *sym)