util/kconfig: Uprev to Linux 6.8's kconfig
Linux kconfig has its own implementation of KCONFIG_WERROR now, so use that. This reduces our patch count by 2. Change-Id: I4f5f1f552e96f8ef7a4c5c0ab2ab7e2b6d798ceb Signed-off-by: Patrick Georgi <patrick@georgi.software> Reviewed-on: https://review.coreboot.org/c/coreboot/+/81223 Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
committed by
Felix Held
parent
96499840aa
commit
7761237dfe
@@ -29,12 +29,6 @@ struct symbol symbol_no = {
|
||||
.flags = SYMBOL_CONST|SYMBOL_VALID,
|
||||
};
|
||||
|
||||
static struct symbol symbol_empty = {
|
||||
.name = "",
|
||||
.curr = { "", no },
|
||||
.flags = SYMBOL_VALID,
|
||||
};
|
||||
|
||||
struct symbol *modules_sym;
|
||||
static tristate modules_val;
|
||||
static int sym_warnings;
|
||||
@@ -321,11 +315,17 @@ static void sym_warn_unmet_dep(struct symbol *sym)
|
||||
sym_warnings++;
|
||||
}
|
||||
|
||||
bool sym_dep_errors(void)
|
||||
{
|
||||
if (sym_warnings)
|
||||
return getenv("KCONFIG_WERROR");
|
||||
return false;
|
||||
}
|
||||
|
||||
void sym_calc_value(struct symbol *sym)
|
||||
{
|
||||
struct symbol_value newval, oldval;
|
||||
struct property *prop;
|
||||
const char *werror;
|
||||
struct expr *e;
|
||||
|
||||
if (!sym)
|
||||
@@ -341,20 +341,25 @@ 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;
|
||||
|
||||
newval.tri = no;
|
||||
|
||||
switch (sym->type) {
|
||||
case S_INT:
|
||||
newval.val = "0";
|
||||
break;
|
||||
case S_HEX:
|
||||
newval.val = "0x0";
|
||||
break;
|
||||
case S_STRING:
|
||||
newval = symbol_empty.curr;
|
||||
newval.val = "";
|
||||
break;
|
||||
case S_BOOLEAN:
|
||||
case S_TRISTATE:
|
||||
newval = symbol_no.curr;
|
||||
newval.val = "n";
|
||||
break;
|
||||
default:
|
||||
sym->curr.val = sym->name;
|
||||
@@ -434,9 +439,6 @@ void sym_calc_value(struct symbol *sym)
|
||||
;
|
||||
}
|
||||
|
||||
if (sym_warnings && werror)
|
||||
exit(1);
|
||||
|
||||
sym->curr = newval;
|
||||
if (sym_is_choice(sym) && newval.tri == yes)
|
||||
sym->curr.val = sym_calc_choice(sym);
|
||||
@@ -704,13 +706,12 @@ const char *sym_get_string_default(struct symbol *sym)
|
||||
{
|
||||
struct property *prop;
|
||||
struct symbol *ds;
|
||||
const char *str;
|
||||
const char *str = "";
|
||||
tristate val;
|
||||
|
||||
sym_calc_visibility(sym);
|
||||
sym_calc_value(modules_sym);
|
||||
val = symbol_no.curr.tri;
|
||||
str = symbol_empty.curr.val;
|
||||
|
||||
/* If symbol has a default value look it up */
|
||||
prop = sym_get_default_prop(sym);
|
||||
@@ -760,14 +761,17 @@ const char *sym_get_string_default(struct symbol *sym)
|
||||
case yes: return "y";
|
||||
}
|
||||
case S_INT:
|
||||
if (!str[0])
|
||||
str = "0";
|
||||
break;
|
||||
case S_HEX:
|
||||
return str;
|
||||
case S_STRING:
|
||||
return str;
|
||||
case S_UNKNOWN:
|
||||
if (!str[0])
|
||||
str = "0x0";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return "";
|
||||
return str;
|
||||
}
|
||||
|
||||
const char *sym_get_string_value(struct symbol *sym)
|
||||
|
Reference in New Issue
Block a user