diff mbox series

[U-Boot] ensure active menuitem is inside menu

Message ID trinity-bfe8738e-9210-42fc-bef7-4748a3074018-1543832621376@3c-app-gmx-bs20
State Accepted
Delegated to: Tom Rini
Headers show
Series [U-Boot] ensure active menuitem is inside menu | expand

Commit Message

Frank Wunderlich Dec. 3, 2018, 10:23 a.m. UTC
Hi,

setting active menuitem currently can be outside of menu which results in invisible selection

attached Patch fixes this

regards Frank

Comments

Simon Goldschmidt Dec. 3, 2018, 10:50 a.m. UTC | #1
On Mon, Dec 3, 2018 at 11:23 AM Frank Wunderlich
<frank-w@public-files.de> wrote:
>
> Hi,
>
> setting active menuitem currently can be outside of menu which results in invisible selection
>
> attached Patch fixes this

Have you read the section "Submitting Patches" in the README file?

https://github.com/u-boot/u-boot/blob/master/README#L4980

In short, patches should be send inline, not as attachment. I guess
patchwork cannot extract the patches either when sent as attachment.

Regards,
Simon
Frank Wunderlich Dec. 3, 2018, 10:57 a.m. UTC | #2
Hi

Patchwork had extracted the Patch...

https://patchwork.ozlabs.org/patch/1006783/

but next time i append Patch in the Mail-text

Regards Frank

> Gesendet: Montag, 03. Dezember 2018 um 11:50 Uhr
> Von: "Simon Goldschmidt" <simon.k.r.goldschmidt@gmail.com>
> An: "Frank Wunderlich" <frank-w@public-files.de>
> Cc: "U-Boot Mailing List" <u-boot@lists.denx.de>
> Betreff: Re: [U-Boot] ensure active menuitem is inside menu
>
> On Mon, Dec 3, 2018 at 11:23 AM Frank Wunderlich
> <frank-w@public-files.de> wrote:
> >
> > Hi,
> >
> > setting active menuitem currently can be outside of menu which results in invisible selection
> >
> > attached Patch fixes this
> 
> Have you read the section "Submitting Patches" in the README file?
> 
> https://github.com/u-boot/u-boot/blob/master/README#L4980
> 
> In short, patches should be send inline, not as attachment. I guess
> patchwork cannot extract the patches either when sent as attachment.
> 
> Regards,
> Simon
>
Simon Goldschmidt Dec. 3, 2018, 11:16 a.m. UTC | #3
On Mon, Dec 3, 2018 at 11:58 AM Frank Wunderlich
<frank-w@public-files.de> wrote:
>
> Hi
>
> Patchwork had extracted the Patch...
>
> https://patchwork.ozlabs.org/patch/1006783/

Oh, sorry then. Somehow I failed to find it :-/

Regards,
Simon

>
> but next time i append Patch in the Mail-text
>
> Regards Frank
>
> > Gesendet: Montag, 03. Dezember 2018 um 11:50 Uhr
> > Von: "Simon Goldschmidt" <simon.k.r.goldschmidt@gmail.com>
> > An: "Frank Wunderlich" <frank-w@public-files.de>
> > Cc: "U-Boot Mailing List" <u-boot@lists.denx.de>
> > Betreff: Re: [U-Boot] ensure active menuitem is inside menu
> >
> > On Mon, Dec 3, 2018 at 11:23 AM Frank Wunderlich
> > <frank-w@public-files.de> wrote:
> > >
> > > Hi,
> > >
> > > setting active menuitem currently can be outside of menu which results in invisible selection
> > >
> > > attached Patch fixes this
> >
> > Have you read the section "Submitting Patches" in the README file?
> >
> > https://github.com/u-boot/u-boot/blob/master/README#L4980
> >
> > In short, patches should be send inline, not as attachment. I guess
> > patchwork cannot extract the patches either when sent as attachment.
> >
> > Regards,
> > Simon
> >
Tom Rini Dec. 7, 2018, 8:34 p.m. UTC | #4
On Mon, Dec 03, 2018 at 11:23:41AM +0100, Frank Wunderlich wrote:

> Hi,
> 
> setting active menuitem currently can be outside of menu which results in invisible selection
> 
> attached Patch fixes this
> 
> regards Frank
> 
> >From 1d9c4cb8b3e2dd9b0a7a6a2d4a21684d0a099dbf Mon Sep 17 00:00:00 2001
> From: Frank Wunderlich <frank-w@public-files.de>
> Date: Sun, 2 Dec 2018 11:23:53 +0100
> Subject: [PATCH] ensure active menuitem is inside menu
> 
> if active menuitem is defined via environment var it can be outside the menu (>=menuitem-count)
> 
> this patch resets this definition back to 0
> 
> Signed-off-by: Frank Wunderlich <frank-w@public-files.de>

Applied to u-boot/master, thanks!
diff mbox series

Patch

From 1d9c4cb8b3e2dd9b0a7a6a2d4a21684d0a099dbf Mon Sep 17 00:00:00 2001
From: Frank Wunderlich <frank-w@public-files.de>
Date: Sun, 2 Dec 2018 11:23:53 +0100
Subject: [PATCH] ensure active menuitem is inside menu

if active menuitem is defined via environment var it can be outside the menu (>=menuitem-count)

this patch resets this definition back to 0

Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
---
 cmd/bootmenu.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/cmd/bootmenu.c b/cmd/bootmenu.c
index 979ac4a638..7f88c1ed63 100644
--- a/cmd/bootmenu.c
+++ b/cmd/bootmenu.c
@@ -351,6 +351,12 @@  static struct bootmenu_data *bootmenu_create(int delay)
 	}
 
 	menu->count = i;
+
+	if ((menu->active >= menu->count)||(menu->active < 0)) { //ensure active menuitem is inside menu
+		printf("active menuitem (%d) is outside menu (0..%d)\n",menu->active,menu->count-1);
+		menu->active=0;
+	}
+
 	return menu;
 
 cleanup:
-- 
2.17.1