summaryrefslogtreecommitdiff
path: root/include/linux/bootconfig.h
diff options
context:
space:
mode:
authorMasami Hiramatsu <mhiramat@kernel.org>2020-03-03 14:24:50 +0300
committerSteven Rostedt (VMware) <rostedt@goodmis.org>2020-03-04 01:38:42 +0300
commit89b74cac7834734d6b2733204c639917d3826083 (patch)
treed13cb370aedac7bbb7b9d67f7194de31ad01d5da /include/linux/bootconfig.h
parent306b69dce9269df116bfa94319b1b827c22d5794 (diff)
downloadlinux-89b74cac7834734d6b2733204c639917d3826083.tar.xz
tools/bootconfig: Show line and column in parse error
Show line and column when we got a parse error in bootconfig tool. Current lib/bootconfig shows the parse error with byte offset, but that is not human readable. This makes xbc_init() not showing error message itself but able to pass the error message and position to caller, so that the caller can decode it and show the error message with line number and columns. With this patch, bootconfig tool shows an error with line:column as below. $ cat samples/bad-dotword.bconf # do not start keyword with . key { .word = 1 } $ ./bootconfig -a samples/bad-dotword.bconf initrd Parse Error: Invalid keyword at 3:3 Link: http://lkml.kernel.org/r/158323469002.10560.4023923847704522760.stgit@devnote2 Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Diffstat (limited to 'include/linux/bootconfig.h')
-rw-r--r--include/linux/bootconfig.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/bootconfig.h b/include/linux/bootconfig.h
index d11e183fcb54..9903088891fa 100644
--- a/include/linux/bootconfig.h
+++ b/include/linux/bootconfig.h
@@ -216,7 +216,8 @@ static inline int __init xbc_node_compose_key(struct xbc_node *node,
}
/* XBC node initializer */
-int __init xbc_init(char *buf);
+int __init xbc_init(char *buf, const char **emsg, int *epos);
+
/* XBC cleanup data structures */
void __init xbc_destroy_all(void);