Skip to content

Commit

Permalink
x86/platform/olpc: Remove unused variable 'len' in olpc_dt_compatible…
Browse files Browse the repository at this point in the history
…_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
  • Loading branch information
Zeng Heng authored and Ingo Molnar committed Mar 6, 2025
1 parent 000894d commit ef69de5
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions arch/x86/platform/olpc/olpc_dt.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,13 +215,12 @@ static u32 __init olpc_dt_get_board_revision(void)
static int __init olpc_dt_compatible_match(phandle node, const char *compat)
{
char buf[64], *p;
int plen, len;
int plen;

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

len = strlen(compat);
for (p = buf; p < buf + plen; p += strlen(p) + 1) {
if (strcmp(p, compat) == 0)
return 1;
Expand Down

0 comments on commit ef69de5

Please sign in to comment.