Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Josh Law and committed by
Masami Hiramatsu (Google)
bf45f7c5 7eaf074e

+6 -6
+6 -6
lib/bootconfig.c
··· 408 408 409 409 /* XBC parse and tree build */ 410 410 411 - static int __init xbc_init_node(struct xbc_node *node, char *data, uint32_t flag) 411 + static int __init xbc_init_node(struct xbc_node *node, char *data, uint16_t flag) 412 412 { 413 413 unsigned long offset = data - xbc_data; 414 414 ··· 422 422 return 0; 423 423 } 424 424 425 - static struct xbc_node * __init xbc_add_node(char *data, uint32_t flag) 425 + static struct xbc_node * __init xbc_add_node(char *data, uint16_t flag) 426 426 { 427 427 struct xbc_node *node; 428 428 ··· 452 452 return node; 453 453 } 454 454 455 - static struct xbc_node * __init __xbc_add_sibling(char *data, uint32_t flag, bool head) 455 + static struct xbc_node * __init __xbc_add_sibling(char *data, uint16_t flag, bool head) 456 456 { 457 457 struct xbc_node *sib, *node = xbc_add_node(data, flag); 458 458 ··· 480 480 return node; 481 481 } 482 482 483 - static inline struct xbc_node * __init xbc_add_sibling(char *data, uint32_t flag) 483 + static inline struct xbc_node * __init xbc_add_sibling(char *data, uint16_t flag) 484 484 { 485 485 return __xbc_add_sibling(data, flag, false); 486 486 } 487 487 488 - static inline struct xbc_node * __init xbc_add_head_sibling(char *data, uint32_t flag) 488 + static inline struct xbc_node * __init xbc_add_head_sibling(char *data, uint16_t flag) 489 489 { 490 490 return __xbc_add_sibling(data, flag, true); 491 491 } 492 492 493 - static inline __init struct xbc_node *xbc_add_child(char *data, uint32_t flag) 493 + static inline __init struct xbc_node *xbc_add_child(char *data, uint16_t flag) 494 494 { 495 495 struct xbc_node *node = xbc_add_sibling(data, flag); 496 496