]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: Fix a bug for Unused PCDs section display in the report
authorzhijufan <zhijux.fan@intel.com>
Wed, 12 Sep 2018 06:58:54 +0000 (14:58 +0800)
committerYonghong Zhu <yonghong.zhu@intel.com>
Tue, 18 Sep 2018 01:41:26 +0000 (09:41 +0800)
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=1170
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
BaseTools/Source/Python/build/BuildReport.py

index c7fa1b97db8ddeefca548faf5d03d803f74319b3..49bcd9c0608035e16bf29d283f9563d143b7de1d 100644 (file)
@@ -888,7 +888,17 @@ class PcdReport(object):
             if self.ConditionalPcds:\r
                 self.GenerateReportDetail(File, ModulePcdSet, 1)\r
             if self.UnusedPcds:\r
-                self.GenerateReportDetail(File, ModulePcdSet, 2)\r
+                IsEmpty = True\r
+                for Token in self.UnusedPcds:\r
+                    TokenDict = self.UnusedPcds[Token]\r
+                    for Type in TokenDict:\r
+                        if TokenDict[Type]:\r
+                            IsEmpty = False\r
+                            break\r
+                    if not IsEmpty:\r
+                        break\r
+                if not IsEmpty:\r
+                    self.GenerateReportDetail(File, ModulePcdSet, 2)\r
         self.GenerateReportDetail(File, ModulePcdSet)\r
 \r
     ##\r