Skip to content

Commit 092e39d

Browse files
committed
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 <[email protected]>
1 parent 6c07fd8 commit 092e39d

File tree

2 files changed

+2
-17
lines changed

2 files changed

+2
-17
lines changed

scripts/kconfig/lkc.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,6 @@ bool menu_is_visible(struct menu *menu);
9999
bool menu_has_prompt(struct menu *menu);
100100
const char *menu_get_prompt(struct menu *menu);
101101
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);
104102
int get_jump_key_char(void);
105103
struct gstr get_relations_str(struct symbol **sym_arr, struct list_head *head);
106104
void menu_get_ext_help(struct menu *menu, struct gstr *help);

scripts/kconfig/menu.c

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -673,19 +673,6 @@ struct menu *menu_get_parent_menu(struct menu *menu)
673673
return menu;
674674
}
675675

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-
689676
static void get_def_str(struct gstr *r, struct menu *menu)
690677
{
691678
str_printf(r, "Defined at %s:%d\n",
@@ -856,10 +843,10 @@ void menu_get_ext_help(struct menu *menu, struct gstr *help)
856843
struct symbol *sym = menu->sym;
857844
const char *help_text = nohelp_text;
858845

859-
if (menu_has_help(menu)) {
846+
if (menu->help) {
860847
if (sym->name)
861848
str_printf(help, "%s%s:\n\n", CONFIG_, sym->name);
862-
help_text = menu_get_help(menu);
849+
help_text = menu->help;
863850
}
864851
str_printf(help, "%s\n", help_text);
865852
if (sym)

0 commit comments

Comments
 (0)