Skip to content

Commit c83f020

Browse files
committed
kconfig: remove named choice support
Commit 5a1aa8a ("kconfig: add named choice group") did not provide enough explanation regarding its benefits. A use case was found in another project [1] sometime later, this feature has never been used in the kernel. [1]: https://lore.kernel.org/all/[email protected]/ Signed-off-by: Masahiro Yamada <[email protected]> Reviewed-by: Nicolas Schier <[email protected]>
1 parent bedf923 commit c83f020

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

Diff for: Documentation/kbuild/kconfig-language.rst

+1-5
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ of C0, which doesn't depend on M::
393393

394394
choices::
395395

396-
"choice" [symbol]
396+
"choice"
397397
<choice options>
398398
<choice block>
399399
"endchoice"
@@ -412,10 +412,6 @@ the kernel, but all drivers can be compiled as modules.
412412

413413
A choice accepts another option "optional", which allows to set the
414414
choice to 'n' and no entry needs to be selected.
415-
If no [symbol] is associated with a choice, then you can not have multiple
416-
definitions of that choice. If a [symbol] is associated to the choice,
417-
then you may define the same choice (i.e. with the same entries) in another
418-
place.
419415

420416
comment::
421417

Diff for: scripts/kconfig/parser.y

+3-7
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ struct menu *current_menu, *current_entry;
9494
%type <expr> if_expr
9595
%type <string> end
9696
%type <menu> if_entry menu_entry choice_entry
97-
%type <string> word_opt assign_val
97+
%type <string> assign_val
9898
%type <flavor> assign_op
9999

100100
%destructor {
@@ -222,13 +222,12 @@ config_option: T_MODULES T_EOL
222222

223223
/* choice entry */
224224

225-
choice: T_CHOICE word_opt T_EOL
225+
choice: T_CHOICE T_EOL
226226
{
227-
struct symbol *sym = sym_lookup($2, SYMBOL_CHOICE);
227+
struct symbol *sym = sym_lookup(NULL, SYMBOL_CHOICE);
228228
sym->flags |= SYMBOL_NO_WRITE;
229229
menu_add_entry(sym);
230230
menu_add_expr(P_CHOICE, NULL, NULL);
231-
free($2);
232231
printd(DEBUG_PARSE, "%s:%d:choice\n", cur_filename, cur_lineno);
233232
};
234233

@@ -449,9 +448,6 @@ symbol: nonconst_symbol
449448
| T_WORD_QUOTE { $$ = sym_lookup($1, SYMBOL_CONST); free($1); }
450449
;
451450

452-
word_opt: /* empty */ { $$ = NULL; }
453-
| T_WORD
454-
455451
/* assignment statement */
456452

457453
assignment_stmt: T_WORD assign_op assign_val T_EOL { variable_add($1, $3, $2); free($1); free($3); }

0 commit comments

Comments
 (0)