summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2024-02-15 08:47:55 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2024-02-16 12:13:47 +0100
commit8e9895959d3f24ca9aaf51270f8c29ec466a5668 (patch)
tree784945f0e55b1f0bfc60b29d4d278869a290398c
parent713a23cb2aeae374efcfc391e66b2959bba23f0d (diff)
downloadbarebox-8e9895959d3f.tar.gz
barebox-8e9895959d3f.tar.xz
fastboot: pass list to fb_addvar()
With followup patches we'll maintain two lists of fastboot variables. As a preparation pass the list to which the variable shall be added to fb_addvar(). No functional change intended. Reviewed-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.barebox.org/20240215074757.960200-6-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--common/fastboot.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/common/fastboot.c b/common/fastboot.c
index 261283d50a..eaf99b08f4 100644
--- a/common/fastboot.c
+++ b/common/fastboot.c
@@ -66,7 +66,7 @@ static void fb_setvar(struct fb_variable *var, const char *fmt, ...)
va_end(ap);
}
-static struct fb_variable *fb_addvar(struct fastboot *fb, const char *fmt, ...)
+static struct fb_variable *fb_addvar(struct fastboot *fb, struct list_head *list, const char *fmt, ...)
{
struct fb_variable *var = xzalloc(sizeof(*var));
va_list ap;
@@ -75,7 +75,7 @@ static struct fb_variable *fb_addvar(struct fastboot *fb, const char *fmt, ...)
var->name = bvasprintf(fmt, ap);
va_end(ap);
- list_add_tail(&var->list, &fb->variables);
+ list_add_tail(&var->list, list);
return var;
}
@@ -152,9 +152,9 @@ out:
if (ret)
return ret;
- var = fb_addvar(fb, "partition-size:%s", fentry->name);
+ var = fb_addvar(fb, &fb->variables, "partition-size:%s", fentry->name);
fb_setvar(var, "%08zx", size);
- var = fb_addvar(fb, "partition-type:%s", fentry->name);
+ var = fb_addvar(fb, &fb->variables, "partition-type:%s", fentry->name);
fb_setvar(var, "%s", type);
return ret;
@@ -168,12 +168,12 @@ int fastboot_generic_init(struct fastboot *fb, bool export_bbu)
INIT_LIST_HEAD(&fb->variables);
- var = fb_addvar(fb, "version");
+ var = fb_addvar(fb, &fb->variables, "version");
fb_setvar(var, "0.4");
- var = fb_addvar(fb, "bootloader-version");
+ var = fb_addvar(fb, &fb->variables, "bootloader-version");
fb_setvar(var, release_string);
if (IS_ENABLED(CONFIG_FASTBOOT_SPARSE)) {
- var = fb_addvar(fb, "max-download-size");
+ var = fb_addvar(fb, &fb->variables, "max-download-size");
fb_setvar(var, "%u", fastboot_max_download_size);
}