summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMasami Hiramatsu <mhiramat@kernel.org>2020-02-05 16:50:13 +0300
committerSteven Rostedt (VMware) <rostedt@goodmis.org>2020-02-06 01:17:05 +0300
commit0f0d0a77ccbdc6bfe51c0d184f92d99ebcc2e809 (patch)
treee7e3dcc7f7315ccd1b2572b15480f0110e6283d5 /lib
parent597c0e3b4540972580ab36bcc8aa34394bd88cfb (diff)
downloadlinux-0f0d0a77ccbdc6bfe51c0d184f92d99ebcc2e809.tar.xz
tools/bootconfig: Show the number of bootconfig nodes
Show the number of bootconfig nodes when applying new bootconfig to initrd. Since there are limitations of bootconfig not only in its filesize, but also the number of nodes, the number should be shown when applying so that user can get the feeling of scale of current bootconfig. Link: http://lkml.kernel.org/r/158091061337.27924.10886706631693823982.stgit@devnote2 Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/bootconfig.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/bootconfig.c b/lib/bootconfig.c
index a98ae136529c..afb2e767e6fe 100644
--- a/lib/bootconfig.c
+++ b/lib/bootconfig.c
@@ -728,7 +728,8 @@ void __init xbc_destroy_all(void)
*
* This parses the boot config text in @buf. @buf must be a
* null terminated string and smaller than XBC_DATA_MAX.
- * Return 0 if succeeded, or -errno if there is any error.
+ * Return the number of stored nodes (>0) if succeeded, or -errno
+ * if there is any error.
*/
int __init xbc_init(char *buf)
{
@@ -788,6 +789,8 @@ int __init xbc_init(char *buf)
if (ret < 0)
xbc_destroy_all();
+ else
+ ret = xbc_node_num;
return ret;
}