diff options
| author | Josh Law <objecting@objecting.org> | 2026-03-19 02:43:23 +0300 |
|---|---|---|
| committer | Masami Hiramatsu (Google) <mhiramat@kernel.org> | 2026-03-19 02:43:23 +0300 |
| commit | bf45f7c591939196d043e30bc5961ef30fcff52d (patch) | |
| tree | c3aafbc5da2ef3317629694c27d8c3081b1f5d31 | |
| parent | 7eaf074e9109860bfc2f7b01958059e9f2d4a76e (diff) | |
| download | linux-bf45f7c591939196d043e30bc5961ef30fcff52d.tar.xz | |
lib/bootconfig: narrow flag parameter type from uint32_t to uint16_t
The flag parameter in the node creation helpers only ever carries
XBC_KEY (0) or XBC_VALUE (0x8000), both of which fit in uint16_t.
Using uint16_t matches the width of xbc_node.data where the flag is
ultimately stored.
Link: https://lore.kernel.org/all/20260318155919.78168-3-objecting@objecting.org/
Signed-off-by: Josh Law <objecting@objecting.org>
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
| -rw-r--r-- | lib/bootconfig.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/bootconfig.c b/lib/bootconfig.c index 874e04f9a0bd..ee2f072831aa 100644 --- a/lib/bootconfig.c +++ b/lib/bootconfig.c @@ -408,7 +408,7 @@ const char * __init xbc_node_find_next_key_value(struct xbc_node *root, /* XBC parse and tree build */ -static int __init xbc_init_node(struct xbc_node *node, char *data, uint32_t flag) +static int __init xbc_init_node(struct xbc_node *node, char *data, uint16_t flag) { unsigned long offset = data - xbc_data; @@ -422,7 +422,7 @@ static int __init xbc_init_node(struct xbc_node *node, char *data, uint32_t flag return 0; } -static struct xbc_node * __init xbc_add_node(char *data, uint32_t flag) +static struct xbc_node * __init xbc_add_node(char *data, uint16_t flag) { struct xbc_node *node; @@ -452,7 +452,7 @@ static inline __init struct xbc_node *xbc_last_child(struct xbc_node *node) return node; } -static struct xbc_node * __init __xbc_add_sibling(char *data, uint32_t flag, bool head) +static struct xbc_node * __init __xbc_add_sibling(char *data, uint16_t flag, bool head) { struct xbc_node *sib, *node = xbc_add_node(data, flag); @@ -480,17 +480,17 @@ static struct xbc_node * __init __xbc_add_sibling(char *data, uint32_t flag, boo return node; } -static inline struct xbc_node * __init xbc_add_sibling(char *data, uint32_t flag) +static inline struct xbc_node * __init xbc_add_sibling(char *data, uint16_t flag) { return __xbc_add_sibling(data, flag, false); } -static inline struct xbc_node * __init xbc_add_head_sibling(char *data, uint32_t flag) +static inline struct xbc_node * __init xbc_add_head_sibling(char *data, uint16_t flag) { return __xbc_add_sibling(data, flag, true); } -static inline __init struct xbc_node *xbc_add_child(char *data, uint32_t flag) +static inline __init struct xbc_node *xbc_add_child(char *data, uint16_t flag) { struct xbc_node *node = xbc_add_sibling(data, flag); |
