From patchwork Fri Jun 6 09:46:55 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 356762 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 07AAF140093 for ; Fri, 6 Jun 2014 19:49:40 +1000 (EST) Received: from localhost ([::1]:46193 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WsqmH-0002z5-NM for incoming@patchwork.ozlabs.org; Fri, 06 Jun 2014 05:49:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35261) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wsqju-0006Ft-BA for qemu-devel@nongnu.org; Fri, 06 Jun 2014 05:47:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wsqjm-0001Wt-BH for qemu-devel@nongnu.org; Fri, 06 Jun 2014 05:47:10 -0400 Received: from afflict.kos.to ([92.243.29.197]:38375) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wsqjm-0001WM-4o for qemu-devel@nongnu.org; Fri, 06 Jun 2014 05:47:02 -0400 Received: from afflict.kos.to (afflict [92.243.29.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by afflict.kos.to (Postfix) with ESMTPSA id DD2772657B; Fri, 6 Jun 2014 11:46:59 +0200 (CEST) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Fri, 6 Jun 2014 12:46:55 +0300 Message-Id: <1402048017-30604-12-git-send-email-riku.voipio@linaro.org> X-Mailer: git-send-email 1.7.10.4 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 92.243.29.197 Cc: Riku Voipio Subject: [Qemu-devel] [PATCH v2 11/13] signal/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 052c03a..29d87f9 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -2514,7 +2514,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]; @@ -2523,15 +2522,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; @@ -2539,8 +2537,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); @@ -2583,7 +2579,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++) { @@ -2598,8 +2594,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: