]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg: Use IsZeroGuid API for zero GUID checking
authorHao Wu <hao.a.wu@intel.com>
Tue, 30 Aug 2016 01:57:59 +0000 (09:57 +0800)
committerHao Wu <hao.a.wu@intel.com>
Wed, 31 Aug 2016 03:14:01 +0000 (11:14 +0800)
Instead of comparing a GUID with gZeroGuid via the CompareGuid API, the
commit uses the IsZeroGuid API to check if the given GUID is a zero GUID.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Feng Tian <feng.tian@Intel.com>
17 files changed:
MdeModulePkg/Application/MemoryProfileInfo/MemoryProfileInfo.c
MdeModulePkg/Application/MemoryProfileInfo/MemoryProfileInfo.inf
MdeModulePkg/Core/Dxe/DxeMain.h
MdeModulePkg/Core/Dxe/DxeMain.inf
MdeModulePkg/Core/PiSmmCore/PiSmmCore.h
MdeModulePkg/Core/PiSmmCore/PiSmmCore.inf
MdeModulePkg/Library/UefiBootManagerLib/BmDriverHealth.c
MdeModulePkg/Library/UefiBootManagerLib/InternalBm.h
MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf
MdeModulePkg/Library/VarCheckHiiLib/VarCheckHii.h
MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiGenFromFv.c
MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiLib.inf
MdeModulePkg/Universal/SetupBrowserDxe/Expression.c
MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
MdeModulePkg/Universal/SetupBrowserDxe/Setup.c
MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.c
MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf

index e82ee9c93df3d89b4233873bfc6bf6992f982756..14e89347c6db5fa366e90928bdc794edb5841953 100644 (file)
@@ -27,7 +27,6 @@
 #include <Protocol/SmmCommunication.h>\r
 #include <Protocol/SmmAccess2.h>\r
 \r
-#include <Guid/ZeroGuid.h>\r
 #include <Guid/MemoryProfile.h>\r
 #include <Guid/PiSmmCommunicationRegionTable.h>\r
 \r
@@ -255,7 +254,7 @@ GetDriverNameString (
     return mNameString;\r
   }\r
 \r
-  if (!CompareGuid (&DriverInfo->FileName, &gZeroGuid)) {\r
+  if (!IsZeroGuid (&DriverInfo->FileName)) {\r
     //\r
     // Try to get the image's FFS UI section by image GUID\r
     //\r
index c512a3f65133b9c270b349480f4979b041a5760b..4bb7a9df1d11e64506062b1d9c9352527d05edf7 100644 (file)
@@ -52,7 +52,6 @@
   ## SOMETIMES_CONSUMES   ## GUID # Locate protocol\r
   ## SOMETIMES_CONSUMES   ## GUID # SmiHandlerRegister\r
   gEdkiiMemoryProfileGuid\r
-  gZeroGuid                            ## SOMETIMES_CONSUMES   ## GUID\r
   gEdkiiPiSmmCommunicationRegionTableGuid    ## SOMETIMES_CONSUMES ## SystemTable\r
 \r
 [Protocols]\r
index 60d85f082ffa5d5f09f907ab8421d9b92b1a6b7a..aefeeb7d399bc672a1e000cd56462f7d0e8fc50a 100644 (file)
@@ -69,7 +69,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Guid/IdleLoopEvent.h>\r
 #include <Guid/VectorHandoffTable.h>\r
 #include <Ppi/VectorHandoffInfo.h>\r
-#include <Guid/ZeroGuid.h>\r
 #include <Guid/MemoryProfile.h>\r
 \r
 #include <Library/DxeCoreEntryPoint.h>\r
index 450da579e0fc7ec80b2a41a1cc08954b3b1455ef..13a23819f354e9677f26aec40c3ae960b7ca0ff0 100644 (file)
   gEventExitBootServicesFailedGuid              ## SOMETIMES_PRODUCES   ## Event\r
   gEfiVectorHandoffTableGuid                    ## SOMETIMES_PRODUCES   ## SystemTable\r
   gEdkiiMemoryProfileGuid                       ## SOMETIMES_PRODUCES   ## GUID # Install protocol\r
-  gZeroGuid                                     ## SOMETIMES_CONSUMES   ## GUID\r
   gEfiPropertiesTableGuid                       ## SOMETIMES_PRODUCES   ## SystemTable\r
   gEfiMemoryAttributesTableGuid                 ## SOMETIMES_PRODUCES   ## SystemTable\r
   gEfiEndOfDxeEventGroupGuid                    ## SOMETIMES_CONSUMES   ## Event\r
index 000864d3aab028dba58bfe2a6ad3196631f45846..f46ee72dcd16ac34728b54d49518e365a9102a34 100644 (file)
@@ -36,7 +36,6 @@
 #include <Guid/Apriori.h>\r
 #include <Guid/EventGroup.h>\r
 #include <Guid/EventLegacyBios.h>\r
-#include <Guid/ZeroGuid.h>\r
 #include <Guid/MemoryProfile.h>\r
 \r
 #include <Library/BaseLib.h>\r
index f7e32c4e09a8443fb2103a318ddeeade37155ef6..1f73cbb3422f69f78837909545bdf593c1af3dc1 100644 (file)
@@ -96,7 +96,6 @@
   gEdkiiMemoryProfileGuid\r
   ## SOMETIMES_PRODUCES   ## GUID # Install protocol\r
   gEdkiiSmmMemoryProfileGuid\r
-  gZeroGuid                                     ## SOMETIMES_CONSUMES   ## GUID\r
 \r
 [UserExtensions.TianoCore."ExtraFiles"]\r
   PiSmmCoreExtra.uni\r
index 1e68cbc01f9a3992b27b4be95c01a40dd5a7b386..ddcee8b0676f9f387b897dfe29bb9a74e9e0230d 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Library functions which relates with driver health.\r
 \r
-Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2011 - 2016, Intel Corporation. All rights reserved.<BR>\r
 (C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>\r
 (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>\r
 This program and the accompanying materials\r
@@ -446,7 +446,7 @@ BmRepairAllControllers (
   //\r
   // Configure PcdDriverHealthConfigureForm to ZeroGuid to disable driver health check.\r
   //\r
-  if (CompareGuid (PcdGetPtr (PcdDriverHealthConfigureForm), &gZeroGuid)) {\r
+  if (IsZeroGuid (PcdGetPtr (PcdDriverHealthConfigureForm))) {\r
     return;\r
   }\r
 \r
index 07ee45bbfab76d9b3ff6bc72a680470178d57031..cb719e9d580a7f7003908284fab12fa2b2540dbc 100644 (file)
@@ -45,7 +45,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Protocol/VariableLock.h>\r
 #include <Protocol/RamDisk.h>\r
 \r
-#include <Guid/ZeroGuid.h>\r
 #include <Guid/MemoryTypeInformation.h>\r
 #include <Guid/FileInfo.h>\r
 #include <Guid/GlobalVariable.h>\r
index 5d0bd1d64c669695ab283afcb9940807ccccdb98..8c3fd7f3766e94691a4d0da195d940751dfd4fc2 100644 (file)
@@ -87,7 +87,6 @@
   gEfiDiskInfoAhciInterfaceGuid                 ## SOMETIMES_CONSUMES ## GUID\r
   gEfiDiskInfoIdeInterfaceGuid                  ## SOMETIMES_CONSUMES ## GUID\r
   gEfiDiskInfoScsiInterfaceGuid                 ## SOMETIMES_CONSUMES ## GUID\r
-  gZeroGuid                                     ## CONSUMES ## GUID\r
 \r
 [Protocols]\r
   gEfiPciRootBridgeIoProtocolGuid               ## CONSUMES\r
index d770785490fecc0851aadfaa30faec34e10a6497..a54b867983b55aea0a1b7fd23237a5b41a1c2b8a 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Include file for Var Check Hii handler and bin.\r
 \r
-Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -22,8 +22,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Library/UefiBootServicesTableLib.h>\r
 #include <Library/MemoryAllocationLib.h>\r
 \r
-#include <Guid/ZeroGuid.h>\r
-\r
 #include <Protocol/HiiDatabase.h>\r
 #include <Protocol/FirmwareVolume2.h>\r
 #include <Protocol/FirmwareVolumeBlock.h>\r
index 21fc80e89c1ad8242b463a2cf81db165584bc1e9..71ece272e1bbef9d453a84343c06c4e5a3438370 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Var Check Hii generation from FV.\r
 \r
-Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -372,7 +372,7 @@ CreateVfrDriverList (
   UINTN                         Index;\r
   VAR_CHECK_VFR_DRIVER_INFO     *VfrDriverInfo;\r
 \r
-  for (Index = 0; !CompareGuid (&DriverGuidArray[Index], &gZeroGuid); Index++) {\r
+  for (Index = 0; !IsZeroGuid (&DriverGuidArray[Index]); Index++) {\r
      DEBUG ((EFI_D_INFO, "CreateVfrDriverList: %g\n", &DriverGuidArray[Index]));\r
      VfrDriverInfo = InternalVarCheckAllocateZeroPool (sizeof (*VfrDriverInfo));\r
      ASSERT (VfrDriverInfo != NULL);\r
@@ -421,7 +421,7 @@ VarCheckHiiGenFromFv (
   //\r
   DriverGuidArray = (EFI_GUID *) PcdGetPtr (PcdVarCheckVfrDriverGuidArray);\r
 \r
-  if (CompareGuid (&DriverGuidArray[0], &gZeroGuid)) {\r
+  if (IsZeroGuid (&DriverGuidArray[0])) {\r
     //\r
     // No VFR driver will be parsed from FVs.\r
     //\r
index 24d24c5dd5245f456f022b3af71604365f96bf42..98e6983f6c2bb1464ba5e1fd934b294b8a47eef2 100644 (file)
@@ -46,9 +46,6 @@
   PcdLib\r
   VarCheckLib\r
 \r
-[Guids]\r
-  gZeroGuid                                 ## SOMETIMES_CONSUMES   ## GUID\r
-\r
 [Protocols]\r
   gEfiFirmwareVolume2ProtocolGuid           ## SOMETIMES_CONSUMES\r
   gEfiFirmwareVolumeBlock2ProtocolGuid      ## SOMETIMES_CONSUMES\r
index 1938ff2f99cdd5bcc533b622b942f132fdbd187f..ec4d285e0d39fa46f2baa9ca0e0576c0a2174ab7 100644 (file)
@@ -2829,7 +2829,7 @@ EvaluateExpression (
         if (StrPtr != NULL) {\r
           FreePool (StrPtr);\r
         }\r
-      } else if (CompareGuid (&OpCode->Guid, &gZeroGuid) != 0) {\r
+      } else if (IsZeroGuid (&OpCode->Guid)) {\r
         if (!GetQuestionValueFromForm(NULL, FormSet->HiiHandle, &OpCode->Guid, Value->Value.u16, &QuestionVal)){\r
           Value->Type = EFI_IFR_TYPE_UNDEFINED;\r
           break;\r
index 56ae7b02c21dac61bcbb92c5b2420594e84f3ac8..6856cc5d96c9da2526307506fa4a78a5b21663ce 100644 (file)
@@ -358,7 +358,7 @@ InitializeDisplayStatement (
   //\r
   // Create the refresh event process function.\r
   //\r
-  if (!CompareGuid (&Statement->RefreshGuid, &gZeroGuid)) {\r
+  if (!IsZeroGuid (&Statement->RefreshGuid)) {\r
     CreateRefreshEventForStatement (Statement);\r
   }\r
 \r
@@ -373,7 +373,7 @@ InitializeDisplayStatement (
   // Create the refresh guid hook event.\r
   // If the statement in this form has refresh event or refresh interval, browser will create this event for display engine.\r
   //\r
-  if ((!CompareGuid (&Statement->RefreshGuid, &gZeroGuid)) || (Statement->RefreshInterval != 0)) {\r
+  if ((!IsZeroGuid (&Statement->RefreshGuid)) || (Statement->RefreshInterval != 0)) {\r
     gDisplayFormData.FormRefreshEvent = mValueChangedEvent;\r
   }\r
 \r
@@ -628,7 +628,7 @@ AddStatementToDisplayForm (
   //\r
   // Create the refresh event process function for Form.\r
   //\r
-  if (!CompareGuid (&gCurrentSelection->Form->RefreshGuid, &gZeroGuid)) {\r
+  if (!IsZeroGuid (&gCurrentSelection->Form->RefreshGuid)) {\r
     CreateRefreshEventForForm (gCurrentSelection->Form);\r
     if (gDisplayFormData.FormRefreshEvent == NULL) {\r
       gDisplayFormData.FormRefreshEvent = mValueChangedEvent;\r
@@ -1410,7 +1410,7 @@ ProcessGotoOpCode (
     CopyMem (&Selection->FormSetGuid,&Statement->HiiValue.Value.ref.FormSetGuid, sizeof (EFI_GUID));\r
     Selection->FormId = Statement->HiiValue.Value.ref.FormId;\r
     Selection->QuestionId = Statement->HiiValue.Value.ref.QuestionId;\r
-  } else if (!CompareGuid (&Statement->HiiValue.Value.ref.FormSetGuid, &gZeroGuid)) {\r
+  } else if (!IsZeroGuid (&Statement->HiiValue.Value.ref.FormSetGuid)) {\r
     if (Selection->Form->ModalForm) {\r
       return Status;\r
     }\r
index 00f4b4136c160d224304fe3f75d31be1d901a8b2..3f368b54ec7d6b67d1fe546aaa575d198fc5edde 100644 (file)
@@ -181,7 +181,7 @@ UiFindMenuList (
     // Find the same FromSet.\r
     //\r
     if (MenuList->HiiHandle == HiiHandle) {\r
-      if (CompareGuid (&MenuList->FormSetGuid, &gZeroGuid)) {\r
+      if (IsZeroGuid (&MenuList->FormSetGuid)) {\r
         //\r
         // FormSetGuid is not specified.\r
         //\r
@@ -5689,7 +5689,7 @@ GetIfrBinaryData (
           //\r
           // Try to compare against formset GUID\r
           //\r
-          if (CompareGuid (FormSetGuid, &gZeroGuid) || \r
+          if (IsZeroGuid (FormSetGuid) ||\r
               CompareGuid (ComparingGuid, (EFI_GUID *)(OpCodeData + sizeof (EFI_IFR_OP_HEADER)))) {\r
             break;\r
           }\r
index fb16af31b1a999863077ebe81dd527e124336124..2ceba379043fba649d51a91872aad141bed23298 100644 (file)
@@ -14,7 +14,7 @@
   VariableServiceSetVariable(), VariableServiceQueryVariableInfo(), ReclaimForOS(),\r
   SmmVariableGetStatistics() should also do validation based on its own knowledge.\r
 \r
-Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -35,7 +35,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Library/SmmMemLib.h>\r
 \r
 #include <Guid/SmmVariableCommon.h>\r
-#include <Guid/ZeroGuid.h>\r
 #include "Variable.h"\r
 \r
 extern VARIABLE_INFO_ENTRY                           *gVariableInfo;\r
@@ -373,7 +372,7 @@ SmmVariableGetStatistics (
 \r
   CopyGuid (&VendorGuid, &InfoEntry->VendorGuid);\r
 \r
-  if (CompareGuid (&VendorGuid, &gZeroGuid)) {\r
+  if (IsZeroGuid (&VendorGuid)) {\r
     //\r
     // Return the first variable info\r
     //\r
index 5f9017252406893e892382e533c5836851550472..ccfb6fc740c1c0be0c8bb2412f1208eac1f4979d 100644 (file)
   ## SOMETIMES_CONSUMES   ## Variable:L"VarErrorFlag"\r
   ## SOMETIMES_PRODUCES   ## Variable:L"VarErrorFlag"\r
   gEdkiiVarErrorFlagGuid\r
-  gZeroGuid                                     ## SOMETIMES_CONSUMES   ## GUID\r
 \r
 [Pcd]\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize       ## CONSUMES\r