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

x86/platform/olpc: Remove unused variable 'len' in olpc_dt_compatible_match()

The following build warning highlights some unused code:

arch/x86/platform/olpc/olpc_dt.c: In function ‘olpc_dt_compatible_match’:
arch/x86/platform/olpc/olpc_dt.c:222:12: warning: variable ‘len’ set but not used [-Wunused-but-set-variable]

The compiler is right, the local variable 'len' is set but never used,
so remove it.

Fixes: a7a9bacb9a32 ("x86/platform/olpc: Use a correct version when making up a battery node")
Signed-off-by: Zeng Heng <zengheng4@huawei.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20241025074203.1921344-1-zengheng4@huawei.com

authored by

Zeng Heng and committed by
Ingo Molnar
ef69de53 000894d8

+1 -2
+1 -2
arch/x86/platform/olpc/olpc_dt.c
··· 215 215 static int __init olpc_dt_compatible_match(phandle node, const char *compat) 216 216 { 217 217 char buf[64], *p; 218 - int plen, len; 218 + int plen; 219 219 220 220 plen = olpc_dt_getproperty(node, "compatible", buf, sizeof(buf)); 221 221 if (plen <= 0) 222 222 return 0; 223 223 224 - len = strlen(compat); 225 224 for (p = buf; p < buf + plen; p += strlen(p) + 1) { 226 225 if (strcmp(p, compat) == 0) 227 226 return 1;