Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

kconfig: use menu_list_for_each_sym() in sym_choice_default()

Choices and their members are associated via the P_CHOICE property.

Currently, sym_get_choice_prop() and expr_list_for_each_sym() are
used to iterate on choice members.

Replace them with menu_for_each_sub_entry(), which achieves the same
without relying on P_CHOICE.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

+4 -5
+4 -5
scripts/kconfig/symbol.c
··· 257 257 */ 258 258 struct symbol *sym_choice_default(struct menu *choice) 259 259 { 260 + struct menu *menu; 260 261 struct symbol *def_sym; 261 262 struct property *prop; 262 - struct expr *e; 263 263 264 264 /* any of the defaults visible? */ 265 265 for_all_defaults(choice->sym, prop) { ··· 272 272 } 273 273 274 274 /* just get the first visible value */ 275 - prop = sym_get_choice_prop(choice->sym); 276 - expr_list_for_each_sym(prop->expr, e, def_sym) 277 - if (def_sym->visible != no) 278 - return def_sym; 275 + menu_for_each_sub_entry(menu, choice) 276 + if (menu->sym && menu->sym->visible != no) 277 + return menu->sym; 279 278 280 279 /* failed to locate any defaults */ 281 280 return NULL;