From: Ilias Apalodimas <ilias.apalodimas@linaro.org>
To: Masahisa Kojima <masahisa.kojima@linaro.org>
Cc: u-boot@lists.denx.de, Heinrich Schuchardt <xypron.glpk@gmx.de>,
Simon Glass <sjg@chromium.org>,
Takahiro Akashi <takahiro.akashi@linaro.org>,
Mark Kettenis <mark.kettenis@xs4all.nl>,
Michal Simek <michal.simek@amd.com>,
Ovidiu Panait <ovidiu.panait@windriver.com>,
Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>,
John Keeping <john@metanate.com>,
Chris Morgan <macromorgan@hotmail.com>,
Kever Yang <kever.yang@rock-chips.com>,
Huang Jianan <jnhuang95@gmail.com>
Subject: Re: [PATCH v14 01/10] eficonfig: menu-driven addition of UEFI boot option
Date: Tue, 30 Aug 2022 14:53:19 +0300 [thread overview]
Message-ID: <Yw36L9ba+hx/P5zi@hades> (raw)
In-Reply-To: <20220826064223.23288-2-masahisa.kojima@linaro.org>
Hi Kojima-san,
[...]
> +/**
> + * eficonfig_choice_entry() - user key input handler
> + *
> + * @data: pointer to the efimenu structure
> + * Return: key string to identify the selected entry
> + */
> +static char *eficonfig_choice_entry(void *data)
> +{
> + int esc = 0;
> + struct list_head *pos, *n;
> + struct eficonfig_entry *entry;
> + enum bootmenu_key key = KEY_NONE;
> + struct efimenu *efi_menu = data;
> +
> + while (1) {
> + bootmenu_loop((struct bootmenu_data *)efi_menu, &key, &esc);
> +
> + switch (key) {
> + case KEY_UP:
> + if (efi_menu->active > 0)
> + --efi_menu->active;
> + /* no menu key selected, regenerate menu */
> + return NULL;
> + case KEY_DOWN:
> + if (efi_menu->active < efi_menu->count - 1)
> + ++efi_menu->active;
> + /* no menu key selected, regenerate menu */
> + return NULL;
> + case KEY_SELECT:
> + list_for_each_safe(pos, n, &efi_menu->list) {
> + entry = list_entry(pos, struct eficonfig_entry, list);
> + if (entry->num == efi_menu->active)
> + return entry->key;
> + }
> + break;
> + case KEY_QUIT:
> + /* Quit by choosing the last entry */
> + entry = list_last_entry(&efi_menu->list, struct eficonfig_entry, list);
> + return entry->key;
> + default:
> + /* Pressed key is not valid, no need to regenerate the menu */
Even with this comment I am still not sure I am following.
The function definition is a char *. There are cases ('default' and
'KEY_SELECT') which have no return value at all.
Shouldn't there be a 'return NULL' in the end of the function, even if
that's not supposed to happen?
[...]
Thanks
/Ilias
next prev parent reply other threads:[~2022-08-30 11:54 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-26 6:42 [PATCH v14 00/10] enable menu-driven UEFI variable maintenance Masahisa Kojima
2022-08-26 6:42 ` [PATCH v14 01/10] eficonfig: menu-driven addition of UEFI boot option Masahisa Kojima
2022-08-30 11:53 ` Ilias Apalodimas [this message]
2022-08-30 12:56 ` Ilias Apalodimas
2022-08-26 6:42 ` [PATCH v14 02/10] eficonfig: add "Edit Boot Option" menu entry Masahisa Kojima
2022-08-26 6:42 ` [PATCH v14 03/10] menu: add KEY_PLUS, KEY_MINUS and KEY_SPACE handling Masahisa Kojima
2022-08-26 6:42 ` [PATCH v14 04/10] eficonfig: add "Delete Boot Option" menu entry Masahisa Kojima
2022-08-26 6:42 ` [PATCH v14 05/10] bootmenu: add removable media entries Masahisa Kojima
2022-08-26 6:42 ` [PATCH v14 06/10] eficonfig: scan media device in eficonfig startup Masahisa Kojima
2022-08-26 6:42 ` [PATCH v14 07/10] eficonfig: add "Change Boot Order" menu entry Masahisa Kojima
2022-08-26 6:42 ` [PATCH v14 08/10] doc:bootmenu: add description for UEFI boot support Masahisa Kojima
2022-08-26 6:42 ` [PATCH v14 09/10] doc:eficonfig: add documentation for eficonfig command Masahisa Kojima
2022-08-26 6:42 ` [PATCH v14 10/10] test: unit test for eficonfig Masahisa Kojima
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Yw36L9ba+hx/P5zi@hades \
--to=ilias.apalodimas@linaro.org \
--cc=ashok.reddy.soma@xilinx.com \
--cc=jnhuang95@gmail.com \
--cc=john@metanate.com \
--cc=kever.yang@rock-chips.com \
--cc=macromorgan@hotmail.com \
--cc=mark.kettenis@xs4all.nl \
--cc=masahisa.kojima@linaro.org \
--cc=michal.simek@amd.com \
--cc=ovidiu.panait@windriver.com \
--cc=sjg@chromium.org \
--cc=takahiro.akashi@linaro.org \
--cc=u-boot@lists.denx.de \
--cc=xypron.glpk@gmx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).