From nobody Tue May 14 14:20:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=arm.com Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1682506017831588.5665625121895; Wed, 26 Apr 2023 03:46:57 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.526624.818504 (Exim 4.92) (envelope-from ) id 1prcfH-00009d-Gv; Wed, 26 Apr 2023 10:46:23 +0000 Received: by outflank-mailman (output) from mailman id 526624.818504; Wed, 26 Apr 2023 10:46:23 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1prcfH-00009W-EA; Wed, 26 Apr 2023 10:46:23 +0000 Received: by outflank-mailman (input) for mailman id 526624; Wed, 26 Apr 2023 10:46:22 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1prcfG-00009P-Bk for xen-devel@lists.xenproject.org; Wed, 26 Apr 2023 10:46:22 +0000 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by se1-gles-sth1.inumbo.com (Halon) with ESMTP id 9453c809-e41f-11ed-b224-6b7b168915f2; Wed, 26 Apr 2023 12:46:20 +0200 (CEST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C0DEE4B3; Wed, 26 Apr 2023 03:47:03 -0700 (PDT) Received: from e125770.cambridge.arm.com (e125770.arm.com [10.1.199.1]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8CB0D3F5A1; Wed, 26 Apr 2023 03:46:18 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 9453c809-e41f-11ed-b224-6b7b168915f2 From: Luca Fancellu To: xen-devel@lists.xenproject.org Cc: bertrand.marquis@arm.com, wei.chen@arm.com, Andrew Cooper , George Dunlap , Jan Beulich , Julien Grall , Stefano Stabellini , Wei Liu Subject: [PATCH] xen/misra: xen-analysis.py: fix return error on PhaseExceptions Date: Wed, 26 Apr 2023 11:46:05 +0100 Message-Id: <20230426104605.3447049-1-luca.fancellu@arm.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1682506018835100001 Content-Type: text/plain; charset="utf-8" Currently the script return code is 0 even if an exception is found, because the return code is written only if the exception object has the errorcode member. Fix the issue returning the errorcode member in case it exists, otherwise use a generic value different from 0. Fixes: 02b26c02c7c4 ("xen/scripts: add cppcheck tool to the xen-analysis.py= script") Signed-off-by: Luca Fancellu --- xen/scripts/xen-analysis.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/xen/scripts/xen-analysis.py b/xen/scripts/xen-analysis.py index 8e50c27cd898..7185c5a06d2c 100755 --- a/xen/scripts/xen-analysis.py +++ b/xen/scripts/xen-analysis.py @@ -26,8 +26,7 @@ def main(argv): cppcheck_analysis.generate_cppcheck_report() except PhaseExceptions as e: print("ERROR: {}".format(e)) - if hasattr(e, "errorcode"): - ret_code =3D e.errorcode + ret_code =3D e.errorcode if hasattr(e, "errorcode") else 1 finally: if settings.step_clean_analysis: cppcheck_analysis.clean_analysis_artifacts() --=20 2.34.1