]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/AutoGen/AutoGen.py
SecurityPkg/OpalPassword: Fix PSID revert no hint message.
[mirror_edk2.git] / BaseTools / Source / Python / AutoGen / AutoGen.py
index 671f02133aca3ebf44d07e2571d5bc7e7483f504..54f6b1f173b2a237d79061bc1bd2ae9cce259012 100644 (file)
@@ -419,14 +419,14 @@ class WorkspaceAutoGen(AutoGen):
                         if BuildData.Pcds[key].Pending:\r
                             if key in Platform.Pcds:\r
                                 PcdInPlatform = Platform.Pcds[key]\r
-                                if PcdInPlatform.Type not in [None, '']:\r
+                                if PcdInPlatform.Type:\r
                                     BuildData.Pcds[key].Type = PcdInPlatform.Type\r
 \r
                             if BuildData.MetaFile in Platform.Modules:\r
                                 PlatformModule = Platform.Modules[str(BuildData.MetaFile)]\r
                                 if key in PlatformModule.Pcds:\r
                                     PcdInPlatform = PlatformModule.Pcds[key]\r
-                                    if PcdInPlatform.Type not in [None, '']:\r
+                                    if PcdInPlatform.Type:\r
                                         BuildData.Pcds[key].Type = PcdInPlatform.Type\r
 \r
                         if TAB_PCDS_DYNAMIC_EX in BuildData.Pcds[key].Type:\r
@@ -460,7 +460,7 @@ class WorkspaceAutoGen(AutoGen):
                             'build',\r
                             FORMAT_INVALID,\r
                             "Building modules from source INFs, following PCD use %s and %s access method. It must be corrected to use only one access method." % (i, j),\r
-                            ExtraData="%s" % '\n\t'.join([str(P[1]+'.'+P[0]) for P in Intersections])\r
+                            ExtraData="%s" % '\n\t'.join(str(P[1]+'.'+P[0]) for P in Intersections)\r
                             )\r
 \r
             #\r
@@ -1393,7 +1393,7 @@ class PlatformAutoGen(AutoGen):
 \r
             for PcdFromModule in M.ModulePcdList + M.LibraryPcdList:\r
                 # make sure that the "VOID*" kind of datum has MaxDatumSize set\r
-                if PcdFromModule.DatumType == TAB_VOID and PcdFromModule.MaxDatumSize in [None, '']:\r
+                if PcdFromModule.DatumType == TAB_VOID and not PcdFromModule.MaxDatumSize:\r
                     NoDatumTypePcdList.add("%s.%s [%s]" % (PcdFromModule.TokenSpaceGuidCName, PcdFromModule.TokenCName, F))\r
 \r
                 # Check the PCD from Binary INF or Source INF\r
@@ -1470,7 +1470,7 @@ class PlatformAutoGen(AutoGen):
                                         ExtraData="\n\tExisted %s PCD %s in:\n\t\t%s\n"\r
                                         % (PcdFromModule.Type, PcdFromModule.TokenCName, InfName))\r
                     # make sure that the "VOID*" kind of datum has MaxDatumSize set\r
-                    if PcdFromModule.DatumType == TAB_VOID and PcdFromModule.MaxDatumSize in [None, '']:\r
+                    if PcdFromModule.DatumType == TAB_VOID and not PcdFromModule.MaxDatumSize:\r
                         NoDatumTypePcdList.add("%s.%s [%s]" % (PcdFromModule.TokenSpaceGuidCName, PcdFromModule.TokenCName, InfName))\r
                     if M.ModuleType in SUP_MODULE_SET_PEI:\r
                         PcdFromModule.Phase = "PEI"\r
@@ -1998,7 +1998,7 @@ class PlatformAutoGen(AutoGen):
             BuildRuleFile = None\r
             if TAB_TAT_DEFINES_BUILD_RULE_CONF in self.Workspace.TargetTxt.TargetTxtDictionary:\r
                 BuildRuleFile = self.Workspace.TargetTxt.TargetTxtDictionary[TAB_TAT_DEFINES_BUILD_RULE_CONF]\r
-            if BuildRuleFile in [None, '']:\r
+            if not BuildRuleFile:\r
                 BuildRuleFile = gDefaultBuildRuleFile\r
             self._BuildRule = BuildRule(BuildRuleFile)\r
             if self._BuildRule._FileVersion == "":\r
@@ -2295,7 +2295,7 @@ class PlatformAutoGen(AutoGen):
         #\r
         for Item in LibraryList:\r
             if ConsumedByList[Item] != [] and Item in Constructor and len(Constructor) > 1:\r
-                ErrorMessage = "\tconsumed by " + "\n\tconsumed by ".join([str(L) for L in ConsumedByList[Item]])\r
+                ErrorMessage = "\tconsumed by " + "\n\tconsumed by ".join(str(L) for L in ConsumedByList[Item])\r
                 EdkLogger.error("build", BUILD_ERROR, 'Library [%s] with constructors has a cycle' % str(Item),\r
                                 ExtraData=ErrorMessage, File=self.MetaFile)\r
             if Item not in SortedLibraryList:\r
@@ -2326,13 +2326,13 @@ class PlatformAutoGen(AutoGen):
                 TokenCName = PcdItem[0]\r
                 break\r
         if FromPcd is not None:\r
-            if ToPcd.Pending and FromPcd.Type not in [None, '']:\r
+            if ToPcd.Pending and FromPcd.Type:\r
                 ToPcd.Type = FromPcd.Type\r
-            elif (ToPcd.Type not in [None, '']) and (FromPcd.Type not in [None, ''])\\r
+            elif (ToPcd.Type) and (FromPcd.Type)\\r
                 and (ToPcd.Type != FromPcd.Type) and (ToPcd.Type in FromPcd.Type):\r
                 if ToPcd.Type.strip() == TAB_PCDS_DYNAMIC_EX:\r
                     ToPcd.Type = FromPcd.Type\r
-            elif ToPcd.Type not in [None, ''] and FromPcd.Type not in [None, ''] \\r
+            elif ToPcd.Type and FromPcd.Type \\r
                 and ToPcd.Type != FromPcd.Type:\r
                 EdkLogger.error("build", OPTION_CONFLICT, "Mismatched PCD type",\r
                                 ExtraData="%s.%s is defined as [%s] in module %s, but as [%s] in platform."\\r
@@ -2368,11 +2368,11 @@ class PlatformAutoGen(AutoGen):
             ToPcd.validlists = FromPcd.validlists\r
             ToPcd.expressions = FromPcd.expressions\r
 \r
-        if FromPcd is not None and ToPcd.DatumType == TAB_VOID and ToPcd.MaxDatumSize in ['', None]:\r
+        if FromPcd is not None and ToPcd.DatumType == TAB_VOID and not ToPcd.MaxDatumSize:\r
             EdkLogger.debug(EdkLogger.DEBUG_9, "No MaxDatumSize specified for PCD %s.%s" \\r
                             % (ToPcd.TokenSpaceGuidCName, TokenCName))\r
             Value = ToPcd.DefaultValue\r
-            if Value in [None, '']:\r
+            if not Value:\r
                 ToPcd.MaxDatumSize = '1'\r
             elif Value[0] == 'L':\r
                 ToPcd.MaxDatumSize = str((len(Value) - 2) * 2)\r
@@ -2383,7 +2383,7 @@ class PlatformAutoGen(AutoGen):
 \r
         # apply default SKU for dynamic PCDS if specified one is not available\r
         if (ToPcd.Type in PCD_DYNAMIC_TYPE_SET or ToPcd.Type in PCD_DYNAMIC_EX_TYPE_SET) \\r
-            and ToPcd.SkuInfoList in [None, {}, '']:\r
+            and not ToPcd.SkuInfoList:\r
             if self.Platform.SkuName in self.Platform.SkuIds:\r
                 SkuName = self.Platform.SkuName\r
             else:\r
@@ -2415,7 +2415,7 @@ class PlatformAutoGen(AutoGen):
                 if Sku.VariableGuid == '': continue\r
                 Sku.VariableGuidValue = GuidValue(Sku.VariableGuid, self.PackageList, self.MetaFile.Path)\r
                 if Sku.VariableGuidValue is None:\r
-                    PackageList = "\n\t".join([str(P) for P in self.PackageList])\r
+                    PackageList = "\n\t".join(str(P) for P in self.PackageList)\r
                     EdkLogger.error(\r
                                 'build',\r
                                 RESOURCE_NOT_AVAILABLE,\r
@@ -2444,10 +2444,10 @@ class PlatformAutoGen(AutoGen):
         # use PCD value to calculate the MaxDatumSize when it is not specified\r
         for Name, Guid in Pcds:\r
             Pcd = Pcds[Name, Guid]\r
-            if Pcd.DatumType == TAB_VOID and Pcd.MaxDatumSize in ['', None]:\r
+            if Pcd.DatumType == TAB_VOID and not Pcd.MaxDatumSize:\r
                 Pcd.MaxSizeUserSet = None\r
                 Value = Pcd.DefaultValue\r
-                if Value in [None, '']:\r
+                if not Value:\r
                     Pcd.MaxDatumSize = '1'\r
                 elif Value[0] == 'L':\r
                     Pcd.MaxDatumSize = str((len(Value) - 2) * 2)\r
@@ -3122,7 +3122,7 @@ class ModuleAutoGen(AutoGen):
             for Depex in DepexList:\r
                 for key in Depex:\r
                     DepexStr += '[Depex.%s.%s]\n' % key\r
-                    DepexStr += '\n'.join(['# '+ val for val in Depex[key]])\r
+                    DepexStr += '\n'.join('# '+ val for val in Depex[key])\r
                     DepexStr += '\n\n'\r
             if not DepexStr:\r
                 return '[Depex.%s]\n' % self.Arch\r
@@ -3136,7 +3136,7 @@ class ModuleAutoGen(AutoGen):
                 DepexStr += ' AND '\r
             DepexStr += '('\r
             for D in Depex.values():\r
-                DepexStr += ' '.join([val for val in D])\r
+                DepexStr += ' '.join(val for val in D)\r
             Index = DepexStr.find('END')\r
             if Index > -1 and Index == len(DepexStr) - 3:\r
                 DepexStr = DepexStr[:-3]\r