diff options
author | Julien Thierry <jthierry@redhat.com> | 2020-09-15 08:53:16 +0100 |
---|---|---|
committer | Josh Poimboeuf <jpoimboe@redhat.com> | 2020-09-18 12:02:27 -0500 |
commit | f4f803984c3685f416a74e9e2fa7d39bdafbe02b (patch) | |
tree | 520eb6f66a114a076d9df5d0e6284932cd7881e9 /tools | |
parent | edea9e6bcbeaa41718b022a8b99ffddef2330bbc (diff) | |
download | linux-stable-f4f803984c3685f416a74e9e2fa7d39bdafbe02b.tar.gz linux-stable-f4f803984c3685f416a74e9e2fa7d39bdafbe02b.tar.bz2 linux-stable-f4f803984c3685f416a74e9e2fa7d39bdafbe02b.zip |
objtool: Remove useless tests before save_reg()
save_reg already checks that the register being saved does not already
have a saved state.
Remove redundant checks before processing a register storing operation.
Signed-off-by: Julien Thierry <jthierry@redhat.com>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/objtool/check.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/tools/objtool/check.c b/tools/objtool/check.c index 4e2f703b6a25..fd2edab8e672 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -2030,7 +2030,7 @@ static int update_cfi_state(struct instruction *insn, struct cfi_state *cfi, /* drap: push %rbp */ cfi->stack_size = 0; - } else if (regs[op->src.reg].base == CFI_UNDEFINED) { + } else { /* drap: push %reg */ save_reg(cfi, op->src.reg, CFI_BP, -cfi->stack_size); @@ -2059,9 +2059,7 @@ static int update_cfi_state(struct instruction *insn, struct cfi_state *cfi, /* save drap offset so we know when to restore it */ cfi->drap_offset = op->dest.offset; - } - - else if (regs[op->src.reg].base == CFI_UNDEFINED) { + } else { /* drap: mov reg, disp(%rbp) */ save_reg(cfi, op->src.reg, CFI_BP, op->dest.offset); |