Skip to content

Commit

Permalink
bootconfig: Rename xbc_destroy_all() to xbc_exit()
Browse files Browse the repository at this point in the history
Avoid using this noisy name and use more calm one.
This is just a name change. No functional change.

Link: https://lkml.kernel.org/r/163187295918.2366983.5231840238429996027.stgit@devnote2

Signed-off-by: Masami Hiramatsu <[email protected]>
Signed-off-by: Steven Rostedt (VMware) <[email protected]>
  • Loading branch information
mhiramat authored and rostedt committed Oct 11, 2021
1 parent f30f00c commit 115d4d0
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion include/linux/bootconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ int __init xbc_init(const char *buf, size_t size, const char **emsg, int *epos);
int __init xbc_get_info(int *node_size, size_t *data_size);

/* XBC cleanup data structures */
void __init xbc_destroy_all(void);
void __init xbc_exit(void);

/* Debug dump functions */
void __init xbc_debug_dump(void);
Expand Down
2 changes: 1 addition & 1 deletion init/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ static void __init setup_boot_config(void)

static void __init exit_boot_config(void)
{
xbc_destroy_all();
xbc_exit();
}

#else /* !CONFIG_BOOT_CONFIG */
Expand Down
8 changes: 4 additions & 4 deletions lib/bootconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -802,13 +802,13 @@ static int __init xbc_verify_tree(void)
}

/**
* xbc_destroy_all() - Clean up all parsed bootconfig
* xbc_exit() - Clean up all parsed bootconfig
*
* This clears all data structures of parsed bootconfig on memory.
* If you need to reuse xbc_init() with new boot config, you can
* use this.
*/
void __init xbc_destroy_all(void)
void __init xbc_exit(void)
{
memblock_free_ptr(xbc_data, xbc_data_size);
xbc_data = NULL;
Expand Down Expand Up @@ -869,7 +869,7 @@ int __init xbc_init(const char *data, size_t size, const char **emsg, int *epos)
if (!xbc_nodes) {
if (emsg)
*emsg = "Failed to allocate bootconfig nodes";
xbc_destroy_all();
xbc_exit();
return -ENOMEM;
}
memset(xbc_nodes, 0, sizeof(struct xbc_node) * XBC_NODE_MAX);
Expand Down Expand Up @@ -925,7 +925,7 @@ int __init xbc_init(const char *data, size_t size, const char **emsg, int *epos)
*epos = xbc_err_pos;
if (emsg)
*emsg = xbc_err_msg;
xbc_destroy_all();
xbc_exit();
} else
ret = xbc_node_num;

Expand Down
2 changes: 1 addition & 1 deletion tools/bootconfig/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ static int apply_xbc(const char *path, const char *xbc_path)
printf("\tChecksum: %d\n", (unsigned int)csum);

/* TODO: Check the options by schema */
xbc_destroy_all();
xbc_exit();
free(buf);

/* Remove old boot config if exists */
Expand Down

0 comments on commit 115d4d0

Please sign in to comment.