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_check_choice_deps()

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>

+15 -10
+15 -10
scripts/kconfig/symbol.c
··· 1204 1204 1205 1205 static struct symbol *sym_check_choice_deps(struct symbol *choice) 1206 1206 { 1207 - struct symbol *sym, *sym2; 1208 - struct property *prop; 1209 - struct expr *e; 1207 + struct menu *choice_menu, *menu; 1208 + struct symbol *sym2; 1210 1209 struct dep_stack stack; 1211 1210 1212 1211 dep_stack_insert(&stack, choice); 1213 1212 1214 - prop = sym_get_choice_prop(choice); 1215 - expr_list_for_each_sym(prop->expr, e, sym) 1216 - sym->flags |= (SYMBOL_CHECK | SYMBOL_CHECKED); 1213 + choice_menu = list_first_entry(&choice->menus, struct menu, link); 1214 + 1215 + menu_for_each_sub_entry(menu, choice_menu) { 1216 + if (menu->sym) 1217 + menu->sym->flags |= SYMBOL_CHECK | SYMBOL_CHECKED; 1218 + } 1217 1219 1218 1220 choice->flags |= (SYMBOL_CHECK | SYMBOL_CHECKED); 1219 1221 sym2 = sym_check_sym_deps(choice); ··· 1223 1221 if (sym2) 1224 1222 goto out; 1225 1223 1226 - expr_list_for_each_sym(prop->expr, e, sym) { 1227 - sym2 = sym_check_sym_deps(sym); 1224 + menu_for_each_sub_entry(menu, choice_menu) { 1225 + if (!menu->sym) 1226 + continue; 1227 + sym2 = sym_check_sym_deps(menu->sym); 1228 1228 if (sym2) 1229 1229 break; 1230 1230 } 1231 1231 out: 1232 - expr_list_for_each_sym(prop->expr, e, sym) 1233 - sym->flags &= ~SYMBOL_CHECK; 1232 + menu_for_each_sub_entry(menu, choice_menu) 1233 + if (menu->sym) 1234 + menu->sym->flags &= ~SYMBOL_CHECK; 1234 1235 1235 1236 if (sym2 && sym_is_choice_value(sym2) && 1236 1237 prop_get_symbol(sym_get_choice_prop(sym2)) == choice)