Commit d49d1666 authored by Lu Hongfei's avatar Lu Hongfei Committed by Josh Poimboeuf

tools: Remove unnecessary variables

There are several places where warnings variables are not needed,
remove them and directly return 0.
Signed-off-by: default avatarLu Hongfei <luhongfei@vivo.com>
Link: https://lore.kernel.org/r/20230530075649.21661-1-luhongfei@vivo.comSigned-off-by: default avatarJosh Poimboeuf <jpoimboe@kernel.org>
parent ff9a6459
...@@ -3799,7 +3799,7 @@ static int validate_unwind_hints(struct objtool_file *file, struct section *sec) ...@@ -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) static int validate_unret(struct objtool_file *file, struct instruction *insn)
{ {
struct instruction *next, *dest; struct instruction *next, *dest;
int ret, warnings = 0; int ret;
for (;;) { for (;;) {
next = next_insn_to_validate(file, insn); next = next_insn_to_validate(file, insn);
...@@ -3897,7 +3897,7 @@ static int validate_unret(struct objtool_file *file, struct instruction *insn) ...@@ -3897,7 +3897,7 @@ static int validate_unret(struct objtool_file *file, struct instruction *insn)
insn = next; insn = next;
} }
return warnings; return 0;
} }
/* /*
...@@ -4132,7 +4132,6 @@ static int add_prefix_symbols(struct objtool_file *file) ...@@ -4132,7 +4132,6 @@ static int add_prefix_symbols(struct objtool_file *file)
{ {
struct section *sec; struct section *sec;
struct symbol *func; struct symbol *func;
int warnings = 0;
for_each_sec(file, sec) { for_each_sec(file, sec) {
if (!(sec->sh.sh_flags & SHF_EXECINSTR)) if (!(sec->sh.sh_flags & SHF_EXECINSTR))
...@@ -4146,7 +4145,7 @@ static int add_prefix_symbols(struct objtool_file *file) ...@@ -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, static int validate_symbol(struct objtool_file *file, struct section *sec,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment