public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch] BaseTools: Pcd not used info should not in Module PCD section
@ 2018-04-02  3:20 Yonghong Zhu
  2018-04-09  5:38 ` Gao, Liming
  0 siblings, 1 reply; 2+ messages in thread
From: Yonghong Zhu @ 2018-04-02  3:20 UTC (permalink / raw)
  To: edk2-devel

Pcds in Conditional Directives and Pcds not used are Platform Level
info, it should not display in Module PCD Section.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
---
 BaseTools/Source/Python/build/BuildReport.py | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/BaseTools/Source/Python/build/BuildReport.py b/BaseTools/Source/Python/build/BuildReport.py
index 966a2aa..6a79e23 100644
--- a/BaseTools/Source/Python/build/BuildReport.py
+++ b/BaseTools/Source/Python/build/BuildReport.py
@@ -875,14 +875,15 @@ class PcdReport(object):
                 DscDefaultValue = Pa.Platform.Pcds[(TokenCName, TokenSpaceGuidCName)].DscDefaultValue
                 if DscDefaultValue:
                     self.DscPcdDefault[(TokenCName, TokenSpaceGuidCName)] = DscDefaultValue
 
     def GenerateReport(self, File, ModulePcdSet):
-        if self.ConditionalPcds:
-            self.GenerateReportDetail(File, ModulePcdSet, 1)
-        if self.UnusedPcds:
-            self.GenerateReportDetail(File, ModulePcdSet, 2)
+        if not ModulePcdSet:
+            if self.ConditionalPcds:
+                self.GenerateReportDetail(File, ModulePcdSet, 1)
+            if self.UnusedPcds:
+                self.GenerateReportDetail(File, ModulePcdSet, 2)
         self.GenerateReportDetail(File, ModulePcdSet)
 
     ##
     # Generate report for PCD information
     #
@@ -902,11 +903,11 @@ class PcdReport(object):
         if ReportSubType == 1:
             PcdDict = self.ConditionalPcds
         elif ReportSubType == 2:
             PcdDict = self.UnusedPcds
 
-        if ModulePcdSet is None:
+        if not ModulePcdSet:
             FileWrite(File, gSectionStart)
             if ReportSubType == 1:
                 FileWrite(File, "Conditional Directives used by the build system")
             elif ReportSubType == 2:
                 FileWrite(File, "PCDs not used by modules or in conditional directives")
-- 
2.6.1.windows.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Patch] BaseTools: Pcd not used info should not in Module PCD section
  2018-04-02  3:20 [Patch] BaseTools: Pcd not used info should not in Module PCD section Yonghong Zhu
@ 2018-04-09  5:38 ` Gao, Liming
  0 siblings, 0 replies; 2+ messages in thread
From: Gao, Liming @ 2018-04-09  5:38 UTC (permalink / raw)
  To: Zhu, Yonghong, edk2-devel@lists.01.org

Reviewed-by: Liming Gao <liming.gao@intel.com>

>-----Original Message-----
>From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
>Yonghong Zhu
>Sent: Monday, April 02, 2018 11:20 AM
>To: edk2-devel@lists.01.org
>Subject: [edk2] [Patch] BaseTools: Pcd not used info should not in Module
>PCD section
>
>Pcds in Conditional Directives and Pcds not used are Platform Level
>info, it should not display in Module PCD Section.
>
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
>---
> BaseTools/Source/Python/build/BuildReport.py | 11 ++++++-----
> 1 file changed, 6 insertions(+), 5 deletions(-)
>
>diff --git a/BaseTools/Source/Python/build/BuildReport.py
>b/BaseTools/Source/Python/build/BuildReport.py
>index 966a2aa..6a79e23 100644
>--- a/BaseTools/Source/Python/build/BuildReport.py
>+++ b/BaseTools/Source/Python/build/BuildReport.py
>@@ -875,14 +875,15 @@ class PcdReport(object):
>                 DscDefaultValue = Pa.Platform.Pcds[(TokenCName,
>TokenSpaceGuidCName)].DscDefaultValue
>                 if DscDefaultValue:
>                     self.DscPcdDefault[(TokenCName, TokenSpaceGuidCName)] =
>DscDefaultValue
>
>     def GenerateReport(self, File, ModulePcdSet):
>-        if self.ConditionalPcds:
>-            self.GenerateReportDetail(File, ModulePcdSet, 1)
>-        if self.UnusedPcds:
>-            self.GenerateReportDetail(File, ModulePcdSet, 2)
>+        if not ModulePcdSet:
>+            if self.ConditionalPcds:
>+                self.GenerateReportDetail(File, ModulePcdSet, 1)
>+            if self.UnusedPcds:
>+                self.GenerateReportDetail(File, ModulePcdSet, 2)
>         self.GenerateReportDetail(File, ModulePcdSet)
>
>     ##
>     # Generate report for PCD information
>     #
>@@ -902,11 +903,11 @@ class PcdReport(object):
>         if ReportSubType == 1:
>             PcdDict = self.ConditionalPcds
>         elif ReportSubType == 2:
>             PcdDict = self.UnusedPcds
>
>-        if ModulePcdSet is None:
>+        if not ModulePcdSet:
>             FileWrite(File, gSectionStart)
>             if ReportSubType == 1:
>                 FileWrite(File, "Conditional Directives used by the build system")
>             elif ReportSubType == 2:
>                 FileWrite(File, "PCDs not used by modules or in conditional directives")
>--
>2.6.1.windows.1
>
>_______________________________________________
>edk2-devel mailing list
>edk2-devel@lists.01.org
>https://lists.01.org/mailman/listinfo/edk2-devel


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-04-09  5:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-02  3:20 [Patch] BaseTools: Pcd not used info should not in Module PCD section Yonghong Zhu
2018-04-09  5:38 ` Gao, Liming

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox