summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Law <objecting@objecting.org>2026-03-18 18:59:18 +0300
committerMasami Hiramatsu (Google) <mhiramat@kernel.org>2026-03-19 02:44:58 +0300
commit05213e4b10b9bd2e121d3e73428404b4f920dd9a (patch)
tree4804e688849b06d7a7c2c5a26b605a3213373ebb
parent0f2199904188abd5477a6517a9ce525bdc2dc01d (diff)
downloadlinux-05213e4b10b9bd2e121d3e73428404b4f920dd9a.tar.xz
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>
-rw-r--r--lib/bootconfig.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/bootconfig.c b/lib/bootconfig.c
index 1f84748607b4..343aa9629464 100644
--- a/lib/bootconfig.c
+++ b/lib/bootconfig.c
@@ -803,7 +803,8 @@ static int __init xbc_close_brace(char **k, char *n)
static int __init xbc_verify_tree(void)
{
- int i, depth, len, wlen;
+ int i, depth;
+ size_t len, wlen;
struct xbc_node *n, *m;
/* Brace closing */