mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH v2 1/3] bootchooser: rename pr_setenv() to bc_setenv()
Date: Mon, 20 Jun 2022 11:39:51 +0200	[thread overview]
Message-ID: <20220620093953.24822-1-s.hauer@pengutronix.de> (raw)

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




             reply	other threads:[~2022-06-20  9:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-20  9:39 Sascha Hauer [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220620093953.24822-1-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox