mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH v2 1/3] bootchooser: rename pr_setenv() to bc_setenv()
@ 2022-06-20  9:39 Sascha Hauer
  2022-06-20  9:39 ` [PATCH v2 2/3] env: let setenv() take printf arguments Sascha Hauer
  2022-06-20  9:39 ` [PATCH v2 3/3] treewide: Simplify setenv() calls Sascha Hauer
  0 siblings, 2 replies; 3+ messages in thread
From: Sascha Hauer @ 2022-06-20  9:39 UTC (permalink / raw)
  To: Barebox List

We are about to introduce a generic function names pr_setenv(), so
rename the existent bootchooser specific function to bc_setenv().
For consistency, rename pr_getenv() accordingly.

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

diff --git a/common/bootchooser.c b/common/bootchooser.c
index 75dfbc6166..eb3dda52ab 100644
--- a/common/bootchooser.c
+++ b/common/bootchooser.c
@@ -128,7 +128,7 @@ static void pr_target(struct bootchooser_target *target)
 		printf("    disabled due to %s\n", reason);
 }
 
-static int pr_setenv(struct bootchooser *bc, const char *fmt, ...)
+static int bc_setenv(struct bootchooser *bc, const char *fmt, ...)
 {
 	va_list ap;
 	int ret = 0;
@@ -162,7 +162,7 @@ err:
 	return ret;
 }
 
-static const char *pr_getenv(const char *fmt, ...)
+static const char *bc_getenv(const char *fmt, ...)
 {
 	va_list ap;
 	char *str;
@@ -258,7 +258,7 @@ static struct bootchooser_target *bootchooser_target_new(struct bootchooser *bc,
 		target->remaining_attempts = 0;
 	}
 
-	val = pr_getenv("%s.boot", target->prefix);
+	val = bc_getenv("%s.boot", target->prefix);
 	if (!val)
 		val = target->name;
 	target->boot = xstrdup(val);
@@ -497,17 +497,17 @@ int bootchooser_save(struct bootchooser *bc)
 	int ret;
 
 	if (bc->last_chosen)
-		pr_setenv(bc, "%s.last_chosen=%d", bc->state_prefix,
+		bc_setenv(bc, "%s.last_chosen=%d", bc->state_prefix,
 			  bc->last_chosen->id);
 
 	list_for_each_entry(target, &bc->targets, list) {
-		ret = pr_setenv(bc, "%s.remaining_attempts=%d",
+		ret = bc_setenv(bc, "%s.remaining_attempts=%d",
 				target->state_prefix,
 				target->remaining_attempts);
 		if (ret)
 			return ret;
 
-		ret = pr_setenv(bc, "%s.priority=%d",
+		ret = bc_setenv(bc, "%s.priority=%d",
 				target->state_prefix, target->priority);
 		if (ret)
 			return ret;
-- 
2.30.2




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-06-20  9:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-20  9:39 [PATCH v2 1/3] bootchooser: rename pr_setenv() to bc_setenv() Sascha Hauer
2022-06-20  9:39 ` [PATCH v2 2/3] env: let setenv() take printf arguments Sascha Hauer
2022-06-20  9:39 ` [PATCH v2 3/3] treewide: Simplify setenv() calls Sascha Hauer

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