From patchwork Fri Dec 18 10:24:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 345450 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp1993083jai; Fri, 18 Dec 2020 02:29:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJz5c9aOH6puSWLkBvnCCmEZ28Ph6UT7Jri6H2hGfsYdnX4nVBa7epWBbjZnhqdYsKIM++SV X-Received: by 2002:a5b:eca:: with SMTP id a10mr4874368ybs.447.1608287366389; Fri, 18 Dec 2020 02:29:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608287366; cv=none; d=google.com; s=arc-20160816; b=Uwk+aFRdT3MEUGDb9EjypexLSJW/Boq657hAyhowDJtvoGYH9ertt0a9wVIX6o0wvQ +D2NEW8+PO3hGR7tM9XZ16ptjDZyg/tP2V/FDCqswEiMGnrGfZ1zojO6hEjdsCVfbKhc zLfVGh0bFQgcB0zefawjE465xwMZ2nrAHBz16eX2PeIIBjIV5A9Wz24HeajWTsyhx/gp v8AxWfFyZTaK42cwD8O9VcSHWKVSsRvGpQm5N7+KtJLGcrgJZTWlHgOgB5JCHlyRkewj 42JPeokCgA3f4iaWbWGPjuDdbL4sBTIYepEhLVXTkUhcdwTukFdHntUOE7vDfBg/FcV0 5opg== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from; bh=AUEbRBikd8YLSJ1RPqxuTNZ75m3UMG8Mk4wOgtCzF/8=; b=RJ72shUrigrVaBVU4soOzVPkScZZcZeUQlZPYEJk30drS/3FJ7zHknEeL5WoO3FIda xsbsvl7uW/8Zy5vdbELqRB0wtyE9ya7b3MFdfr4nkydYmz4ey6D+0Hs221PDElXiRhVL JE09VUdXbS8Sodmo8jhKKcWtcKLmFncppEU8YLW0I789xR5+cvVxZfQT4tcAG2TgPe3G RewUO3trgiriEabsWXviOvMolsgMZ1i85AYBZftqSJjvg0t/d9bdk8spK5F5fktFhLLw 7iXIx7l143dbFyPif/Mgg3NuWKh6cumzcakljz/3AlrnugK5xhpzDjBK+JO9KeeEKjZS rtTQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id r130si8545242ybr.472.2020.12.18.02.29.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 18 Dec 2020 02:29:26 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1]:60108 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kqD0n-0001VP-S1 for patch@linaro.org; Fri, 18 Dec 2020 05:29:25 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43938) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kqCvu-0002z8-3c for qemu-devel@nongnu.org; Fri, 18 Dec 2020 05:24:22 -0500 Received: from mout.kundenserver.de ([212.227.17.24]:32927) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kqCvq-00074F-0c for qemu-devel@nongnu.org; Fri, 18 Dec 2020 05:24:21 -0500 Received: from localhost.localdomain ([82.252.144.198]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MS3rB-1kg8pw3gOB-00TUuF; Fri, 18 Dec 2020 11:24:16 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 12/14] linux-user/sparc: Remove unneeded checks of 'err' from sparc64_get_context() Date: Fri, 18 Dec 2020 11:24:05 +0100 Message-Id: <20201218102407.597566-13-laurent@vivier.eu> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201218102407.597566-1-laurent@vivier.eu> References: <20201218102407.597566-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:ZmAq9ybs8O5o28NnMQotEu1ugm4XdPERtwd950RO8gEeC4I8rcD YUcRpcQiQFywXZkcukoicbqYh/sHIk7diteQmJWrCs5UbCdqpezSibVoO3UI460FULRuoqC 6O/fZriYmLZ4x8Wz8D09JT1oLEDTmUkVtRKcaxNYLFHYhYHOkb+O5RkU68WfN78VeUXQdMT zMEyMnHoFxsOptUK/pKVQ== X-UI-Out-Filterresults: notjunk:1; V03:K0:ztmoiu/l2bA=:KI5SRkyExS5Sv0iD3WzIDW R7f+Yi/8EqmncTKNUovIAqI2nvbkpqqfEiswX2Ufew77C6mGS7MgjKJetZvKTlaZ432um/480 rvtJGU1x1lzW9JAk5xauJi/hrnnY3z+AzZKkH7Nzhw3DEicE9yLQYjFpZG7e3lnB/6eaENnBq PCAwyQetCEv54j6KIx/keN4PkUvEFj6g7+coTFSNk9ubzWSmWdk43qQGyNZSWX1OLmPoxsjJ0 r3aEeNgWh5TAasdkDfWWh5svg+YMfBJuG/gzoz0TuKQHELZwjHILbv6LWCnqVZYFEpxqrfMHh ZusrLZ6br+Qp/uBD3nP3GPqOdKNA7iqWvqG7laZ/3BXCD3PwFJKA6XlmU6DGv5T4wR1brbkog Sz0l8it6kYEcotG59GJYX/C8s7xM+rc/f6PN4pJP82R2yLfhzweZImQEVndtMcXUzXBYlaMcW 2csR2wsDbw== Received-SPF: none client-ip=212.227.17.24; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Richard Henderson , Laurent Vivier Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Peter Maydell Unlike the kernel macros, our __get_user() and __put_user() do not return a failure code. Kernel code typically has a style of err |= __get_user(...); err |= __get_user(...); and then checking err at the end. In sparc64_get_context() our version of the code dropped the accumulating into err but left the "if (err) goto do_sigsegv" checks, which will never be taken. Delete unnecessary if()s. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Message-Id: <20201106152738.26026-3-peter.maydell@linaro.org> Signed-off-by: Laurent Vivier --- linux-user/sparc/signal.c | 4 ---- 1 file changed, 4 deletions(-) -- 2.29.2 diff --git a/linux-user/sparc/signal.c b/linux-user/sparc/signal.c index 0057b48fad93..58b48afe29c9 100644 --- a/linux-user/sparc/signal.c +++ b/linux-user/sparc/signal.c @@ -555,8 +555,6 @@ void sparc64_get_context(CPUSPARCState *env) for (i = 0; i < TARGET_NSIG_WORDS; i++, dst++, src++) { __put_user(*src, dst); } - if (err) - goto do_sigsegv; } /* XXX: tstate must be saved properly */ @@ -598,8 +596,6 @@ void sparc64_get_context(CPUSPARCState *env) * hidden behind an "if (fenab)" where fenab is always 0). */ - if (err) - goto do_sigsegv; unlock_user_struct(ucp, ucp_addr, 1); return; do_sigsegv: