]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
lib/bootconfig: fix signed comparison in xbc_node_get_data()
authorJosh Law <objecting@objecting.org>
Wed, 18 Mar 2026 15:59:15 +0000 (15:59 +0000)
committerMasami Hiramatsu (Google) <mhiramat@kernel.org>
Wed, 18 Mar 2026 23:44:26 +0000 (08:44 +0900)
  lib/bootconfig.c:188:28: warning: comparison of integer expressions
  of different signedness: 'int' and 'size_t' [-Wsign-compare]

The local variable 'offset' is declared as int, but xbc_data_size is
size_t.  Change the type to size_t to match and eliminate the warning.

Link: https://lore.kernel.org/all/20260318155919.78168-10-objecting@objecting.org/
Signed-off-by: Josh Law <objecting@objecting.org>
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
lib/bootconfig.c

index 8c50e942d7479cff40fe9618dfcc3d5150afb5ba..94ae6662531d577e2ef9ef415e8e72fb20924d00 100644 (file)
@@ -183,7 +183,7 @@ struct xbc_node * __init xbc_node_get_next(struct xbc_node *node)
  */
 const char * __init xbc_node_get_data(struct xbc_node *node)
 {
-       int offset = node->data & ~XBC_VALUE;
+       size_t offset = node->data & ~XBC_VALUE;
 
        if (WARN_ON(offset >= xbc_data_size))
                return NULL;