bootconfig.c (bdac5c2b243f68ec15f8203c3348ae79fee8e8d8) bootconfig.c (e306220cb7b7c2948f191414ab06851e143b54c1)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Extra Boot Config
4 * Masami Hiramatsu <mhiramat@kernel.org>
5 */
6
7#define pr_fmt(fmt) "bootconfig: " fmt
8

--- 20 unchanged lines hidden (view full) ---

29static char *xbc_data __initdata;
30static size_t xbc_data_size __initdata;
31static struct xbc_node *last_parent __initdata;
32static const char *xbc_err_msg __initdata;
33static int xbc_err_pos __initdata;
34static int open_brace[XBC_DEPTH_MAX] __initdata;
35static int brace_index __initdata;
36
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Extra Boot Config
4 * Masami Hiramatsu <mhiramat@kernel.org>
5 */
6
7#define pr_fmt(fmt) "bootconfig: " fmt
8

--- 20 unchanged lines hidden (view full) ---

29static char *xbc_data __initdata;
30static size_t xbc_data_size __initdata;
31static struct xbc_node *last_parent __initdata;
32static const char *xbc_err_msg __initdata;
33static int xbc_err_pos __initdata;
34static int open_brace[XBC_DEPTH_MAX] __initdata;
35static int brace_index __initdata;
36
37/**
38 * xbc_get_info() - Get the information of loaded boot config
39 * node_size: A pointer to store the number of nodes.
40 * data_size: A pointer to store the size of bootconfig data.
41 *
42 * Get the number of used nodes in @node_size if it is not NULL,
43 * and the size of bootconfig data in @data_size if it is not NULL.
44 * Return 0 if the boot config is initialized, or return -ENODEV.
45 */
46int __init xbc_get_info(int *node_size, size_t *data_size)
47{
48 if (!xbc_data)
49 return -ENODEV;
50
51 if (node_size)
52 *node_size = xbc_node_num;
53 if (data_size)
54 *data_size = xbc_data_size;
55 return 0;
56}
57
37static int __init xbc_parse_error(const char *msg, const char *p)
38{
39 xbc_err_msg = msg;
40 xbc_err_pos = (int)(p - xbc_data);
41
42 return -EINVAL;
43}
44

--- 886 unchanged lines hidden ---
58static int __init xbc_parse_error(const char *msg, const char *p)
59{
60 xbc_err_msg = msg;
61 xbc_err_pos = (int)(p - xbc_data);
62
63 return -EINVAL;
64}
65

--- 886 unchanged lines hidden ---