From patchwork Mon Nov 12 20:49:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 150875 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp3595509ljp; Mon, 12 Nov 2018 12:50:20 -0800 (PST) X-Google-Smtp-Source: AJdET5fXWWdUoIi2IvyCL20QM/E/+Hq9ebKI5AtnB7YjQXiPlCkntCSAti3GtLArj/tjR4Rb/F8h X-Received: by 2002:ac8:1a77:: with SMTP id q52mr2341140qtk.329.1542055820274; Mon, 12 Nov 2018 12:50:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542055820; cv=none; d=google.com; s=arc-20160816; b=OYkHAOSXbzmNdTCk7e5Okkx8n02uLkySqALp4rYRomOAVbdlHjXNtjbjdCScO5eNr4 V/papu1xnxd7ZL4mkLSled2ZPvxhb21vQzLu/U028mG3UVpVLQycIH7FCYn4pTgpuAQg B1JW0z7Yk/8iGyjmdLft83KPz4O1HB//qZ+95JkeW/JVuxnBydDcTgf/M5fR5cmkNUfh 5NdfFv+pp3ehu7cl9OpKzqq8jRaUT4s/ZhDu4NYZznMYj53KhdSrjkHBEHw//su+Vn44 HcXYLEtBDBl4ZX+QvI7PCF+i6JVh6dPYkBXHg1HCV5ykioBXFBeQx4xbYw8aDPvRzqS2 eMJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from; bh=biaxzDl7TmWpyq4+2wDjqnNBQOTO3tAwfQ/weQBxHpM=; b=lVVtYEUjZZhfVs7vqLTYnslulbr0M6C7P7nnd+/9lW2sgmM2Zh+vpzRGZSNUjy3gnC Bl1Tvy5AUCadiMyTn0CNCpjCsFFRgviWIqrt7QonTSk6tD16/+a06D7VZTyfzq9DjKFs qMkMx78dEseBIC3FvpKR0zePHp/HTu7EX7jjIzmwZEJyjsAZuHl8z8jRg7qS7CaF9Og9 6YMixREpxdnrh7OiFssimbwW2LJ7RS3aJUKzfY/Y9ioEWw3SFnYxTSwstjdsHHk6ayqC fkDmxrs0N2xqVeDB9518DW2vq6w/VUlB3d6fdRUcKR3etFFNjanoo7xIXd6LeMADJr+n VHbw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id r188si3916677qkc.264.2018.11.12.12.50.19 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 12 Nov 2018 12:50:20 -0800 (PST) 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; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1]:50588 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gMJA3-0003OI-GL for patch@linaro.org; Mon, 12 Nov 2018 15:50:19 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39496) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gMJ9c-0003MY-BU for qemu-devel@nongnu.org; Mon, 12 Nov 2018 15:49:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gMJ9b-00088f-B2 for qemu-devel@nongnu.org; Mon, 12 Nov 2018 15:49:52 -0500 Received: from mout.kundenserver.de ([212.227.126.134]:34581) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gMJ9a-000882-Vp for qemu-devel@nongnu.org; Mon, 12 Nov 2018 15:49:51 -0500 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MeknF-1fnnD83Wfl-00an7b; Mon, 12 Nov 2018 21:49:36 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Mon, 12 Nov 2018 21:49:26 +0100 Message-Id: <20181112204929.12625-2-laurent@vivier.eu> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20181112204929.12625-1-laurent@vivier.eu> References: <20181112204929.12625-1-laurent@vivier.eu> X-Provags-ID: V03:K1:W7OfH3Cd/slzVN7fFnjD0i0Uc4NBPqa70zKKNeX2V+KGaPYZOsv 5IlL2DcvKcsY0v3lTwy+M+ClmpO2OYKlyHYzO+Lha/JOQp5GxKaYS3VDncsCHY1Zd82dGes tph93I01pKY/rFv6GxU6J8/7xwGPAzvP+y6M8YM3U6Fmp4RcUubKyeQ/QUh8xgKlqngQ1JZ hkX+NdjUAgTdaPVpzwBBw== X-UI-Out-Filterresults: notjunk:1; V01:K0:PbbQe1lucS8=:0HYUyMuJGtSDjGpIR7ti/C 8+vYFBhWb1RnPifPRtlbdrSpegezJj8I6esBgGKh+QmX+53HYeTcNGjWwc6kPjSLnq2UPoadS PiIbT6KF47ckWza0ByMusAFPXFMGkPr36BSMQSF6eA9NtZ+lvQFG8oPX77MzHlj1RZTEQb9Wi /yDhwOdhhZ+DvsgNQeOMsL/Rk+FmOlOujccnvZqKP2BuVe6dDCcwLDfnZ66cBwBnqHaSimdkf FP0nWp7mRsT1ifVnV7nojzYm1eIdcLTKa7qZ8856K4+2I76WRAurxi0X0zlVKdSBXvJObf9/s ld1qiIQfu0jELkQM+y1Fa1nOBDuc2EbgI9RIqWyDoL87hkynRLr+DKYTWwXr8DI6A9tIhygjG /WG/KosWrbq43VqhFymOLMS0Zey9uMr1UEAPIqXTWoENsQMcOt8TnIggYBgpbINezOKbZ+A5a lMsjKml8TjsIEi9EHoyIuFN/wrJr4NB8MgdRi6eb/T9LgxID6YaHxV1QkQVLiGZ52BliRAT+F VEBPPO67ShKrdKOWkgx86AUItiCOJzhcvwgDuHuYj5UhZyEel0oruymxbn++nwrxLogDOsh9P 8COVOxpaR3n0QwpSok0pNBkcef1B8kGo/pcWvNAjtwOztLuhlb/abar31j9356B2IWZezTUMO NiJcNVJbpXimoFH39rKQANgq/3bSucuLzZrnSzBN1wVk569bt3g6yUuDEpIZz21WrCtBReFTR Fl9VtcyAqTI+StjNWeG+sFb4j8xDzraPv+8nGHygv5dlvCcncuYAiS9P8t55EdIYvx5nT1AkD PPhaMpt X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.126.134 Subject: [Qemu-devel] [PULL 1/4] linux-user: Remove dead error-checking code X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Riku Voipio , Laurent Vivier Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Peter Maydell Remove some dead code spotted by Coverity (CID 1009855, 1390854, 1390847). The underlying cause in all these cases is the same: QEMU's put_user operations can't result in errors, but the kernel's equivalent does. So when code was copied from the kernel signal-frame-setup/teardown code, checks on error flags that were needed in the kernel became dead code for us. Signed-off-by: Peter Maydell Reviewed-by: Laurent Vivier Message-Id: <20181019161715.12122-1-peter.maydell@linaro.org> Signed-off-by: Laurent Vivier --- linux-user/m68k/signal.c | 3 --- linux-user/sh4/signal.c | 4 ---- linux-user/sparc/signal.c | 2 -- 3 files changed, 9 deletions(-) -- 2.17.2 diff --git a/linux-user/m68k/signal.c b/linux-user/m68k/signal.c index 38bd77ec16..49ff87c77b 100644 --- a/linux-user/m68k/signal.c +++ b/linux-user/m68k/signal.c @@ -334,9 +334,6 @@ void setup_rt_frame(int sig, struct target_sigaction *ka, (uint32_t *)(frame->retcode + 0)); __put_user(0x4e40, (uint16_t *)(frame->retcode + 4)); - if (err) - goto give_sigsegv; - /* Set up to return from userspace */ env->aregs[7] = frame_addr; diff --git a/linux-user/sh4/signal.c b/linux-user/sh4/signal.c index c6752baa7e..cc89a48ff8 100644 --- a/linux-user/sh4/signal.c +++ b/linux-user/sh4/signal.c @@ -279,7 +279,6 @@ long do_sigreturn(CPUSH4State *regs) sigset_t blocked; target_sigset_t target_set; int i; - int err = 0; frame_addr = regs->gregs[15]; trace_user_do_sigreturn(regs, frame_addr); @@ -292,9 +291,6 @@ long do_sigreturn(CPUSH4State *regs) __get_user(target_set.sig[i], &frame->extramask[i - 1]); } - if (err) - goto badframe; - target_to_host_sigset_internal(&blocked, &target_set); set_sigmask(&blocked); diff --git a/linux-user/sparc/signal.c b/linux-user/sparc/signal.c index e44e99993c..295e415b1e 100644 --- a/linux-user/sparc/signal.c +++ b/linux-user/sparc/signal.c @@ -256,8 +256,6 @@ void setup_frame(int sig, struct target_sigaction *ka, /* t 0x10 */ val32 = 0x91d02010; __put_user(val32, &sf->insns[1]); - if (err) - goto sigsegv; } unlock_user(sf, sf_addr, sizeof(struct target_signal_frame)); return;