Skip to content

Commit 8887a86

Browse files
author
Peter Zijlstra
committed
objtool: Delete cleanup()
Perf shows we spend a measurable amount of time spend cleaning up right before we exit anyway. Avoid the needsless work and just terminate. This reduces objtool on vmlinux.o runtime from 5.4s to 4.8s Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Reviewed-by: Miroslav Benes <[email protected]> Acked-by: Josh Poimboeuf <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent 8b5fa6b commit 8887a86

File tree

1 file changed

+0
-19
lines changed

1 file changed

+0
-19
lines changed

tools/objtool/check.c

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2458,23 +2458,6 @@ static int validate_reachable_instructions(struct objtool_file *file)
24582458
return 0;
24592459
}
24602460

2461-
static void cleanup(struct objtool_file *file)
2462-
{
2463-
struct instruction *insn, *tmpinsn;
2464-
struct alternative *alt, *tmpalt;
2465-
2466-
list_for_each_entry_safe(insn, tmpinsn, &file->insn_list, list) {
2467-
list_for_each_entry_safe(alt, tmpalt, &insn->alts, list) {
2468-
list_del(&alt->list);
2469-
free(alt);
2470-
}
2471-
list_del(&insn->list);
2472-
hash_del(&insn->hash);
2473-
free(insn);
2474-
}
2475-
elf_close(file->elf);
2476-
}
2477-
24782461
static struct objtool_file file;
24792462

24802463
int check(const char *_objname, bool orc)
@@ -2542,8 +2525,6 @@ int check(const char *_objname, bool orc)
25422525
}
25432526

25442527
out:
2545-
cleanup(&file);
2546-
25472528
if (ret < 0) {
25482529
/*
25492530
* Fatal error. The binary is corrupt or otherwise broken in

0 commit comments

Comments
 (0)