From patchwork Wed Apr 23 13:12:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 341852 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 7F4B3140124 for ; Wed, 23 Apr 2014 23:18:45 +1000 (EST) Received: from localhost ([::1]:60937 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wcx4V-0007Zq-3F for incoming@patchwork.ozlabs.org; Wed, 23 Apr 2014 09:18:43 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50067) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WcwyF-0001kt-MM for qemu-devel@nongnu.org; Wed, 23 Apr 2014 09:12:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wcwy8-0001K0-QX for qemu-devel@nongnu.org; Wed, 23 Apr 2014 09:12:15 -0400 Received: from afflict.kos.to ([92.243.29.197]:42807) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wcwy8-0001J0-JH for qemu-devel@nongnu.org; Wed, 23 Apr 2014 09:12:08 -0400 Received: from localhost.localdomain (afflict [92.243.29.197]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by afflict.kos.to (Postfix) with ESMTPSA id 3327C264D9 for ; Wed, 23 Apr 2014 15:12:06 +0200 (CEST) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Wed, 23 Apr 2014 16:12:02 +0300 Message-Id: <966d7a5c06fff74f9d9d45b3faf6cd63a4b4fb49.1398257165.git.riku.voipio@linaro.org> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 92.243.29.197 Subject: [Qemu-devel] [PATCH 11/13] sparc64_set_context: remove __get_user checks X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Riku Voipio Remove checks of __get_user and the err variable used to control flow with it. Signed-off-by: Riku Voipio --- linux-user/signal.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) 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: