summaryrefslogtreecommitdiff
path: root/tools/objtool
diff options
context:
space:
mode:
authorLu Hongfei <luhongfei@vivo.com>2023-05-30 15:56:49 +0800
committerJosh Poimboeuf <jpoimboe@kernel.org>2023-06-07 09:27:11 -0700
commitd49d1666aab51ad3caf79f414aff6b641837a6ea (patch)
tree79fc9350156052c56cf6a9c0a6739521a15908fe /tools/objtool
parentff9a6459bbec06df7da2545020d7383aba13b3fb (diff)
tools: Remove unnecessary variables
There are several places where warnings variables are not needed, remove them and directly return 0. Signed-off-by: Lu Hongfei <luhongfei@vivo.com> Link: https://lore.kernel.org/r/20230530075649.21661-1-luhongfei@vivo.com Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
Diffstat (limited to 'tools/objtool')
-rw-r--r--tools/objtool/check.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index a13c257f80dd..4b869de7e827 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -3799,7 +3799,7 @@ static int validate_unwind_hints(struct objtool_file *file, struct section *sec)
static int validate_unret(struct objtool_file *file, struct instruction *insn)
{
struct instruction *next, *dest;
- int ret, warnings = 0;
+ int ret;
for (;;) {
next = next_insn_to_validate(file, insn);
@@ -3897,7 +3897,7 @@ static int validate_unret(struct objtool_file *file, struct instruction *insn)
insn = next;
}
- return warnings;
+ return 0;
}
/*
@@ -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,