Reviewed-by: Yonghong Zhu <[email protected]> 

Best Regards,
Zhu Yonghong


-----Original Message-----
From: edk2-devel [mailto:[email protected]] On Behalf Of Yonghong 
Zhu
Sent: Wednesday, September 05, 2018 10:52 AM
To: [email protected]
Cc: Gao, Liming <[email protected]>
Subject: [edk2] [Patch] BaseTools: Fix a bug about list the PCD in "not used" 
section

From: zhijufan <[email protected]>

Defined a pcd in Ovmf.dec and used that pcd in AcpiPlatformDxe.inf, then assign 
a value to that pcd from DSC, then build Ovmf platform successfully. But this 
Pcd was wrongly listed into not used section in the report.txt file.

Cc: Liming Gao <[email protected]>
Cc: Yonghong Zhu <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Zhiju.Fan <[email protected]>
---
 BaseTools/Source/Python/build/BuildReport.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/BaseTools/Source/Python/build/BuildReport.py 
b/BaseTools/Source/Python/build/BuildReport.py
index deb88a7..a598d64 100644
--- a/BaseTools/Source/Python/build/BuildReport.py
+++ b/BaseTools/Source/Python/build/BuildReport.py
@@ -817,10 +817,13 @@ class PcdReport(object):
                         if (Pcd.TokenCName, Pcd.TokenSpaceGuidCName, PcdType) 
in package.Pcds:
                             Pcd.DatumType = package.Pcds[(Pcd.TokenCName, 
Pcd.TokenSpaceGuidCName, PcdType)].DatumType
                             break
 
                 PcdList = self.AllPcds.setdefault(Pcd.TokenSpaceGuidCName, 
{}).setdefault(Pcd.Type, [])
+                UnusedPcdList = 
self.UnusedPcds.setdefault(Pcd.TokenSpaceGuidCName, {}).setdefault(Pcd.Type, [])
+                if Pcd in UnusedPcdList:
+                    UnusedPcdList.remove(Pcd)
                 if Pcd not in PcdList and Pcd not in UnusedPcdFullList:
                     UnusedPcdFullList.append(Pcd)
                 if len(Pcd.TokenCName) > self.MaxLen:
                     self.MaxLen = len(Pcd.TokenCName)
 
--
2.6.1.windows.1

_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to