From patchwork Tue Jun 17 14:56:54 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 32035 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f199.google.com (mail-pd0-f199.google.com [209.85.192.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6A409206A0 for ; Tue, 17 Jun 2014 15:00:01 +0000 (UTC) Received: by mail-pd0-f199.google.com with SMTP id r10sf14406147pdi.6 for ; Tue, 17 Jun 2014 08:00:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:in-reply-to:references:in-reply-to:references:cc:subject :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=nwqf/JEoKXl78OPCU0tjyIkJ7vCH6nWVnvnp3FFgxyo=; b=YExh5MPNyn9UohtIpXmX/k7Gqw/Fd/hw0cxXdiJWZszBbzm8hXQyMAP0pJcukt7+jB H0W5nwuNRtk9gpUimLFb7jq08wlVB3MAGavWid3YtloJtbatOxkUB1XE2RycOx4KlHF3 N8MmWlEOzEcpykfMu8Bn68rIfy5UrZEwVykpKvHccOKwByRVLoFw9fwfOx5wL4RVxNTR lhmwGqR3lqlZOYakz5R8pf6fEWsOh7v/Fd51COuqEfxh81POeATq68MmFDLryDm+JKOz hG7P9u1sn8l6GakJfG5YbEEl2N9nfAokeCvHt/BHIB8P2rHQjcjInt2mGVrXwH3Hwgk3 XjMA== X-Gm-Message-State: ALoCoQmYOZnLpt/EAoZoqidPPx4aYZI9NsKbwJhEVB/IAT9lHFzlpmPMhOQZv181YGS8zNKuBto0 X-Received: by 10.66.162.5 with SMTP id xw5mr830528pab.12.1403017200754; Tue, 17 Jun 2014 08:00:00 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.102.78 with SMTP id v72ls1961209qge.0.gmail; Tue, 17 Jun 2014 08:00:00 -0700 (PDT) X-Received: by 10.52.53.36 with SMTP id y4mr703597vdo.56.1403017200641; Tue, 17 Jun 2014 08:00:00 -0700 (PDT) Received: from mail-vc0-f181.google.com (mail-vc0-f181.google.com [209.85.220.181]) by mx.google.com with ESMTPS id wx3si1831950vdc.10.2014.06.17.08.00.00 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 17 Jun 2014 08:00:00 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.181 as permitted sender) client-ip=209.85.220.181; Received: by mail-vc0-f181.google.com with SMTP id il7so6442934vcb.40 for ; Tue, 17 Jun 2014 08:00:00 -0700 (PDT) X-Received: by 10.58.220.230 with SMTP id pz6mr22008387vec.9.1403017200463; Tue, 17 Jun 2014 08:00:00 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.54.6 with SMTP id vs6csp215780vcb; Tue, 17 Jun 2014 08:00:00 -0700 (PDT) X-Received: by 10.140.83.209 with SMTP id j75mr35701651qgd.42.1403017199868; Tue, 17 Jun 2014 07:59:59 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id 31si14096198qgw.57.2014.06.17.07.59.59 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 17 Jun 2014 07:59:59 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:51150 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wwurf-00016x-Hy for patch@linaro.org; Tue, 17 Jun 2014 10:59:59 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43983) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wwuoz-0005hZ-5K for qemu-devel@nongnu.org; Tue, 17 Jun 2014 10:57:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wwuos-0004QP-83 for qemu-devel@nongnu.org; Tue, 17 Jun 2014 10:57:13 -0400 Received: from [2001:4b98:dc0:45:216:3eff:fe3d:166f] (port=33157 helo=afflict.kos.to) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wwuos-0004Pj-2Y for qemu-devel@nongnu.org; Tue, 17 Jun 2014 10:57:06 -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 AB46E2657B; Tue, 17 Jun 2014 16:57:03 +0200 (CEST) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Tue, 17 Jun 2014 17:56:54 +0300 Message-Id: X-Mailer: git-send-email 1.7.10.4 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 2001:4b98:dc0:45:216:3eff:fe3d:166f Cc: peter.maydell@linaro.org, Riku Voipio Subject: [Qemu-devel] [PULL v2 11/17] 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: riku.voipio@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.181 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Riku Voipio Remove checks of __get_user and the err variable used to control flow with it. Signed-off-by: Riku Voipio Reviewed-by: Peter Maydell --- 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 a486bbe..87e4575 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -2527,7 +2527,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]; @@ -2536,15 +2535,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; @@ -2552,8 +2550,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); @@ -2596,7 +2592,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++) { @@ -2611,8 +2607,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: