]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: AutoGen - update to remove duplicate constant value
authorCarsey, Jaben <jaben.carsey@intel.com>
Fri, 27 Apr 2018 22:32:16 +0000 (06:32 +0800)
committerYonghong Zhu <yonghong.zhu@intel.com>
Fri, 4 May 2018 05:02:58 +0000 (13:02 +0800)
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>
BaseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py

index df7a9b889aa4f74c0d5a058d2e16571b18094020..602c90b3fe08d1b797730ec3216900ca584e7311 100644 (file)
@@ -250,16 +250,11 @@ class VAR_CHECK_PCD_VALID_OBJ(object):
         self.data = set()\r
         self.ValidData = True\r
         self.updateStorageWidth()\r
+\r
     def updateStorageWidth(self):\r
-        if self.PcdDataType == TAB_UINT8 or self.PcdDataType == "BOOLEAN":\r
-            self.StorageWidth = 1\r
-        elif self.PcdDataType == TAB_UINT16:\r
-            self.StorageWidth = 2\r
-        elif self.PcdDataType == TAB_UINT32:\r
-            self.StorageWidth = 4\r
-        elif self.PcdDataType == TAB_UINT64:\r
-            self.StorageWidth = 8\r
-        else:\r
+        try:\r
+            self.StorageWidth = int(MAX_SIZE_TYPE[self.PcdDataType])\r
+        except:\r
             self.StorageWidth = 0\r
             self.ValidData = False\r
             \r