summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py
diff options
context:
space:
mode:
authorCarsey, Jaben <jaben.carsey@intel.com>2018-04-28 06:32:16 +0800
committerYonghong Zhu <yonghong.zhu@intel.com>2018-05-04 13:02:58 +0800
commita7360838d7cc0b645b41d8b1713832ef4fbfdd64 (patch)
tree64d19f2dc27c603f3d5e0c39be8230cdc396b841 /BaseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py
parentbff747501b98d2685782dc742db5f32d8490c99e (diff)
downloadedk2-a7360838d7cc0b645b41d8b1713832ef4fbfdd64.tar.gz
edk2-a7360838d7cc0b645b41d8b1713832ef4fbfdd64.tar.bz2
edk2-a7360838d7cc0b645b41d8b1713832ef4fbfdd64.zip
BaseTools: AutoGen - update to remove duplicate constant value
PCD size by type is shared. just use it. Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py')
-rw-r--r--BaseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py13
1 files changed, 4 insertions, 9 deletions
diff --git a/BaseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py b/BaseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py
index df7a9b889a..602c90b3fe 100644
--- a/BaseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py
+++ b/BaseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py
@@ -250,16 +250,11 @@ class VAR_CHECK_PCD_VALID_OBJ(object):
self.data = set()
self.ValidData = True
self.updateStorageWidth()
+
def updateStorageWidth(self):
- if self.PcdDataType == TAB_UINT8 or self.PcdDataType == "BOOLEAN":
- self.StorageWidth = 1
- elif self.PcdDataType == TAB_UINT16:
- self.StorageWidth = 2
- elif self.PcdDataType == TAB_UINT32:
- self.StorageWidth = 4
- elif self.PcdDataType == TAB_UINT64:
- self.StorageWidth = 8
- else:
+ try:
+ self.StorageWidth = int(MAX_SIZE_TYPE[self.PcdDataType])
+ except:
self.StorageWidth = 0
self.ValidData = False