mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 14:53:58 -04:00
lib/bootconfig: clean up comment typos and bracing
Fixes kerneldoc typos ("initiized" and "uder") and adds a missing blank line.
Also fixes inconsistent if/else bracing in __xbc_add_key() and elsewhere.
Link: https://lore.kernel.org/all/20260318155919.78168-2-objecting@objecting.org/
Signed-off-by: Josh Law <objecting@objecting.org>
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
This commit is contained in:
committed by
Masami Hiramatsu (Google)
parent
3b2c2ab4ce
commit
7eaf074e91
@@ -79,6 +79,7 @@ static inline void xbc_free_mem(void *addr, size_t size, bool early)
|
||||
free(addr);
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* xbc_get_info() - Get the information of loaded boot config
|
||||
* @node_size: A pointer to store the number of nodes.
|
||||
@@ -112,7 +113,7 @@ static int __init xbc_parse_error(const char *msg, const char *p)
|
||||
* xbc_root_node() - Get the root node of extended boot config
|
||||
*
|
||||
* Return the address of root node of extended boot config. If the
|
||||
* extended boot config is not initiized, return NULL.
|
||||
* extended boot config is not initialized, return NULL.
|
||||
*/
|
||||
struct xbc_node * __init xbc_root_node(void)
|
||||
{
|
||||
@@ -364,7 +365,7 @@ struct xbc_node * __init xbc_node_find_next_leaf(struct xbc_node *root,
|
||||
node = xbc_node_get_parent(node);
|
||||
if (node == root)
|
||||
return NULL;
|
||||
/* User passed a node which is not uder parent */
|
||||
/* User passed a node which is not under parent */
|
||||
if (WARN_ON(!node))
|
||||
return NULL;
|
||||
}
|
||||
@@ -472,8 +473,9 @@ static struct xbc_node * __init __xbc_add_sibling(char *data, uint32_t flag, boo
|
||||
sib->next = xbc_node_index(node);
|
||||
}
|
||||
}
|
||||
} else
|
||||
} else {
|
||||
xbc_parse_error("Too many nodes", data);
|
||||
}
|
||||
|
||||
return node;
|
||||
}
|
||||
@@ -655,9 +657,9 @@ static int __init __xbc_add_key(char *k)
|
||||
if (unlikely(xbc_node_num == 0))
|
||||
goto add_node;
|
||||
|
||||
if (!last_parent) /* the first level */
|
||||
if (!last_parent) { /* the first level */
|
||||
node = find_match_node(xbc_nodes, k);
|
||||
else {
|
||||
} else {
|
||||
child = xbc_node_get_child(last_parent);
|
||||
/* Since the value node is the first child, skip it. */
|
||||
if (child && xbc_node_is_value(child))
|
||||
@@ -665,9 +667,9 @@ static int __init __xbc_add_key(char *k)
|
||||
node = find_match_node(child, k);
|
||||
}
|
||||
|
||||
if (node)
|
||||
if (node) {
|
||||
last_parent = node;
|
||||
else {
|
||||
} else {
|
||||
add_node:
|
||||
node = xbc_add_child(k, XBC_KEY);
|
||||
if (!node)
|
||||
@@ -992,8 +994,9 @@ int __init xbc_init(const char *data, size_t size, const char **emsg, int *epos)
|
||||
if (emsg)
|
||||
*emsg = xbc_err_msg;
|
||||
_xbc_exit(true);
|
||||
} else
|
||||
} else {
|
||||
ret = xbc_node_num;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user