From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.24; helo=mga09.intel.com; envelope-from=yonghong.zhu@intel.com; receiver=edk2-devel@lists.01.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id B0C3F21962301 for ; Thu, 13 Sep 2018 22:01:28 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Sep 2018 22:01:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,372,1531810800"; d="scan'208";a="262516554" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga005.fm.intel.com with ESMTP; 13 Sep 2018 22:01:27 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 13 Sep 2018 22:01:27 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.240]) by shsmsx102.ccr.corp.intel.com ([169.254.2.226]) with mapi id 14.03.0319.002; Fri, 14 Sep 2018 13:01:25 +0800 From: "Zhu, Yonghong" To: "Zhu, Yonghong" , "edk2-devel@lists.01.org" CC: "Gao, Liming" , "Zhu, Yonghong" Thread-Topic: [edk2] [Patch] BaseTools: Fix a bug for Unused PCDs section display in the report Thread-Index: AQHUSyOl1FnIolV/JEmxzvAgCe1WDKTvOZ+Q Date: Fri, 14 Sep 2018 05:01:24 +0000 Message-ID: References: <1536816933-29564-1-git-send-email-yonghong.zhu@intel.com> In-Reply-To: <1536816933-29564-1-git-send-email-yonghong.zhu@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [Patch] BaseTools: Fix a bug for Unused PCDs section display in the report X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Sep 2018 05:01:28 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Yonghong Zhu Best Regards, Zhu Yonghong -----Original Message----- From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Yong= hong Zhu Sent: Thursday, September 13, 2018 1:36 PM To: edk2-devel@lists.01.org Cc: Gao, Liming Subject: [edk2] [Patch] BaseTools: Fix a bug for Unused PCDs section displa= y in the report From: zhijufan Fix a regression issue caused by ac4578af364, when there doesn't exist not = used PCD, it also display the not used Pcd section in the report. Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1170 Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Zhiju.Fan --- BaseTools/Source/Python/build/BuildReport.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/BaseTools/Source/Python/build/BuildReport.py b/BaseTools/Sourc= e/Python/build/BuildReport.py index c7fa1b9..49bcd9c 100644 --- a/BaseTools/Source/Python/build/BuildReport.py +++ b/BaseTools/Source/Python/build/BuildReport.py @@ -886,11 +886,21 @@ class PcdReport(object): def GenerateReport(self, File, ModulePcdSet): if not ModulePcdSet: if self.ConditionalPcds: self.GenerateReportDetail(File, ModulePcdSet, 1) if self.UnusedPcds: - self.GenerateReportDetail(File, ModulePcdSet, 2) + IsEmpty =3D True + for Token in self.UnusedPcds: + TokenDict =3D self.UnusedPcds[Token] + for Type in TokenDict: + if TokenDict[Type]: + IsEmpty =3D False + break + if not IsEmpty: + break + if not IsEmpty: + self.GenerateReportDetail(File, ModulePcdSet, 2) self.GenerateReportDetail(File, ModulePcdSet) =20 ## # Generate report for PCD information # -- 2.6.1.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel