aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/kconfig/menu.c
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2025-06-25 00:04:52 +0900
committerMasahiro Yamada <masahiroy@kernel.org>2025-06-30 12:52:58 +0900
commit3c292cd0047c8758a2db7a44e441314e78b4db00 (patch)
tree5e62b5ae6a6a02b6f861ec6066422f71863c070f /scripts/kconfig/menu.c
parentkconfig: qconf: show selected choice in the Value column (diff)
downloadlinux-3c292cd0047c8758a2db7a44e441314e78b4db00.tar.gz
linux-3c292cd0047c8758a2db7a44e441314e78b4db00.zip
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>
Diffstat (limited to 'scripts/kconfig/menu.c')
-rw-r--r--scripts/kconfig/menu.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c
index 7d48a692bd27..ccb690bbf05d 100644
--- a/scripts/kconfig/menu.c
+++ b/scripts/kconfig/menu.c
@@ -575,7 +575,13 @@ const char *menu_get_prompt(const struct menu *menu)
return NULL;
}
-struct menu *menu_get_parent_menu(struct menu *menu)
+/**
+ * menu_get_menu_or_parent_menu - return the parent menu or the menu itself
+ * @menu: pointer to the menu
+ * return: the parent menu. If the given argument is already a menu, return
+ * itself.
+ */
+struct menu *menu_get_menu_or_parent_menu(struct menu *menu)
{
enum prop_type type;