• Masahiro Yamada's avatar
    kconfig: add menu_next() function and menu_for_each(_sub)_entry macros · 7284b4fb
    Masahiro Yamada authored
    Several functions require traversing menu entries sequentially. This
    commit introduces some helpers to simplify such operations.
    
    The menu_next() function facilitates depth-first traversal:
    
     1. Descend to the child level if the current menu has one
     2. Move to the next sibling at the same level if available
     3. Ascend to the parent level if there is no more child or sibling
    
    The menu_for_each_sub_entry() macro iterates over all submenu entries
    using depth-first traverse.
    
    The menu_for_each_entry() macro is the same, but over all menu entries.
    Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
    7284b4fb
menu.c 21.5 KB