Skip to content

Commit ef69de5

Browse files
henryZeIngo Molnar
authored andcommitted
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: a7a9bac ("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
1 parent 000894d commit ef69de5

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

arch/x86/platform/olpc/olpc_dt.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,13 +215,12 @@ static u32 __init olpc_dt_get_board_revision(void)
215215
static int __init olpc_dt_compatible_match(phandle node, const char *compat)
216216
{
217217
char buf[64], *p;
218-
int plen, len;
218+
int plen;
219219

220220
plen = olpc_dt_getproperty(node, "compatible", buf, sizeof(buf));
221221
if (plen <= 0)
222222
return 0;
223223

224-
len = strlen(compat);
225224
for (p = buf; p < buf + plen; p += strlen(p) + 1) {
226225
if (strcmp(p, compat) == 0)
227226
return 1;

0 commit comments

Comments
 (0)