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

kconfig: rename menu_get_parent_menu() to menu_get_menu_or_parent_menu()

The current menu_get_parent_menu() does not always return the parent
menu; if the given argument is itself a menu, it returns that menu.

Rename this function to better reflect this behavior.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Tested-by: Randy Dunlap <rdunlap@infradead.org>

+12 -6
+1 -1
scripts/kconfig/conf.c
··· 594 594 default: 595 595 if (!conf_cnt++) 596 596 printf("*\n* Restart config...\n*\n"); 597 - rootEntry = menu_get_parent_menu(menu); 597 + rootEntry = menu_get_menu_or_parent_menu(menu); 598 598 conf(rootEntry); 599 599 break; 600 600 }
+1 -1
scripts/kconfig/lkc.h
··· 97 97 bool menu_is_visible(struct menu *menu); 98 98 bool menu_has_prompt(const struct menu *menu); 99 99 const char *menu_get_prompt(const struct menu *menu); 100 - struct menu *menu_get_parent_menu(struct menu *menu); 100 + struct menu *menu_get_menu_or_parent_menu(struct menu *menu); 101 101 int get_jump_key_char(void); 102 102 struct gstr get_relations_str(struct symbol **sym_arr, struct list_head *head); 103 103 void menu_get_ext_help(struct menu *menu, struct gstr *help);
+7 -1
scripts/kconfig/menu.c
··· 575 575 return NULL; 576 576 } 577 577 578 - struct menu *menu_get_parent_menu(struct menu *menu) 578 + /** 579 + * menu_get_menu_or_parent_menu - return the parent menu or the menu itself 580 + * @menu: pointer to the menu 581 + * return: the parent menu. If the given argument is already a menu, return 582 + * itself. 583 + */ 584 + struct menu *menu_get_menu_or_parent_menu(struct menu *menu) 579 585 { 580 586 enum prop_type type; 581 587
+3 -3
scripts/kconfig/qconf.cc
··· 577 577 oldroot = rootEntry; 578 578 if (rootEntry == &rootmenu) 579 579 return; 580 - setRootMenu(menu_get_parent_menu(rootEntry->parent)); 580 + setRootMenu(menu_get_menu_or_parent_menu(rootEntry->parent)); 581 581 582 582 QTreeWidgetItemIterator it(this); 583 583 while (*it) { ··· 1540 1540 switch (configList->mode) { 1541 1541 case singleMode: 1542 1542 list = configList; 1543 - parent = menu_get_parent_menu(menu); 1543 + parent = menu_get_menu_or_parent_menu(menu); 1544 1544 if (!parent) 1545 1545 return; 1546 1546 list->setRootMenu(parent); ··· 1551 1551 configList->clearSelection(); 1552 1552 list = configList; 1553 1553 } else { 1554 - parent = menu_get_parent_menu(menu->parent); 1554 + parent = menu_get_menu_or_parent_menu(menu->parent); 1555 1555 if (!parent) 1556 1556 return; 1557 1557