kconfig: remove P_CHOICE property
authorMasahiro Yamada <masahiroy@kernel.org>
Tue, 18 Jun 2024 10:35:30 +0000 (19:35 +0900)
committerMasahiro Yamada <masahiroy@kernel.org>
Mon, 15 Jul 2024 16:08:37 +0000 (01:08 +0900)
P_CHOICE is a pseudo property used to link a choice with its members.

There is no more code relying on this, except for some debug code.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
scripts/kconfig/expr.h
scripts/kconfig/lkc_proto.h
scripts/kconfig/menu.c
scripts/kconfig/parser.y
scripts/kconfig/qconf.cc
scripts/kconfig/symbol.c

index 1d1c4442c941eb83a85762986824d05ba5c007bc..58fd4c8c3762bbd3198420dff490f4e1e33368de 100644 (file)
@@ -167,7 +167,6 @@ enum prop_type {
        P_COMMENT,  /* text associated with a comment */
        P_MENU,     /* prompt associated with a menu or menuconfig symbol */
        P_DEFAULT,  /* default y */
-       P_CHOICE,   /* choice value */
        P_SELECT,   /* select BAR */
        P_IMPLY,    /* imply BAR */
        P_RANGE,    /* range 7..100 (for a symbol) */
@@ -181,7 +180,7 @@ struct property {
        struct expr_value visible;
        struct expr *expr;         /* the optional conditional part of the property */
        struct menu *menu;         /* the menu the property are associated with
-                                   * valid for: P_SELECT, P_RANGE, P_CHOICE,
+                                   * valid for: P_SELECT, P_RANGE,
                                    * P_PROMPT, P_DEFAULT, P_MENU, P_COMMENT */
        const char *filename;      /* what file was this property defined */
        int lineno;                /* what lineno was this property defined */
@@ -191,7 +190,6 @@ struct property {
        for (st = sym->prop; st; st = st->next) \
                if (st->type == (tok))
 #define for_all_defaults(sym, st) for_all_properties(sym, st, P_DEFAULT)
-#define for_all_choices(sym, st) for_all_properties(sym, st, P_CHOICE)
 #define for_all_prompts(sym, st) \
        for (st = sym->prop; st; st = st->next) \
                if (st->text)
index 1221709efac17f8f335793c124f54c9ed02681f8..49cc649d28106ee4d3823895fae80eb2302702a2 100644 (file)
@@ -34,7 +34,6 @@ bool sym_string_valid(struct symbol *sym, const char *newval);
 bool sym_string_within_range(struct symbol *sym, const char *str);
 bool sym_set_string_value(struct symbol *sym, const char *newval);
 bool sym_is_changeable(struct symbol *sym);
-struct property * sym_get_choice_prop(struct symbol *sym);
 struct menu *sym_get_choice_menu(struct symbol *sym);
 const char * sym_get_string_value(struct symbol *sym);
 
index 170a269a8d7c7e3ba3e128091ecc2e3ac4392a5b..23c95e54660dbb8e76e0762fbe3d9e9209db4dc9 100644 (file)
@@ -306,7 +306,7 @@ static void _menu_finalize(struct menu *parent, bool inside_choice)
        struct menu *menu, *last_menu;
        struct symbol *sym;
        struct property *prop;
-       struct expr *parentdep, *basedep, *dep, *dep2, **ep;
+       struct expr *parentdep, *basedep, *dep, *dep2;
 
        sym = parent->sym;
        if (parent->list) {
@@ -490,14 +490,7 @@ static void _menu_finalize(struct menu *parent, bool inside_choice)
        for (menu = parent->list; menu; menu = menu->next) {
                if (sym && sym_is_choice(sym) &&
                    menu->sym && !sym_is_choice_value(menu->sym)) {
-                       current_entry = menu;
                        menu->sym->flags |= SYMBOL_CHOICEVAL;
-                       menu_add_symbol(P_CHOICE, sym, NULL);
-                       prop = sym_get_choice_prop(sym);
-                       for (ep = &prop->expr; *ep; ep = &(*ep)->left.expr)
-                               ;
-                       *ep = expr_alloc_one(E_LIST, NULL);
-                       (*ep)->right.sym = menu->sym;
                }
 
                /*
index 9d58544b0255d9c424d5c9772510a1094dfe18b1..745c82ee15d0da2fd7d80bdd64be6a5cfda556e0 100644 (file)
@@ -241,7 +241,6 @@ choice: T_CHOICE T_EOL
        struct symbol *sym = sym_lookup(NULL, 0);
 
        menu_add_entry(sym);
-       menu_add_expr(P_CHOICE, NULL, NULL);
        menu_set_type(S_BOOLEAN);
        INIT_LIST_HEAD(&current_entry->choice_members);
 
@@ -696,9 +695,6 @@ static void print_symbol(FILE *out, struct menu *menu)
                        }
                        fputc('\n', out);
                        break;
-               case P_CHOICE:
-                       fputs("  #choice value\n", out);
-                       break;
                case P_SELECT:
                        fputs( "  select ", out);
                        expr_fprint(prop->expr, out);
index 30346e294d1a6a46cfb3b289e7cedfe413f74fb2..7d239c032b3d67bd96b7e8ccb057bb02f34db58c 100644 (file)
@@ -1101,14 +1101,6 @@ QString ConfigInfoView::debug_info(struct symbol *sym)
                                   &stream, E_NONE);
                        stream << "<br>";
                        break;
-               case P_CHOICE:
-                       if (sym_is_choice(sym)) {
-                               stream << "choice: ";
-                               expr_print(prop->expr, expr_print_help,
-                                          &stream, E_NONE);
-                               stream << "<br>";
-                       }
-                       break;
                default:
                        stream << "unknown property: ";
                        stream << prop_get_type_name(prop->type);
index b50911bcb08d28479d75c4465f87abf489bd1b0d..cf682a8a3f1ebf8b616133d7c73e25d100dff18a 100644 (file)
@@ -68,15 +68,6 @@ const char *sym_type_name(enum symbol_type type)
        return "???";
 }
 
-struct property *sym_get_choice_prop(struct symbol *sym)
-{
-       struct property *prop;
-
-       for_all_choices(sym, prop)
-               return prop;
-       return NULL;
-}
-
 /**
  * sym_get_choice_menu - get the parent choice menu if present
  *
@@ -1225,8 +1216,7 @@ static struct symbol *sym_check_sym_deps(struct symbol *sym)
        stack.expr = NULL;
 
        for (prop = sym->prop; prop; prop = prop->next) {
-               if (prop->type == P_CHOICE || prop->type == P_SELECT ||
-                   prop->type == P_IMPLY)
+               if (prop->type == P_SELECT || prop->type == P_IMPLY)
                        continue;
                stack.prop = prop;
                sym2 = sym_check_expr_deps(prop->visible.expr);
@@ -1343,8 +1333,6 @@ const char *prop_get_type_name(enum prop_type type)
                return "menu";
        case P_DEFAULT:
                return "default";
-       case P_CHOICE:
-               return "choice";
        case P_SELECT:
                return "select";
        case P_IMPLY:
This page took 0.084513 seconds and 4 git commands to generate.