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: 31469 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f72.google.com (mail-oa0-f72.google.com [209.85.219.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9FCB4203C3 for ; Fri, 6 Jun 2014 09:50:05 +0000 (UTC) Received: by mail-oa0-f72.google.com with SMTP id l6sf11279224oag.7 for ; Fri, 06 Jun 2014 02:50:03 -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: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=nhkcNk30v4RHNiCbF3tT3gLIEd54yGUE7969OacspaM=; b=Dw+cl9QDKWFl8aF4wb06+nA7pSK8gpcRF7Y7nFRgtT5VG+qZORajBYVHYdg0N6cwZd L05dJggm4pzpi7T2qoxAYO9ToYF90+9vBHCPBasVAionnzKOV4xFA8Ga3vgtwuPKy+ht 3C+B7gUZfGEvAWY5QcFomXIg/AmNLEUa170MVSoYn4idG1khGkajA/XWV98PBeGIYLSU iFomG9N5Qe4ESKxJJgVWVECWVfGvT88KaLf9Nb/S0krQKyw5ZjnARlD1B+W14VIVMejs U/g2wuMSIqZGjo7CdUjplHTvfH/RRBAOUvjpTq4dgh1AuPOB4TEtvmZ7sEsXTlv3bYO4 r34g== X-Gm-Message-State: ALoCoQk1Cxju129rmgG0HBqMYc7bFgYaif0Sjghr2v4mraQUMRQvIqFbscaYBJDM8CFV1TyHydKg X-Received: by 10.182.105.230 with SMTP id gp6mr1937719obb.18.1402048203004; Fri, 06 Jun 2014 02:50:03 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.80.139 with SMTP id c11ls628145qgd.66.gmail; Fri, 06 Jun 2014 02:50:02 -0700 (PDT) X-Received: by 10.220.12.66 with SMTP id w2mr3304360vcw.15.1402048202909; Fri, 06 Jun 2014 02:50:02 -0700 (PDT) Received: from mail-vc0-f170.google.com (mail-vc0-f170.google.com [209.85.220.170]) by mx.google.com with ESMTPS id pa17si5742753veb.51.2014.06.06.02.50.02 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 06 Jun 2014 02:50:02 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.170 as permitted sender) client-ip=209.85.220.170; Received: by mail-vc0-f170.google.com with SMTP id lc6so2673389vcb.1 for ; Fri, 06 Jun 2014 02:50:02 -0700 (PDT) X-Received: by 10.52.145.114 with SMTP id st18mr1723633vdb.8.1402048202833; Fri, 06 Jun 2014 02:50:02 -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 vs6csp84327vcb; Fri, 6 Jun 2014 02:50:02 -0700 (PDT) X-Received: by 10.140.42.165 with SMTP id c34mr6462642qga.40.1402048202420; Fri, 06 Jun 2014 02:50:02 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id e8si11983743qgf.40.2014.06.06.02.50.02 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 06 Jun 2014 02:50:02 -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]:46193 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wsqmg-0002z5-2a for patch@linaro.org; Fri, 06 Jun 2014 05:50:02 -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+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.170 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 --- 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: