diff mbox

[11/13] sparc64_set_context: remove __get_user checks

Message ID 966d7a5c06fff74f9d9d45b3faf6cd63a4b4fb49.1398257165.git.riku.voipio@linaro.org
State Superseded
Headers show

Commit Message

Riku Voipio April 23, 2014, 1:12 p.m. UTC
From: Riku Voipio <riku.voipio@linaro.org>

Remove checks of __get_user and the err variable
used to control flow with it.

Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
---
 linux-user/signal.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)
diff mbox

Patch

diff --git a/linux-user/signal.c b/linux-user/signal.c
index efb3562..487fa2f 100644
--- a/linux-user/signal.c
+++ b/linux-user/signal.c
@@ -2547,7 +2547,6 @@  void sparc64_set_context(CPUSPARCState *env)
     target_mc_gregset_t *grp;
     abi_ulong pc, npc, tstate;
     abi_ulong fp, i7, w_addr;
-    int err = 0;
     unsigned int i;
 
     ucp_addr = env->regwptr[UREG_I0];
@@ -2556,15 +2555,14 @@  void sparc64_set_context(CPUSPARCState *env)
     grp  = &ucp->tuc_mcontext.mc_gregs;
     __get_user(pc, &((*grp)[MC_PC]));
     __get_user(npc, &((*grp)[MC_NPC]));
-    if (err || ((pc | npc) & 3))
+    if ((pc | npc) & 3)
         goto do_sigsegv;
     if (env->regwptr[UREG_I1]) {
         target_sigset_t target_set;
         sigset_t set;
 
         if (TARGET_NSIG_WORDS == 1) {
-            if (__get_user(target_set.sig[0], &ucp->tuc_sigmask.sig[0]))
-                goto do_sigsegv;
+            __get_user(target_set.sig[0], &ucp->tuc_sigmask.sig[0]);
         } else {
             abi_ulong *src, *dst;
             src = ucp->tuc_sigmask.sig;
@@ -2572,8 +2570,6 @@  void sparc64_set_context(CPUSPARCState *env)
             for (i = 0; i < TARGET_NSIG_WORDS; i++, dst++, src++) {
                 __get_user(*dst, src);
             }
-            if (err)
-                goto do_sigsegv;
         }
         target_to_host_sigset_internal(&set, &target_set);
         do_sigprocmask(SIG_SETMASK, &set, NULL);
@@ -2616,7 +2612,7 @@  void sparc64_set_context(CPUSPARCState *env)
      * is only restored if fenab is non-zero in:
      *   __get_user(fenab, &(ucp->tuc_mcontext.mc_fpregs.mcfpu_enab));
      */
-    err |= __get_user(env->fprs, &(ucp->tuc_mcontext.mc_fpregs.mcfpu_fprs));
+    __get_user(env->fprs, &(ucp->tuc_mcontext.mc_fpregs.mcfpu_fprs));
     {
         uint32_t *src = ucp->tuc_mcontext.mc_fpregs.mcfpu_fregs.sregs;
         for (i = 0; i < 64; i++, src++) {
@@ -2631,8 +2627,6 @@  void sparc64_set_context(CPUSPARCState *env)
                &(ucp->tuc_mcontext.mc_fpregs.mcfpu_fsr));
     __get_user(env->gsr,
                &(ucp->tuc_mcontext.mc_fpregs.mcfpu_gsr));
-    if (err)
-        goto do_sigsegv;
     unlock_user_struct(ucp, ucp_addr, 0);
     return;
  do_sigsegv: