[PATCH v4 04/11] menu: always show the menu regardless of the number of entry
Heinrich Schuchardt
xypron.glpk at gmx.de
Sat Apr 2 09:56:56 CEST 2022
On 3/24/22 14:54, Masahisa Kojima wrote:
> To make user aware of the menu entry selection, menu always
> appears regardless of the number of entry.
>
> Signed-off-by: Masahisa Kojima <masahisa.kojima at linaro.org>
> ---
> Newly created in v4
>
> common/menu.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/common/menu.c b/common/menu.c
> index 5fb2ffbd06..b577d80b4f 100644
> --- a/common/menu.c
> +++ b/common/menu.c
> @@ -271,7 +271,7 @@ int menu_get_choice(struct menu *m, void **choice)
> if (!m || !choice)
> return -EINVAL;
>
> - if (!m->prompt || m->item_cnt == 1)
> + if (!m->prompt)
> return menu_default_choice(m, choice);
As we can disable entering the console item_cnt may be zero.
This case needs to be handled.
Best regards
Heinrich
>
> return menu_interactive_choice(m, choice);
More information about the U-Boot
mailing list