Skip to content

Commit ca4c74b

Browse files
committed
kconfig: remove P_CHOICE property
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 <[email protected]>
1 parent b139b43 commit ca4c74b

File tree

6 files changed

+3
-37
lines changed

6 files changed

+3
-37
lines changed

scripts/kconfig/expr.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,6 @@ enum prop_type {
167167
P_COMMENT, /* text associated with a comment */
168168
P_MENU, /* prompt associated with a menu or menuconfig symbol */
169169
P_DEFAULT, /* default y */
170-
P_CHOICE, /* choice value */
171170
P_SELECT, /* select BAR */
172171
P_IMPLY, /* imply BAR */
173172
P_RANGE, /* range 7..100 (for a symbol) */
@@ -181,7 +180,7 @@ struct property {
181180
struct expr_value visible;
182181
struct expr *expr; /* the optional conditional part of the property */
183182
struct menu *menu; /* the menu the property are associated with
184-
* valid for: P_SELECT, P_RANGE, P_CHOICE,
183+
* valid for: P_SELECT, P_RANGE,
185184
* P_PROMPT, P_DEFAULT, P_MENU, P_COMMENT */
186185
const char *filename; /* what file was this property defined */
187186
int lineno; /* what lineno was this property defined */
@@ -191,7 +190,6 @@ struct property {
191190
for (st = sym->prop; st; st = st->next) \
192191
if (st->type == (tok))
193192
#define for_all_defaults(sym, st) for_all_properties(sym, st, P_DEFAULT)
194-
#define for_all_choices(sym, st) for_all_properties(sym, st, P_CHOICE)
195193
#define for_all_prompts(sym, st) \
196194
for (st = sym->prop; st; st = st->next) \
197195
if (st->text)

scripts/kconfig/lkc_proto.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ bool sym_string_valid(struct symbol *sym, const char *newval);
3434
bool sym_string_within_range(struct symbol *sym, const char *str);
3535
bool sym_set_string_value(struct symbol *sym, const char *newval);
3636
bool sym_is_changeable(struct symbol *sym);
37-
struct property * sym_get_choice_prop(struct symbol *sym);
3837
struct menu *sym_get_choice_menu(struct symbol *sym);
3938
const char * sym_get_string_value(struct symbol *sym);
4039

scripts/kconfig/menu.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ static void _menu_finalize(struct menu *parent, bool inside_choice)
306306
struct menu *menu, *last_menu;
307307
struct symbol *sym;
308308
struct property *prop;
309-
struct expr *parentdep, *basedep, *dep, *dep2, **ep;
309+
struct expr *parentdep, *basedep, *dep, *dep2;
310310

311311
sym = parent->sym;
312312
if (parent->list) {
@@ -490,14 +490,7 @@ static void _menu_finalize(struct menu *parent, bool inside_choice)
490490
for (menu = parent->list; menu; menu = menu->next) {
491491
if (sym && sym_is_choice(sym) &&
492492
menu->sym && !sym_is_choice_value(menu->sym)) {
493-
current_entry = menu;
494493
menu->sym->flags |= SYMBOL_CHOICEVAL;
495-
menu_add_symbol(P_CHOICE, sym, NULL);
496-
prop = sym_get_choice_prop(sym);
497-
for (ep = &prop->expr; *ep; ep = &(*ep)->left.expr)
498-
;
499-
*ep = expr_alloc_one(E_LIST, NULL);
500-
(*ep)->right.sym = menu->sym;
501494
}
502495

503496
/*

scripts/kconfig/parser.y

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,6 @@ choice: T_CHOICE T_EOL
241241
struct symbol *sym = sym_lookup(NULL, 0);
242242

243243
menu_add_entry(sym);
244-
menu_add_expr(P_CHOICE, NULL, NULL);
245244
menu_set_type(S_BOOLEAN);
246245
INIT_LIST_HEAD(&current_entry->choice_members);
247246

@@ -696,9 +695,6 @@ static void print_symbol(FILE *out, struct menu *menu)
696695
}
697696
fputc('\n', out);
698697
break;
699-
case P_CHOICE:
700-
fputs(" #choice value\n", out);
701-
break;
702698
case P_SELECT:
703699
fputs( " select ", out);
704700
expr_fprint(prop->expr, out);

scripts/kconfig/qconf.cc

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1101,14 +1101,6 @@ QString ConfigInfoView::debug_info(struct symbol *sym)
11011101
&stream, E_NONE);
11021102
stream << "<br>";
11031103
break;
1104-
case P_CHOICE:
1105-
if (sym_is_choice(sym)) {
1106-
stream << "choice: ";
1107-
expr_print(prop->expr, expr_print_help,
1108-
&stream, E_NONE);
1109-
stream << "<br>";
1110-
}
1111-
break;
11121104
default:
11131105
stream << "unknown property: ";
11141106
stream << prop_get_type_name(prop->type);

scripts/kconfig/symbol.c

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,6 @@ const char *sym_type_name(enum symbol_type type)
6868
return "???";
6969
}
7070

71-
struct property *sym_get_choice_prop(struct symbol *sym)
72-
{
73-
struct property *prop;
74-
75-
for_all_choices(sym, prop)
76-
return prop;
77-
return NULL;
78-
}
79-
8071
/**
8172
* sym_get_choice_menu - get the parent choice menu if present
8273
*
@@ -1225,8 +1216,7 @@ static struct symbol *sym_check_sym_deps(struct symbol *sym)
12251216
stack.expr = NULL;
12261217

12271218
for (prop = sym->prop; prop; prop = prop->next) {
1228-
if (prop->type == P_CHOICE || prop->type == P_SELECT ||
1229-
prop->type == P_IMPLY)
1219+
if (prop->type == P_SELECT || prop->type == P_IMPLY)
12301220
continue;
12311221
stack.prop = prop;
12321222
sym2 = sym_check_expr_deps(prop->visible.expr);
@@ -1343,8 +1333,6 @@ const char *prop_get_type_name(enum prop_type type)
13431333
return "menu";
13441334
case P_DEFAULT:
13451335
return "default";
1346-
case P_CHOICE:
1347-
return "choice";
13481336
case P_SELECT:
13491337
return "select";
13501338
case P_IMPLY:

0 commit comments

Comments
 (0)