diff options
author | Christophe Leroy <christophe.leroy@csgroup.eu> | 2020-08-18 19:19:31 +0200 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2020-12-03 15:01:14 +0100 |
commit | f1cf4f93de2ff66313a091320d7683735816a0bc (patch) | |
tree | a3521e7b62e66725a52799754b052dee616db925 /arch | |
parent | powerpc/signal32: Switch handle_rt_signal32() to user_access_begin() logic (diff) | |
download | linux-f1cf4f93de2ff66313a091320d7683735816a0bc.tar.xz linux-f1cf4f93de2ff66313a091320d7683735816a0bc.zip |
powerpc/signal32: Remove ifdefery in middle of if/else
MSR_TM_ACTIVE() is always defined and returns always 0 when
CONFIG_PPC_TRANSACTIONAL_MEM is not selected, so the awful
ifdefery in the middle of an if/else can be removed.
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/f3c36d687e4228f58d5c207a4036aa9ddcc7420a.1597770847.git.christophe.leroy@csgroup.eu
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/kernel/signal_32.c | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/arch/powerpc/kernel/signal_32.c b/arch/powerpc/kernel/signal_32.c index 93c2d6304831..310d3b8d9ad5 100644 --- a/arch/powerpc/kernel/signal_32.c +++ b/arch/powerpc/kernel/signal_32.c @@ -447,6 +447,12 @@ static int save_tm_user_regs(struct pt_regs *regs, struct mcontext __user *frame return 0; } +#else +static int save_tm_user_regs(struct pt_regs *regs, struct mcontext __user *frame, + struct mcontext __user *tm_frame, unsigned long msr) +{ + return 0; +} #endif /* @@ -732,10 +738,8 @@ int handle_rt_signal32(struct ksignal *ksig, sigset_t *oldset, unsigned long newsp = 0; unsigned long tramp; struct pt_regs *regs = tsk->thread.regs; -#ifdef CONFIG_PPC_TRANSACTIONAL_MEM /* Save the thread's msr before get_tm_stackpointer() changes it */ unsigned long msr = regs->msr; -#endif /* Set up Signal Frame */ frame = get_sigframe(ksig, tsk, sizeof(*frame), 1); @@ -786,14 +790,10 @@ int handle_rt_signal32(struct ksignal *ksig, sigset_t *oldset, if (tramp == (unsigned long)mctx->mc_pad) flush_icache_range(tramp, tramp + 2 * sizeof(unsigned long)); -#ifdef CONFIG_PPC_TRANSACTIONAL_MEM if (MSR_TM_ACTIVE(msr)) { if (save_tm_user_regs(regs, mctx, tm_mctx, msr)) goto badframe; - } - else -#endif - { + } else { if (save_user_regs(regs, mctx, tm_mctx, 1)) goto badframe; } @@ -842,10 +842,8 @@ int handle_signal32(struct ksignal *ksig, sigset_t *oldset, unsigned long newsp = 0; unsigned long tramp; struct pt_regs *regs = tsk->thread.regs; -#ifdef CONFIG_PPC_TRANSACTIONAL_MEM /* Save the thread's msr before get_tm_stackpointer() changes it */ unsigned long msr = regs->msr; -#endif /* Set up Signal Frame */ frame = get_sigframe(ksig, tsk, sizeof(*frame), 1); @@ -883,14 +881,10 @@ int handle_signal32(struct ksignal *ksig, sigset_t *oldset, if (tramp == (unsigned long)mctx->mc_pad) flush_icache_range(tramp, tramp + 2 * sizeof(unsigned long)); -#ifdef CONFIG_PPC_TRANSACTIONAL_MEM if (MSR_TM_ACTIVE(msr)) { if (save_tm_user_regs(regs, mctx, tm_mctx, msr)) goto badframe; - } - else -#endif - { + } else { if (save_user_regs(regs, mctx, tm_mctx, 1)) goto badframe; } |