[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20241025074203.1921344-1-zengheng4@huawei.com>
Date: Fri, 25 Oct 2024 15:42:03 +0800
From: Zeng Heng <zengheng4@...wei.com>
To: <hpa@...or.com>, <tglx@...utronix.de>, <mingo@...hat.com>,
<dave.hansen@...ux.intel.com>, <pavel@....cz>,
<sebastian.reichel@...labora.com>, <bp@...en8.de>, <lkundrak@...sk>
CC: <bobo.shaobowang@...wei.com>, <linux-kernel@...r.kernel.org>,
<x86@...nel.org>
Subject: [PATCH] x86/platform/olpc: Fix not used variable 'len'
Fix the following compilation warning:
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]
222 | int plen, len;
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@...wei.com>
---
arch/x86/platform/olpc/olpc_dt.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/arch/x86/platform/olpc/olpc_dt.c b/arch/x86/platform/olpc/olpc_dt.c
index 74ebd6882690..1b91702e89a3 100644
--- a/arch/x86/platform/olpc/olpc_dt.c
+++ b/arch/x86/platform/olpc/olpc_dt.c
@@ -219,13 +219,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;
--
2.25.1
Powered by blists - more mailing lists