From patchwork Tue Jun 10 13:20:40 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 31654 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f199.google.com (mail-vc0-f199.google.com [209.85.220.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5960320675 for ; Tue, 10 Jun 2014 13:24:02 +0000 (UTC) Received: by mail-vc0-f199.google.com with SMTP id ij19sf16701263vcb.10 for ; Tue, 10 Jun 2014 06:24:02 -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: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=cF0nsQ/VuNhpG31w4NWlkwoTGRVBN2S4oZHYDEyH4f/ppEqp1n6M9sFRK71p13Qoho 5CYSshFh1tx0BGceLr0qxB7UplDc6xeRQapp+yhMtfZG4csf+E6aibZo6zisEbYbN2Ud 0yBHL88Mwu8DizyBhq/+HID8oGw6DsccsAv6wNbaWSQmsHsv0A9qD1Mugt6ZKVSjWm+o 1V1QmyqxgCTjoE9M3fOhKTS8+/L6m1wPKE+bT2eCM0DMEIn4KgUPhZaKuUORPVjFc1uQ dgIbwjrSGI3Z/lh79ZgGF5EK5Fja994QV2nPN6XvAn0sQajdDyIqAh+Rp7cFmutZHqzo GftA== X-Gm-Message-State: ALoCoQnXQDm0/f5MAP4xLIOsd15iDiPuRLHkgvWNV1oZasN4VyvH2cvH8kUAd8XbSS9iW3zv70Wk X-Received: by 10.236.19.7 with SMTP id m7mr4636644yhm.35.1402406641974; Tue, 10 Jun 2014 06:24:01 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.83.240 with SMTP id j103ls2128195qgd.47.gmail; Tue, 10 Jun 2014 06:24:01 -0700 (PDT) X-Received: by 10.221.64.80 with SMTP id xh16mr32223740vcb.35.1402406641809; Tue, 10 Jun 2014 06:24:01 -0700 (PDT) Received: from mail-ve0-f171.google.com (mail-ve0-f171.google.com [209.85.128.171]) by mx.google.com with ESMTPS id ev7si2508496vdb.36.2014.06.10.06.24.01 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Jun 2014 06:24:01 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.171 as permitted sender) client-ip=209.85.128.171; Received: by mail-ve0-f171.google.com with SMTP id jz11so3964192veb.2 for ; Tue, 10 Jun 2014 06:24:01 -0700 (PDT) X-Received: by 10.221.7.71 with SMTP id on7mr32308271vcb.18.1402406641720; Tue, 10 Jun 2014 06:24:01 -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 vs6csp225022vcb; Tue, 10 Jun 2014 06:24:01 -0700 (PDT) X-Received: by 10.140.101.78 with SMTP id t72mr39760035qge.79.1402406640947; Tue, 10 Jun 2014 06:24:00 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id i111si26814452qge.31.2014.06.10.06.24.00 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 10 Jun 2014 06:24:00 -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]:39756 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WuM1w-0004yn-G0 for patch@linaro.org; Tue, 10 Jun 2014 09:24:00 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53792) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WuLz0-0000Lo-KB for qemu-devel@nongnu.org; Tue, 10 Jun 2014 09:21:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WuLyp-0007a7-Kg for qemu-devel@nongnu.org; Tue, 10 Jun 2014 09:20:58 -0400 Received: from [2001:4b98:dc0:45:216:3eff:fe3d:166f] (port=56225 helo=afflict.kos.to) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WuLyp-0007Zb-Eq for qemu-devel@nongnu.org; Tue, 10 Jun 2014 09:20:47 -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 8D6192657B; Tue, 10 Jun 2014 15:20:45 +0200 (CEST) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Tue, 10 Jun 2014 16:20:40 +0300 Message-Id: X-Mailer: git-send-email 1.7.10.4 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: Riku Voipio Subject: [Qemu-devel] [PATCH v3 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.128.171 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: