aboutsummaryrefslogtreecommitdiff
path: root/util/kconfig/conf.c
diff options
context:
space:
mode:
authorPatrick Georgi <pgeorgi@google.com>2022-10-28 01:00:26 +0200
committerPatrick Georgi <patrick@coreboot.org>2022-10-30 08:46:03 +0000
commit7eb03cb6574ed873f59a2c559e5ab079b9256b64 (patch)
tree2e69c522f8e5e87d4a6b8db7211b0c7eb0465b15 /util/kconfig/conf.c
parent4c9b9e9709cef4937d012d6950e5e2932042c587 (diff)
util/kconfig: Uprev to Linux 5.17's kconfig
Another upstream refactoring, another local patch gone! TEST=`util/abuild/abuild -C` output (build.h and build.conf) remains the same Change-Id: I0f99dcbd8ecc7256551f0a6e2c83c060cb1999b6 Signed-off-by: Patrick Georgi <patrick@coreboot.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/66046 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Elyes Haouas <ehaouas@noos.fr>
Diffstat (limited to 'util/kconfig/conf.c')
-rw-r--r--util/kconfig/conf.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/util/kconfig/conf.c b/util/kconfig/conf.c
index 563755988c..e68da2d44f 100644
--- a/util/kconfig/conf.c
+++ b/util/kconfig/conf.c
@@ -37,6 +37,7 @@ enum input_mode {
olddefconfig,
yes2modconfig,
mod2yesconfig,
+ mod2noconfig,
};
static enum input_mode input_mode = oldaskconfig;
static int input_mode_opt;
@@ -165,8 +166,6 @@ enum conf_def_mode {
def_default,
def_yes,
def_mod,
- def_y2m,
- def_m2y,
def_no,
def_random
};
@@ -304,12 +303,10 @@ static bool conf_set_all_new_symbols(enum conf_def_mode mode)
return has_changed;
}
-static void conf_rewrite_mod_or_yes(enum conf_def_mode mode)
+static void conf_rewrite_tristates(tristate old_val, tristate new_val)
{
struct symbol *sym;
int i;
- tristate old_val = (mode == def_y2m) ? yes : mod;
- tristate new_val = (mode == def_y2m) ? mod : yes;
for_all_symbols(i, sym) {
if (sym_get_type(sym) == S_TRISTATE &&
@@ -687,6 +684,7 @@ static const struct option long_opts[] = {
{"olddefconfig", no_argument, &input_mode_opt, olddefconfig},
{"yes2modconfig", no_argument, &input_mode_opt, yes2modconfig},
{"mod2yesconfig", no_argument, &input_mode_opt, mod2yesconfig},
+ {"mod2noconfig", no_argument, &input_mode_opt, mod2noconfig},
{NULL, 0, NULL, 0}
};
@@ -715,6 +713,7 @@ static void conf_usage(const char *progname)
printf(" --randconfig New config with random answer to all options\n");
printf(" --yes2modconfig Change answers from yes to mod if possible\n");
printf(" --mod2yesconfig Change answers from mod to yes if possible\n");
+ printf(" --mod2noconfig Change answers from mod to no if possible\n");
printf(" (If none of the above is given, --oldaskconfig is the default)\n");
}
@@ -791,6 +790,7 @@ int main(int ac, char **av)
case olddefconfig:
case yes2modconfig:
case mod2yesconfig:
+ case mod2noconfig:
conf_read(NULL);
break;
case allnoconfig:
@@ -872,10 +872,13 @@ int main(int ac, char **av)
case savedefconfig:
break;
case yes2modconfig:
- conf_rewrite_mod_or_yes(def_y2m);
+ conf_rewrite_tristates(yes, mod);
break;
case mod2yesconfig:
- conf_rewrite_mod_or_yes(def_m2y);
+ conf_rewrite_tristates(mod, yes);
+ break;
+ case mod2noconfig:
+ conf_rewrite_tristates(mod, no);
break;
case oldaskconfig:
rootEntry = &rootmenu;