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: squash menu_has_help() and menu_get_help()

menu_has_help() and menu_get_help() functions are only used within
menu_get_ext_help().

Squash them into menu_get_ext_help(). It revealed the if-conditional
in menu_get_help() was unneeded, as menu_has_help() has already checked
that menu->help is not NULL.

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

+2 -17
-2
scripts/kconfig/lkc.h
··· 99 99 bool menu_has_prompt(struct menu *menu); 100 100 const char *menu_get_prompt(struct menu *menu); 101 101 struct menu *menu_get_parent_menu(struct menu *menu); 102 - bool menu_has_help(struct menu *menu); 103 - const char *menu_get_help(struct menu *menu); 104 102 int get_jump_key_char(void); 105 103 struct gstr get_relations_str(struct symbol **sym_arr, struct list_head *head); 106 104 void menu_get_ext_help(struct menu *menu, struct gstr *help);
+2 -15
scripts/kconfig/menu.c
··· 673 673 return menu; 674 674 } 675 675 676 - bool menu_has_help(struct menu *menu) 677 - { 678 - return menu->help != NULL; 679 - } 680 - 681 - const char *menu_get_help(struct menu *menu) 682 - { 683 - if (menu->help) 684 - return menu->help; 685 - else 686 - return ""; 687 - } 688 - 689 676 static void get_def_str(struct gstr *r, struct menu *menu) 690 677 { 691 678 str_printf(r, "Defined at %s:%d\n", ··· 843 856 struct symbol *sym = menu->sym; 844 857 const char *help_text = nohelp_text; 845 858 846 - if (menu_has_help(menu)) { 859 + if (menu->help) { 847 860 if (sym->name) 848 861 str_printf(help, "%s%s:\n\n", CONFIG_, sym->name); 849 - help_text = menu_get_help(menu); 862 + help_text = menu->help; 850 863 } 851 864 str_printf(help, "%s\n", help_text); 852 865 if (sym)