[PATCH 1/4] globalvar: Allow to remove multiple globalvars using wildcards

Sascha Hauer s.hauer at pengutronix.de
Thu Sep 22 01:11:09 PDT 2016


Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 common/globalvar.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/common/globalvar.c b/common/globalvar.c
index 3fd8221..007e955 100644
--- a/common/globalvar.c
+++ b/common/globalvar.c
@@ -44,12 +44,14 @@ int globalvar_add(const char *name,
 
 void globalvar_remove(const char *name)
 {
-	struct param_d *param = get_param_by_name(&global_device, name);
+	struct param_d *p, *tmp;
 
-	if (!param)
-		return;
+	list_for_each_entry_safe(p, tmp, &global_device.parameters, list) {
+		if (fnmatch(name, p->name, 0))
+			continue;
 
-	dev_remove_param(param);
+		dev_remove_param(p);
+	}
 }
 
 static int __nv_save(const char *prefix, const char *name, const char *val)
-- 
2.8.1




More information about the barebox mailing list