From nobody Fri Oct 25 19:23:17 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 1684488655847743.8240110829806; Fri, 19 May 2023 02:30:55 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.536851.835571 (Exim 4.92) (envelope-from ) id 1pzwRX-0003dn-5S; Fri, 19 May 2023 09:30:35 +0000 Received: by outflank-mailman (output) from mailman id 536851.835571; Fri, 19 May 2023 09:30:35 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pzwRX-0003dg-1t; Fri, 19 May 2023 09:30:35 +0000 Received: by outflank-mailman (input) for mailman id 536851; Fri, 19 May 2023 09:30:33 +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 1pzwRV-00038Z-G5 for xen-devel@lists.xenproject.org; Fri, 19 May 2023 09:30:33 +0000 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by se1-gles-sth1.inumbo.com (Halon) with ESMTP id cd4ebcb5-f627-11ed-b22d-6b7b168915f2; Fri, 19 May 2023 11:30:32 +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 2864015BF; Fri, 19 May 2023 02:31:17 -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 16E1C3F73F; Fri, 19 May 2023 02:30:30 -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: cd4ebcb5-f627-11ed-b22d-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 2/3] xen/misra: xen-analysis.py: Fix latent bug Date: Fri, 19 May 2023 10:30:18 +0100 Message-Id: <20230519093019.2131896-3-luca.fancellu@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230519093019.2131896-1-luca.fancellu@arm.com> References: <20230519093019.2131896-1-luca.fancellu@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1684488658003100003 Content-Type: text/plain; charset="utf-8" Currenly there is a latent bug that is not triggered because the function cppcheck_merge_txt_fragments is called with the parameter strip_paths having a list of only one element. The bug is that the split function should not be in the loop for strip_paths, but one level before, fix it. Fixes: 02b26c02c7c4 ("xen/scripts: add cppcheck tool to the xen-analysis.py= script") Signed-off-by: Luca Fancellu Acked-by: Stefano Stabellini Tested-by: Stefano Stabellini --- xen/scripts/xen_analysis/cppcheck_report_utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/scripts/xen_analysis/cppcheck_report_utils.py b/xen/script= s/xen_analysis/cppcheck_report_utils.py index c5f466aff141..fdc299c7e029 100644 --- a/xen/scripts/xen_analysis/cppcheck_report_utils.py +++ b/xen/scripts/xen_analysis/cppcheck_report_utils.py @@ -104,8 +104,8 @@ def cppcheck_merge_txt_fragments(fragments_list, out_tx= t_file, strip_paths): for path in strip_paths: text_report_content[i] =3D text_report_content[i].repl= ace( path + "/"= , "") - # Split by : separator - text_report_content[i] =3D text_report_content[i].spli= t(":") + # Split by : separator + text_report_content[i] =3D text_report_content[i].split(":= ") =20 # sort alphabetically for second field (misra rule) and as sec= ond # criteria for the first field (file name) --=20 2.34.1