[PATCH] objtool: remove unneeded variable from add_prefix_symbols()

From: baomingtong001
Date: Wed Jun 14 2023 - 02:37:00 EST


fix the following coccicheck warning:

tools/objtool/check.c:4135:5-13: Unneeded variable: "warnings". Return "0".

Signed-off-by: Mingtong Bao <baomingtong001@xxxxxxxxxx>
---
tools/objtool/check.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index a13c257f80dd..d12de0e2cf00 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -4132,7 +4132,6 @@ static int add_prefix_symbols(struct objtool_file *file)
{
struct section *sec;
struct symbol *func;
- int warnings = 0;

for_each_sec(file, sec) {
if (!(sec->sh.sh_flags & SHF_EXECINSTR))
@@ -4146,7 +4145,7 @@ static int add_prefix_symbols(struct objtool_file *file)
}
}

- return warnings;
+ return 0;
}

static int validate_symbol(struct objtool_file *file, struct section *sec,