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: remove sym_get_choice_value()

sym_get_choice_value(menu->sym) is equivalent to sym_calc_choice(menu).

Convert all call sites of sym_get_choice_value() and then remove it.

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

+11 -21
+2 -4
scripts/kconfig/conf.c
··· 422 422 423 423 static void conf_choice(struct menu *menu) 424 424 { 425 - struct symbol *sym, *def_sym; 425 + struct symbol *def_sym; 426 426 struct menu *child; 427 427 bool is_new = false; 428 - 429 - sym = menu->sym; 430 428 431 429 while (1) { 432 430 int cnt, def; 433 431 434 432 printf("%*s%s\n", indent - 1, "", menu_get_prompt(menu)); 435 - def_sym = sym_get_choice_value(sym); 433 + def_sym = sym_calc_choice(menu); 436 434 cnt = def = 0; 437 435 line[0] = 0; 438 436 for (child = menu->list; child; child = child->next) {
+1 -1
scripts/kconfig/gconf.c
··· 1054 1054 1055 1055 if (sym_is_choice(sym)) { // parse childs for getting final value 1056 1056 struct menu *child; 1057 - struct symbol *def_sym = sym_get_choice_value(sym); 1057 + struct symbol *def_sym = sym_calc_choice(menu); 1058 1058 struct menu *def_menu = NULL; 1059 1059 1060 1060 for (child = menu->list; child; child = child->next) {
+1 -2
scripts/kconfig/lkc.h
··· 110 110 /* symbol.c */ 111 111 void sym_clear_all_valid(void); 112 112 struct symbol *sym_choice_default(struct symbol *sym); 113 + struct symbol *sym_calc_choice(struct menu *choice); 113 114 struct property *sym_get_range_prop(struct symbol *sym); 114 115 const char *sym_get_string_default(struct symbol *sym); 115 116 struct symbol *sym_check_deps(struct symbol *sym); ··· 120 119 { 121 120 return sym->curr.tri; 122 121 } 123 - 124 - struct symbol *sym_get_choice_value(struct symbol *sym); 125 122 126 123 static inline bool sym_is_choice(struct symbol *sym) 127 124 {
+3 -3
scripts/kconfig/mconf.c
··· 514 514 515 515 type = sym_get_type(sym); 516 516 if (sym_is_choice(sym)) { 517 - struct symbol *def_sym = sym_get_choice_value(sym); 517 + struct symbol *def_sym = sym_calc_choice(menu); 518 518 struct menu *def_menu = NULL; 519 519 520 520 child_count++; ··· 600 600 struct menu *child; 601 601 struct symbol *active; 602 602 603 - active = sym_get_choice_value(menu->sym); 603 + active = sym_calc_choice(menu); 604 604 while (1) { 605 605 int res; 606 606 int selected; ··· 619 619 item_set_data(child); 620 620 if (child->sym == active) 621 621 item_set_selected(1); 622 - if (child->sym == sym_get_choice_value(menu->sym)) 622 + if (child->sym == sym_calc_choice(menu)) 623 623 item_set_tag('X'); 624 624 } 625 625 dialog_clear();
+3 -3
scripts/kconfig/nconf.c
··· 815 815 816 816 type = sym_get_type(sym); 817 817 if (sym_is_choice(sym)) { 818 - struct symbol *def_sym = sym_get_choice_value(sym); 818 + struct symbol *def_sym = sym_calc_choice(menu); 819 819 struct menu *def_menu = NULL; 820 820 821 821 child_count++; ··· 1239 1239 .pattern = "", 1240 1240 }; 1241 1241 1242 - active = sym_get_choice_value(menu->sym); 1242 + active = sym_calc_choice(menu); 1243 1243 /* this is mostly duplicated from the conf() function. */ 1244 1244 while (!global_exit) { 1245 1245 reset_menu(); ··· 1248 1248 if (!show_all_items && !menu_is_visible(child)) 1249 1249 continue; 1250 1250 1251 - if (child->sym == sym_get_choice_value(menu->sym)) 1251 + if (child->sym == sym_calc_choice(menu)) 1252 1252 item_make(child, ':', "<X> %s", 1253 1253 menu_get_prompt(child)); 1254 1254 else if (child->sym)
+1 -8
scripts/kconfig/symbol.c
··· 288 288 * 289 289 * Return: a chosen symbol 290 290 */ 291 - static struct symbol *sym_calc_choice(struct menu *choice) 291 + struct symbol *sym_calc_choice(struct menu *choice) 292 292 { 293 293 struct symbol *res = NULL; 294 294 struct symbol *sym; ··· 363 363 } 364 364 365 365 return res; 366 - } 367 - 368 - struct symbol *sym_get_choice_value(struct symbol *sym) 369 - { 370 - struct menu *menu = list_first_entry(&sym->menus, struct menu, link); 371 - 372 - return sym_calc_choice(menu); 373 366 } 374 367 375 368 static void sym_warn_unmet_dep(struct symbol *sym)