Skip to content

Commit

Permalink
kconfig: remove named choice support
Browse files Browse the repository at this point in the history
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/201012150034.01356.yann.morin.1998@anciens.enib.fr/

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>
  • Loading branch information
Masahiro Yamada committed Mar 10, 2024
1 parent bedf923 commit c83f020
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
6 changes: 1 addition & 5 deletions Documentation/kbuild/kconfig-language.rst
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ of C0, which doesn't depend on M::

choices::

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

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

comment::

Expand Down
10 changes: 3 additions & 7 deletions scripts/kconfig/parser.y
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ struct menu *current_menu, *current_entry;
%type <expr> if_expr
%type <string> end
%type <menu> if_entry menu_entry choice_entry
%type <string> word_opt assign_val
%type <string> assign_val
%type <flavor> assign_op

%destructor {
Expand Down Expand Up @@ -222,13 +222,12 @@ config_option: T_MODULES T_EOL

/* choice entry */

choice: T_CHOICE word_opt T_EOL
choice: T_CHOICE T_EOL
{
struct symbol *sym = sym_lookup($2, SYMBOL_CHOICE);
struct symbol *sym = sym_lookup(NULL, SYMBOL_CHOICE);
sym->flags |= SYMBOL_NO_WRITE;
menu_add_entry(sym);
menu_add_expr(P_CHOICE, NULL, NULL);
free($2);
printd(DEBUG_PARSE, "%s:%d:choice\n", cur_filename, cur_lineno);
};

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

word_opt: /* empty */ { $$ = NULL; }
| T_WORD

/* assignment statement */

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

0 comments on commit c83f020

Please sign in to comment.