summaryrefslogtreecommitdiffstats
path: root/commands
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2016-07-20 13:57:44 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2016-07-26 08:31:35 +0200
commit3ab18b3cd0a07fc6b84248b84dacd3330f02189e (patch)
tree70b641e84a33dc9090fd13e1a60e75837bdac6f6 /commands
parent86a4036ba2c42bd38c87d1770009eab82dff01e3 (diff)
downloadbarebox-3ab18b3cd0a07fc6b84248b84dacd3330f02189e.tar.gz
barebox-3ab18b3cd0a07fc6b84248b84dacd3330f02189e.tar.xz
bootentries: Move menu display string allocation to bootentries_alloc()
bootentries_alloc() is the place where the struct bootentries container is allocated, so allocate the menu entry there aswell. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'commands')
-rw-r--r--commands/boot.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/commands/boot.c b/commands/boot.c
index 1ae2745247..f193c9367a 100644
--- a/commands/boot.c
+++ b/commands/boot.c
@@ -50,8 +50,10 @@ static struct bootentries *bootentries_alloc(void)
bootentries = xzalloc(sizeof(*bootentries));
INIT_LIST_HEAD(&bootentries->entries);
- if (IS_ENABLED(CONFIG_MENU))
+ if (IS_ENABLED(CONFIG_MENU)) {
bootentries->menu = menu_alloc();
+ bootentries->menu->display = basprintf("boot");
+ }
return bootentries;
}
@@ -294,9 +296,6 @@ static struct bootentries *bootentries_collect(char *entries[], int num_entries)
bootentries = bootentries_alloc();
- if (IS_ENABLED(CONFIG_MENU))
- bootentries->menu->display = basprintf("boot");
-
if (!num_entries)
bootscript_scan_path(bootentries, "/env/boot");