From: "Petr Štetiar" <ynezz@true.cz>
To: Christian Marangi <ansuelsmth@gmail.com>
Cc: Tom Rini <trini@konsulko.com>,
Weijie Gao <weijie.gao@mediatek.com>,
Heinrich Schuchardt <xypron.glpk@gmx.de>,
Daniel Golle <daniel@makrotopia.org>,
Ilias Apalodimas <ilias.apalodimas@linaro.org>,
Marek Vasut <marek.vasut+renesas@mailbox.org>,
Simon Glass <sjg@chromium.org>,
u-boot@lists.denx.de
Subject: Re: [PATCH] cmd: bootmenu: permit to select bootmenu entry with a shortcut
Date: Sun, 25 May 2025 13:02:13 +0000 [thread overview]
Message-ID: <aDMUzv2QIOdG+97H@meh.true.cz> (raw)
In-Reply-To: <20250524221313.10249-1-ansuelsmth@gmail.com>
Christian Marangi <ansuelsmth@gmail.com> [2025-05-25 00:12:52]:
Hi,
thanks a lot for your upstreaming efforts!
> Permit to select a bootmenu entry with a key shortcut. This is
> especially useful in production or testing scenario to aitomate flashing
aitomate -> automate
> 0 is always reserved for Exit to console.
BTW this is the only shortcut key which currently doesn't work :-) See below.
> + case BKEY_SHORTCUT:
> + /* invalid shortcut, regenerate menu */
> + if (cch->shortcut_key >= menu->count - 1)
IMO it should be:
if (cch->shortcut_key >= menu->count)
Considering menu with 4 items and user presses '0':
* bootmenu_conv_shortcut_key() returns 3 (menu->count - 1), so shortcut_key = 3
* With the original condition
if (cch->shortcut_key >= menu->count - 1)
if (3 >= 3) → true, so it returns NULL (bug)
* With the fixed condition
if (cch->shortcut_key >= menu->count):
if (3 >= 4) → false, so it correctly proceeds
> + return NULL;
> + menu->active = cch->shortcut_key;
> + fallthrough;
Cheers,
Petr
next prev parent reply other threads:[~2025-05-25 13:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-24 22:12 [PATCH] cmd: bootmenu: permit to select bootmenu entry with a shortcut Christian Marangi
2025-05-25 13:02 ` Petr Štetiar [this message]
2025-05-25 13:34 ` Christian Marangi
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=aDMUzv2QIOdG+97H@meh.true.cz \
--to=ynezz@true.cz \
--cc=ansuelsmth@gmail.com \
--cc=daniel@makrotopia.org \
--cc=ilias.apalodimas@linaro.org \
--cc=marek.vasut+renesas@mailbox.org \
--cc=sjg@chromium.org \
--cc=trini@konsulko.com \
--cc=u-boot@lists.denx.de \
--cc=weijie.gao@mediatek.com \
--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