MdeModulePkg: Use IsZeroGuid API for zero GUID checking

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>
This commit is contained in:
Hao Wu
2016-08-30 09:57:59 +08:00
parent dc2109946d
commit 39cde03cc5
17 changed files with 16 additions and 31 deletions

View File

@ -27,7 +27,6 @@
#include <Protocol/SmmCommunication.h> #include <Protocol/SmmCommunication.h>
#include <Protocol/SmmAccess2.h> #include <Protocol/SmmAccess2.h>
#include <Guid/ZeroGuid.h>
#include <Guid/MemoryProfile.h> #include <Guid/MemoryProfile.h>
#include <Guid/PiSmmCommunicationRegionTable.h> #include <Guid/PiSmmCommunicationRegionTable.h>
@ -255,7 +254,7 @@ GetDriverNameString (
return mNameString; return mNameString;
} }
if (!CompareGuid (&DriverInfo->FileName, &gZeroGuid)) { if (!IsZeroGuid (&DriverInfo->FileName)) {
// //
// Try to get the image's FFS UI section by image GUID // Try to get the image's FFS UI section by image GUID
// //

View File

@ -52,7 +52,6 @@
## SOMETIMES_CONSUMES ## GUID # Locate protocol ## SOMETIMES_CONSUMES ## GUID # Locate protocol
## SOMETIMES_CONSUMES ## GUID # SmiHandlerRegister ## SOMETIMES_CONSUMES ## GUID # SmiHandlerRegister
gEdkiiMemoryProfileGuid gEdkiiMemoryProfileGuid
gZeroGuid ## SOMETIMES_CONSUMES ## GUID
gEdkiiPiSmmCommunicationRegionTableGuid ## SOMETIMES_CONSUMES ## SystemTable gEdkiiPiSmmCommunicationRegionTableGuid ## SOMETIMES_CONSUMES ## SystemTable
[Protocols] [Protocols]

View File

@ -69,7 +69,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Guid/IdleLoopEvent.h> #include <Guid/IdleLoopEvent.h>
#include <Guid/VectorHandoffTable.h> #include <Guid/VectorHandoffTable.h>
#include <Ppi/VectorHandoffInfo.h> #include <Ppi/VectorHandoffInfo.h>
#include <Guid/ZeroGuid.h>
#include <Guid/MemoryProfile.h> #include <Guid/MemoryProfile.h>
#include <Library/DxeCoreEntryPoint.h> #include <Library/DxeCoreEntryPoint.h>

View File

@ -124,7 +124,6 @@
gEventExitBootServicesFailedGuid ## SOMETIMES_PRODUCES ## Event gEventExitBootServicesFailedGuid ## SOMETIMES_PRODUCES ## Event
gEfiVectorHandoffTableGuid ## SOMETIMES_PRODUCES ## SystemTable gEfiVectorHandoffTableGuid ## SOMETIMES_PRODUCES ## SystemTable
gEdkiiMemoryProfileGuid ## SOMETIMES_PRODUCES ## GUID # Install protocol gEdkiiMemoryProfileGuid ## SOMETIMES_PRODUCES ## GUID # Install protocol
gZeroGuid ## SOMETIMES_CONSUMES ## GUID
gEfiPropertiesTableGuid ## SOMETIMES_PRODUCES ## SystemTable gEfiPropertiesTableGuid ## SOMETIMES_PRODUCES ## SystemTable
gEfiMemoryAttributesTableGuid ## SOMETIMES_PRODUCES ## SystemTable gEfiMemoryAttributesTableGuid ## SOMETIMES_PRODUCES ## SystemTable
gEfiEndOfDxeEventGroupGuid ## SOMETIMES_CONSUMES ## Event gEfiEndOfDxeEventGroupGuid ## SOMETIMES_CONSUMES ## Event

View File

@ -36,7 +36,6 @@
#include <Guid/Apriori.h> #include <Guid/Apriori.h>
#include <Guid/EventGroup.h> #include <Guid/EventGroup.h>
#include <Guid/EventLegacyBios.h> #include <Guid/EventLegacyBios.h>
#include <Guid/ZeroGuid.h>
#include <Guid/MemoryProfile.h> #include <Guid/MemoryProfile.h>
#include <Library/BaseLib.h> #include <Library/BaseLib.h>

View File

@ -96,7 +96,6 @@
gEdkiiMemoryProfileGuid gEdkiiMemoryProfileGuid
## SOMETIMES_PRODUCES ## GUID # Install protocol ## SOMETIMES_PRODUCES ## GUID # Install protocol
gEdkiiSmmMemoryProfileGuid gEdkiiSmmMemoryProfileGuid
gZeroGuid ## SOMETIMES_CONSUMES ## GUID
[UserExtensions.TianoCore."ExtraFiles"] [UserExtensions.TianoCore."ExtraFiles"]
PiSmmCoreExtra.uni PiSmmCoreExtra.uni

View File

@ -1,7 +1,7 @@
/** @file /** @file
Library functions which relates with driver health. Library functions which relates with driver health.
Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.<BR> Copyright (c) 2011 - 2016, Intel Corporation. All rights reserved.<BR>
(C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR> (C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>
(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR> (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
This program and the accompanying materials This program and the accompanying materials
@ -446,7 +446,7 @@ BmRepairAllControllers (
// //
// Configure PcdDriverHealthConfigureForm to ZeroGuid to disable driver health check. // Configure PcdDriverHealthConfigureForm to ZeroGuid to disable driver health check.
// //
if (CompareGuid (PcdGetPtr (PcdDriverHealthConfigureForm), &gZeroGuid)) { if (IsZeroGuid (PcdGetPtr (PcdDriverHealthConfigureForm))) {
return; return;
} }

View File

@ -45,7 +45,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Protocol/VariableLock.h> #include <Protocol/VariableLock.h>
#include <Protocol/RamDisk.h> #include <Protocol/RamDisk.h>
#include <Guid/ZeroGuid.h>
#include <Guid/MemoryTypeInformation.h> #include <Guid/MemoryTypeInformation.h>
#include <Guid/FileInfo.h> #include <Guid/FileInfo.h>
#include <Guid/GlobalVariable.h> #include <Guid/GlobalVariable.h>

View File

@ -87,7 +87,6 @@
gEfiDiskInfoAhciInterfaceGuid ## SOMETIMES_CONSUMES ## GUID gEfiDiskInfoAhciInterfaceGuid ## SOMETIMES_CONSUMES ## GUID
gEfiDiskInfoIdeInterfaceGuid ## SOMETIMES_CONSUMES ## GUID gEfiDiskInfoIdeInterfaceGuid ## SOMETIMES_CONSUMES ## GUID
gEfiDiskInfoScsiInterfaceGuid ## SOMETIMES_CONSUMES ## GUID gEfiDiskInfoScsiInterfaceGuid ## SOMETIMES_CONSUMES ## GUID
gZeroGuid ## CONSUMES ## GUID
[Protocols] [Protocols]
gEfiPciRootBridgeIoProtocolGuid ## CONSUMES gEfiPciRootBridgeIoProtocolGuid ## CONSUMES

View File

@ -1,7 +1,7 @@
/** @file /** @file
Include file for Var Check Hii handler and bin. Include file for Var Check Hii handler and bin.
Copyright (c) 2015, Intel Corporation. All rights reserved.<BR> Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at which accompanies this distribution. The full text of the license may be found at
@ -22,8 +22,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Library/UefiBootServicesTableLib.h> #include <Library/UefiBootServicesTableLib.h>
#include <Library/MemoryAllocationLib.h> #include <Library/MemoryAllocationLib.h>
#include <Guid/ZeroGuid.h>
#include <Protocol/HiiDatabase.h> #include <Protocol/HiiDatabase.h>
#include <Protocol/FirmwareVolume2.h> #include <Protocol/FirmwareVolume2.h>
#include <Protocol/FirmwareVolumeBlock.h> #include <Protocol/FirmwareVolumeBlock.h>

View File

@ -1,7 +1,7 @@
/** @file /** @file
Var Check Hii generation from FV. Var Check Hii generation from FV.
Copyright (c) 2015, Intel Corporation. All rights reserved.<BR> Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at which accompanies this distribution. The full text of the license may be found at
@ -372,7 +372,7 @@ CreateVfrDriverList (
UINTN Index; UINTN Index;
VAR_CHECK_VFR_DRIVER_INFO *VfrDriverInfo; VAR_CHECK_VFR_DRIVER_INFO *VfrDriverInfo;
for (Index = 0; !CompareGuid (&DriverGuidArray[Index], &gZeroGuid); Index++) { for (Index = 0; !IsZeroGuid (&DriverGuidArray[Index]); Index++) {
DEBUG ((EFI_D_INFO, "CreateVfrDriverList: %g\n", &DriverGuidArray[Index])); DEBUG ((EFI_D_INFO, "CreateVfrDriverList: %g\n", &DriverGuidArray[Index]));
VfrDriverInfo = InternalVarCheckAllocateZeroPool (sizeof (*VfrDriverInfo)); VfrDriverInfo = InternalVarCheckAllocateZeroPool (sizeof (*VfrDriverInfo));
ASSERT (VfrDriverInfo != NULL); ASSERT (VfrDriverInfo != NULL);
@ -421,7 +421,7 @@ VarCheckHiiGenFromFv (
// //
DriverGuidArray = (EFI_GUID *) PcdGetPtr (PcdVarCheckVfrDriverGuidArray); DriverGuidArray = (EFI_GUID *) PcdGetPtr (PcdVarCheckVfrDriverGuidArray);
if (CompareGuid (&DriverGuidArray[0], &gZeroGuid)) { if (IsZeroGuid (&DriverGuidArray[0])) {
// //
// No VFR driver will be parsed from FVs. // No VFR driver will be parsed from FVs.
// //

View File

@ -46,9 +46,6 @@
PcdLib PcdLib
VarCheckLib VarCheckLib
[Guids]
gZeroGuid ## SOMETIMES_CONSUMES ## GUID
[Protocols] [Protocols]
gEfiFirmwareVolume2ProtocolGuid ## SOMETIMES_CONSUMES gEfiFirmwareVolume2ProtocolGuid ## SOMETIMES_CONSUMES
gEfiFirmwareVolumeBlock2ProtocolGuid ## SOMETIMES_CONSUMES gEfiFirmwareVolumeBlock2ProtocolGuid ## SOMETIMES_CONSUMES

View File

@ -2829,7 +2829,7 @@ EvaluateExpression (
if (StrPtr != NULL) { if (StrPtr != NULL) {
FreePool (StrPtr); FreePool (StrPtr);
} }
} else if (CompareGuid (&OpCode->Guid, &gZeroGuid) != 0) { } else if (IsZeroGuid (&OpCode->Guid)) {
if (!GetQuestionValueFromForm(NULL, FormSet->HiiHandle, &OpCode->Guid, Value->Value.u16, &QuestionVal)){ if (!GetQuestionValueFromForm(NULL, FormSet->HiiHandle, &OpCode->Guid, Value->Value.u16, &QuestionVal)){
Value->Type = EFI_IFR_TYPE_UNDEFINED; Value->Type = EFI_IFR_TYPE_UNDEFINED;
break; break;

View File

@ -358,7 +358,7 @@ InitializeDisplayStatement (
// //
// Create the refresh event process function. // Create the refresh event process function.
// //
if (!CompareGuid (&Statement->RefreshGuid, &gZeroGuid)) { if (!IsZeroGuid (&Statement->RefreshGuid)) {
CreateRefreshEventForStatement (Statement); CreateRefreshEventForStatement (Statement);
} }
@ -373,7 +373,7 @@ InitializeDisplayStatement (
// Create the refresh guid hook event. // Create the refresh guid hook event.
// If the statement in this form has refresh event or refresh interval, browser will create this event for display engine. // If the statement in this form has refresh event or refresh interval, browser will create this event for display engine.
// //
if ((!CompareGuid (&Statement->RefreshGuid, &gZeroGuid)) || (Statement->RefreshInterval != 0)) { if ((!IsZeroGuid (&Statement->RefreshGuid)) || (Statement->RefreshInterval != 0)) {
gDisplayFormData.FormRefreshEvent = mValueChangedEvent; gDisplayFormData.FormRefreshEvent = mValueChangedEvent;
} }
@ -628,7 +628,7 @@ AddStatementToDisplayForm (
// //
// Create the refresh event process function for Form. // Create the refresh event process function for Form.
// //
if (!CompareGuid (&gCurrentSelection->Form->RefreshGuid, &gZeroGuid)) { if (!IsZeroGuid (&gCurrentSelection->Form->RefreshGuid)) {
CreateRefreshEventForForm (gCurrentSelection->Form); CreateRefreshEventForForm (gCurrentSelection->Form);
if (gDisplayFormData.FormRefreshEvent == NULL) { if (gDisplayFormData.FormRefreshEvent == NULL) {
gDisplayFormData.FormRefreshEvent = mValueChangedEvent; gDisplayFormData.FormRefreshEvent = mValueChangedEvent;
@ -1410,7 +1410,7 @@ ProcessGotoOpCode (
CopyMem (&Selection->FormSetGuid,&Statement->HiiValue.Value.ref.FormSetGuid, sizeof (EFI_GUID)); CopyMem (&Selection->FormSetGuid,&Statement->HiiValue.Value.ref.FormSetGuid, sizeof (EFI_GUID));
Selection->FormId = Statement->HiiValue.Value.ref.FormId; Selection->FormId = Statement->HiiValue.Value.ref.FormId;
Selection->QuestionId = Statement->HiiValue.Value.ref.QuestionId; Selection->QuestionId = Statement->HiiValue.Value.ref.QuestionId;
} else if (!CompareGuid (&Statement->HiiValue.Value.ref.FormSetGuid, &gZeroGuid)) { } else if (!IsZeroGuid (&Statement->HiiValue.Value.ref.FormSetGuid)) {
if (Selection->Form->ModalForm) { if (Selection->Form->ModalForm) {
return Status; return Status;
} }

View File

@ -181,7 +181,7 @@ UiFindMenuList (
// Find the same FromSet. // Find the same FromSet.
// //
if (MenuList->HiiHandle == HiiHandle) { if (MenuList->HiiHandle == HiiHandle) {
if (CompareGuid (&MenuList->FormSetGuid, &gZeroGuid)) { if (IsZeroGuid (&MenuList->FormSetGuid)) {
// //
// FormSetGuid is not specified. // FormSetGuid is not specified.
// //
@ -5689,7 +5689,7 @@ GetIfrBinaryData (
// //
// Try to compare against formset GUID // Try to compare against formset GUID
// //
if (CompareGuid (FormSetGuid, &gZeroGuid) || if (IsZeroGuid (FormSetGuid) ||
CompareGuid (ComparingGuid, (EFI_GUID *)(OpCodeData + sizeof (EFI_IFR_OP_HEADER)))) { CompareGuid (ComparingGuid, (EFI_GUID *)(OpCodeData + sizeof (EFI_IFR_OP_HEADER)))) {
break; break;
} }

View File

@ -14,7 +14,7 @@
VariableServiceSetVariable(), VariableServiceQueryVariableInfo(), ReclaimForOS(), VariableServiceSetVariable(), VariableServiceQueryVariableInfo(), ReclaimForOS(),
SmmVariableGetStatistics() should also do validation based on its own knowledge. SmmVariableGetStatistics() should also do validation based on its own knowledge.
Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved.<BR> Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at which accompanies this distribution. The full text of the license may be found at
@ -35,7 +35,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Library/SmmMemLib.h> #include <Library/SmmMemLib.h>
#include <Guid/SmmVariableCommon.h> #include <Guid/SmmVariableCommon.h>
#include <Guid/ZeroGuid.h>
#include "Variable.h" #include "Variable.h"
extern VARIABLE_INFO_ENTRY *gVariableInfo; extern VARIABLE_INFO_ENTRY *gVariableInfo;
@ -373,7 +372,7 @@ SmmVariableGetStatistics (
CopyGuid (&VendorGuid, &InfoEntry->VendorGuid); CopyGuid (&VendorGuid, &InfoEntry->VendorGuid);
if (CompareGuid (&VendorGuid, &gZeroGuid)) { if (IsZeroGuid (&VendorGuid)) {
// //
// Return the first variable info // Return the first variable info
// //

View File

@ -114,7 +114,6 @@
## SOMETIMES_CONSUMES ## Variable:L"VarErrorFlag" ## SOMETIMES_CONSUMES ## Variable:L"VarErrorFlag"
## SOMETIMES_PRODUCES ## Variable:L"VarErrorFlag" ## SOMETIMES_PRODUCES ## Variable:L"VarErrorFlag"
gEdkiiVarErrorFlagGuid gEdkiiVarErrorFlagGuid
gZeroGuid ## SOMETIMES_CONSUMES ## GUID
[Pcd] [Pcd]
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize ## CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize ## CONSUMES