Skip to content

Commit fb8dd48

Browse files
committed
kconfig: use sym_get_choice_menu() in conf_write_defconfig()
Choices and their members are associated via the P_CHOICE property. Currently, prop_get_symbol(sym_get_choice_prop()) is used to obtain the choice of the given choice member. Replace it with sym_get_choice_menu(), which retrieves the choice without relying on P_CHOICE. Signed-off-by: Masahiro Yamada <[email protected]>
1 parent 7bcf2e0 commit fb8dd48

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

scripts/kconfig/confdata.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -794,6 +794,8 @@ int conf_write_defconfig(const char *filename)
794794
sym_clear_all_valid();
795795

796796
menu_for_each_entry(menu) {
797+
struct menu *choice;
798+
797799
sym = menu->sym;
798800
if (sym && !sym_is_choice(sym)) {
799801
sym_calc_value(sym);
@@ -811,12 +813,11 @@ int conf_write_defconfig(const char *filename)
811813
* If symbol is a choice value and equals to the
812814
* default for a choice - skip.
813815
*/
814-
if (sym_is_choice_value(sym)) {
815-
struct symbol *cs;
816+
choice = sym_get_choice_menu(sym);
817+
if (choice) {
816818
struct symbol *ds;
817819

818-
cs = prop_get_symbol(sym_get_choice_prop(sym));
819-
ds = sym_choice_default(cs);
820+
ds = sym_choice_default(choice->sym);
820821
if (sym == ds) {
821822
if ((sym->type == S_BOOLEAN) &&
822823
sym_get_tristate_value(sym) == yes)

0 commit comments

Comments
 (0)