Skip to content

Commit

Permalink
powerpc/ptrace: Refactor regs_set_return_{msr/ip}
Browse files Browse the repository at this point in the history
regs_set_return_msr() and regs_set_return_ip() have a copy
of the code of set_return_regs_changed().

Call the later instead.

Signed-off-by: Christophe Leroy <[email protected]>
Signed-off-by: Michael Ellerman <[email protected]>
Link: https://lore.kernel.org/r/baf64a91557d3811c155616a6aa23ed7b3b21da4.1624619582.git.christophe.leroy@csgroup.eu
  • Loading branch information
chleroy authored and mpe committed Jun 25, 2021
1 parent 5f0f95f commit cae4644
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions arch/powerpc/include/asm/ptrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,19 +146,13 @@ static inline void set_return_regs_changed(void)
static inline void regs_set_return_ip(struct pt_regs *regs, unsigned long ip)
{
regs->nip = ip;
#ifdef CONFIG_PPC_BOOK3S_64
local_paca->hsrr_valid = 0;
local_paca->srr_valid = 0;
#endif
set_return_regs_changed();
}

static inline void regs_set_return_msr(struct pt_regs *regs, unsigned long msr)
{
regs->msr = msr;
#ifdef CONFIG_PPC_BOOK3S_64
local_paca->hsrr_valid = 0;
local_paca->srr_valid = 0;
#endif
set_return_regs_changed();
}

static inline void regs_add_return_ip(struct pt_regs *regs, long offset)
Expand Down

0 comments on commit cae4644

Please sign in to comment.