From bc39c5cbea30b53c35a32150431bb7ea05a3238d Mon Sep 17 00:00:00 2001 From: Jaben Carsey Date: Fri, 16 Nov 2018 23:40:04 +0800 Subject: BaseTools: create and use a standard shared variable for '*' add a variable for the string '*' and then use it instead of lots of '*' Cc: Yonghong Zhu Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by : Bob Feng --- BaseTools/Source/Python/Common/VpdInfoFile.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'BaseTools/Source/Python/Common/VpdInfoFile.py') diff --git a/BaseTools/Source/Python/Common/VpdInfoFile.py b/BaseTools/Source/Python/Common/VpdInfoFile.py index 2fb8e66fe9..3be0670e36 100644 --- a/BaseTools/Source/Python/Common/VpdInfoFile.py +++ b/BaseTools/Source/Python/Common/VpdInfoFile.py @@ -57,7 +57,7 @@ FILE_COMMENT_TEMPLATE = \ # ::= "." # ::= C Variable Name of the Token Space GUID # ::= C Variable Name of the PCD -# ::= {"*"} {} +# ::= {TAB_STAR} {} # ::= "0x" (a-fA-F0-9){1,8} # ::= # ::= {} {} {} {} @@ -92,7 +92,7 @@ class VpdInfoFile: if (Vpd is None): EdkLogger.error("VpdInfoFile", BuildToolError.ATTRIBUTE_UNKNOWN_ERROR, "Invalid VPD PCD entry.") - if not (Offset >= 0 or Offset == "*"): + if not (Offset >= 0 or Offset == TAB_STAR): EdkLogger.error("VpdInfoFile", BuildToolError.PARAMETER_INVALID, "Invalid offset parameter: %s." % Offset) if Vpd.DatumType == TAB_VOID: @@ -186,8 +186,8 @@ class VpdInfoFile: VpdObjectTokenCName = PcdItem[0] for sku in VpdObject.SkuInfoList: if VpdObject.TokenSpaceGuidCName == TokenSpaceName and VpdObjectTokenCName == PcdTokenName.strip() and sku == SkuId: - if self._VpdArray[VpdObject][sku] == "*": - if Offset == "*": + if self._VpdArray[VpdObject][sku] == TAB_STAR: + if Offset == TAB_STAR: EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID, "The offset of %s has not been fixed up by third-party BPDG tool." % PcdName) self._VpdArray[VpdObject][sku] = Offset Found = True -- cgit v1.2.3