LKML Archive on
 help / color / Atom feed
From: Masami Hiramatsu <>
To: Steven Rostedt <>
Cc:, LKML <>
Subject: [PATCH v2 3/4] tools/bootconfig: Fix to return 0 if succeeded to show the bootconfig
Date: Tue, 16 Jun 2020 19:14:25 +0900
Message-ID: <159230246566.65555.11891772258543514487.stgit@devnote2> (raw)
In-Reply-To: <159230243779.65555.11413773790099102781.stgit@devnote2>

Fix bootconfig to return 0 if succeeded to show the bootconfig
in initrd. Without this fix, "bootconfig INITRD" command
returns !0 even if the command succeeded to show the bootconfig.

Fixes: 950313ebf79c ("tools: bootconfig: Add bootconfig command")
Signed-off-by: Masami Hiramatsu <>
  Changes in v2:
   - Use goto for better reading.
 tools/bootconfig/main.c |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/tools/bootconfig/main.c b/tools/bootconfig/main.c
index 21896a6675fd..e0878f5f74b1 100644
--- a/tools/bootconfig/main.c
+++ b/tools/bootconfig/main.c
@@ -207,11 +207,13 @@ int show_xbc(const char *path)
 	ret = load_xbc_from_initrd(fd, &buf);
-	if (ret < 0)
+	if (ret < 0) {
 		pr_err("Failed to load a boot config from initrd: %d\n", ret);
-	else
-		xbc_show_compact_tree();
+		goto out;
+	}
+	xbc_show_compact_tree();
+	ret = 0;

  parent reply index

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-16 10:13 [PATCH v2 0/4] bootconfig: Fix quote-character issue and return value Masami Hiramatsu
2020-06-16 10:14 ` [PATCH v2 1/4] proc/bootconfig: Fix to use correct quotes for value Masami Hiramatsu
2020-06-16 10:14 ` [PATCH v2 2/4] tools/bootconfig: " Masami Hiramatsu
2020-06-16 10:14 ` Masami Hiramatsu [this message]
2020-06-16 10:14 ` [PATCH v2 4/4] tools/bootconfig: Add testcase for show-command and quotes test Masami Hiramatsu

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:

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

  git send-email \
    --in-reply-to=159230246566.65555.11891772258543514487.stgit@devnote2 \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

LKML Archive on

Archives are clonable:
	git clone --mirror lkml/git/0.git
	git clone --mirror lkml/git/1.git
	git clone --mirror lkml/git/2.git
	git clone --mirror lkml/git/3.git
	git clone --mirror lkml/git/4.git
	git clone --mirror lkml/git/5.git
	git clone --mirror lkml/git/6.git
	git clone --mirror lkml/git/7.git
	git clone --mirror lkml/git/8.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ \
	public-inbox-index lkml

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone