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: use size_t for key length tracking in xbc_verify_tree()

lib/bootconfig.c:839:24: warning: conversion from 'size_t' to 'int'
may change value [-Wconversion]
lib/bootconfig.c:860:32: warning: conversion from 'size_t' to 'int'
may change value [-Wconversion]
lib/bootconfig.c:860:29: warning: conversion to 'size_t' from 'int'
may change the sign of the result [-Wsign-conversion]

The key length variables len and wlen accumulate strlen() results but
were declared as int, causing truncation and sign-conversion warnings.
Change both to size_t to match the strlen() return type and avoid
mixed-sign arithmetic.

Link: https://lore.kernel.org/all/20260318155919.78168-13-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)
05213e4b 0f219990

+2 -1
+2 -1
lib/bootconfig.c
··· 803 803 804 804 static int __init xbc_verify_tree(void) 805 805 { 806 - int i, depth, len, wlen; 806 + int i, depth; 807 + size_t len, wlen; 807 808 struct xbc_node *n, *m; 808 809 809 810 /* Brace closing */