mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Juergen Borleis <jbe@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 4/7] bootchooser: allow an empty namespace
Date: Tue, 15 Aug 2017 15:46:33 +0200	[thread overview]
Message-ID: <20170815134636.21236-5-jbe@pengutronix.de> (raw)
In-Reply-To: <20170815134636.21236-1-jbe@pengutronix.de>

The bootchooser's documentation states the 'namespace' for the state
storage backend is optional. This change makes it really optional to allow
a flat state variable set definition for the 'bootchooser' as well.

Signed-off-by: Juergen Borleis <jbe@pengutronix.de>
---
 common/bootchooser.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/common/bootchooser.c b/common/bootchooser.c
index 69d980d6f..83b15e0f7 100644
--- a/common/bootchooser.c
+++ b/common/bootchooser.c
@@ -367,12 +367,10 @@ struct bootchooser *bootchooser_get(void)
 			char *state_devname;
 
 			delim = strchr(state_prefix, '.');
-			if (!delim) {
-				pr_err("state_prefix '%s' has invalid format\n",
-				       state_prefix);
-				goto err;
-			}
-			state_devname = xstrndup(state_prefix, delim - state_prefix);
+			if (delim)
+				state_devname = xstrndup(state_prefix, delim - state_prefix);
+			else
+				state_devname = xstrdup(state_prefix);
 			bc->state_prefix = xstrdup(state_prefix);
 			bc->state = state_by_name(state_devname);
 			if (!bc->state) {
-- 
2.11.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2017-08-15 13:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-15 13:46 Rework of the state/bootchooser feature documentaiton Juergen Borleis
2017-08-15 13:46 ` [PATCH 1/7] docs/DS1307: fix layout Juergen Borleis
2017-08-15 13:46 ` [PATCH 2/7] state: keep backward compatibility Juergen Borleis
2017-08-15 13:46 ` [PATCH 3/7] bootchooser: avoid a use after free Juergen Borleis
2017-08-15 13:46 ` Juergen Borleis [this message]
2017-08-15 13:46 ` [PATCH 5/7] docs: remove build warning Juergen Borleis
2017-08-15 13:46 ` [PATCH 6/7] state: add debugging help Juergen Borleis
2017-08-15 13:46 ` [PATCH 7/7] docs: rework and extend the 'state' and 'bootchooser' documentation Juergen Borleis
2017-09-06 12:19 ` Rework of the state/bootchooser feature documentaiton 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=20170815134636.21236-5-jbe@pengutronix.de \
    --to=jbe@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