From: Carsey, Jaben Date: Fri, 27 Apr 2018 22:32:16 +0000 (+0800) Subject: BaseTools: AutoGen - update to remove duplicate constant value X-Git-Tag: edk2-stable201903~1781 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=a7360838d7cc0b645b41d8b1713832ef4fbfdd64;p=mirror_edk2.git BaseTools: AutoGen - update to remove duplicate constant value PCD size by type is shared. just use it. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu --- 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