mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] globalvar: call dev_set_param only once when loading nv vars
@ 2026-05-01  9:23 Ahmad Fatoum
  0 siblings, 0 replies; only message in thread
From: Ahmad Fatoum @ 2026-05-01  9:23 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

globalvar_add_simple() accepts NULL as value to mean that a global
variable should be created, but dev_set_param() should not yet be
called.

Instead we pass a non-NULL value, so dev_set_param() is called once when
adding the variable and once more directly after via nv_set().

Fix this, so dev_set_param() is called only once.

Signed-off-by: Ahmad Fatoum <a.fatoum@barebox.org>
---
 common/globalvar.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/globalvar.c b/common/globalvar.c
index 876379b2538e..00f94d98af3d 100644
--- a/common/globalvar.c
+++ b/common/globalvar.c
@@ -236,11 +236,11 @@ static int __nvvar_add(const char *name, const char *value)
 		if (IS_ERR(p))
 			return PTR_ERR(p);
 	}
 
 	/* Create corresponding globalvar if it doesn't exist yet */
-	ret = globalvar_add_simple(name, value);
+	ret = globalvar_add_simple(name, NULL);
 	if (ret && ret != -EEXIST)
 		return ret;
 
 	if (value)
 		return nv_set(p, name, value);
-- 
2.47.3




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-05-01  9:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-05-01  9:23 [PATCH] globalvar: call dev_set_param only once when loading nv vars Ahmad Fatoum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox