diff mbox series

[v3,20/27] linux-user/ppc: Simplify encode_trampoline

Message ID 20210924165926.752809-21-richard.henderson@linaro.org
State Superseded
Headers show
Series linux-user: Move signal trampolines to new page | expand

Commit Message

Richard Henderson Sept. 24, 2021, 4:59 p.m. UTC
The sigret parameter is never 0, and even if it was the encoding
of the LI instruction would still work.

Reported-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

---
 linux-user/ppc/signal.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

-- 
2.25.1

Comments

Philippe Mathieu-Daudé Sept. 24, 2021, 5:55 p.m. UTC | #1
On 9/24/21 18:59, Richard Henderson wrote:
> The sigret parameter is never 0, and even if it was the encoding

> of the LI instruction would still work.

> 

> Reported-by: Peter Maydell <peter.maydell@linaro.org>

> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

> ---

>   linux-user/ppc/signal.c | 6 ++----

>   1 file changed, 2 insertions(+), 4 deletions(-)


Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
diff mbox series

Patch

diff --git a/linux-user/ppc/signal.c b/linux-user/ppc/signal.c
index e4d0dfa3bf..77f37b9f01 100644
--- a/linux-user/ppc/signal.c
+++ b/linux-user/ppc/signal.c
@@ -309,10 +309,8 @@  static void save_user_regs(CPUPPCState *env, struct target_mcontext *frame)
 static void encode_trampoline(int sigret, uint32_t *tramp)
 {
     /* Set up the sigreturn trampoline: li r0,sigret; sc.  */
-    if (sigret) {
-        __put_user(0x38000000 | sigret, &tramp[0]);
-        __put_user(0x44000002, &tramp[1]);
-    }
+    __put_user(0x38000000 | sigret, &tramp[0]);
+    __put_user(0x44000002, &tramp[1]);
 }
 
 static void restore_user_regs(CPUPPCState *env,