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: 28891 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f197.google.com (mail-qc0-f197.google.com [209.85.216.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 53DE320534 for ; Wed, 23 Apr 2014 13:19:03 +0000 (UTC) Received: by mail-qc0-f197.google.com with SMTP id i8sf3334923qcq.8 for ; Wed, 23 Apr 2014 06:19: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:in-reply-to:references: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=G/eVGjwoEW11M5VexcGWPxgLefv+tuJBgKE/4NMDMl0=; b=O2/7GuKpv15mlVfFjxF/peu0iitDWGNi6DH0oTlISUHkRFz9Inxc6Qr84TVHaw+kEQ 5jQ5z+GoJrL4V2w2+GqSGmAPi+wJct6bL854rH6zVLQqyT2gt1B9Stz6lmVDvQ0XmgK8 bUCXyDA+6zUmtfhMb9CAJEUgMjuJ4BbNwr4l7H3KS04NkpJxQsWmeCczEtMg7XO88P1i 6cIwfGpkED7sFIwPWw0nZ7cym9pFaHzoq7bNQzT/VLTNR1MHKCdmXjLhaJxGQgjv2UfA f0Im/MOCY2KkqVJD7t7RGO5eoOivWKpRUYAMqQ+Hrop/xCfV5bT4waOhVv8ECYnFPFhP pdPw== X-Gm-Message-State: ALoCoQkWtTSG5AueLbFdYgI3QUry84+UoyXg4X8bHy8ObUPGqojXPzvglVhImLcun1VcHTYH2fmt X-Received: by 10.58.178.81 with SMTP id cw17mr24136705vec.37.1398259143043; Wed, 23 Apr 2014 06:19:03 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.51.11 with SMTP id t11ls553926qga.96.gmail; Wed, 23 Apr 2014 06:19:02 -0700 (PDT) X-Received: by 10.220.95.204 with SMTP id e12mr175449vcn.37.1398259142872; Wed, 23 Apr 2014 06:19:02 -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 mr9si159123vec.119.2014.04.23.06.19.02 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 23 Apr 2014 06:19:02 -0700 (PDT) Received-SPF: none (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) client-ip=209.85.220.181; Received: by mail-vc0-f181.google.com with SMTP id id10so1076067vcb.40 for ; Wed, 23 Apr 2014 06:19:02 -0700 (PDT) X-Received: by 10.58.38.40 with SMTP id d8mr163168vek.61.1398259142734; Wed, 23 Apr 2014 06:19: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.220.221.72 with SMTP id ib8csp103392vcb; Wed, 23 Apr 2014 06:19:02 -0700 (PDT) X-Received: by 10.224.64.132 with SMTP id e4mr58392641qai.16.1398259142243; Wed, 23 Apr 2014 06:19:02 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id b1si438981qcs.28.2014.04.23.06.19.02 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 23 Apr 2014 06:19: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]:60937 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wcx4n-0007Zq-Oy for patch@linaro.org; Wed, 23 Apr 2014 09:19:01 -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+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=neutral (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) 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 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: