summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Universal
diff options
context:
space:
mode:
authorHao Wu <hao.a.wu@intel.com>2016-08-30 09:57:59 +0800
committerHao Wu <hao.a.wu@intel.com>2016-08-31 11:14:01 +0800
commit39cde03cc5efd67c11dc75cd5ba5e8ccf55c5594 (patch)
treed4d827b1e200cddc07aa3103979ff8df88bbc3a7 /MdeModulePkg/Universal
parentdc2109946df2522974a058b0bca5530befdea1cd (diff)
downloadedk2-39cde03cc5efd67c11dc75cd5ba5e8ccf55c5594.tar.gz
edk2-39cde03cc5efd67c11dc75cd5ba5e8ccf55c5594.tar.bz2
edk2-39cde03cc5efd67c11dc75cd5ba5e8ccf55c5594.zip
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>
Diffstat (limited to 'MdeModulePkg/Universal')
-rw-r--r--MdeModulePkg/Universal/SetupBrowserDxe/Expression.c2
-rw-r--r--MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c8
-rw-r--r--MdeModulePkg/Universal/SetupBrowserDxe/Setup.c4
-rw-r--r--MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.c5
-rw-r--r--MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf1
5 files changed, 9 insertions, 11 deletions
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c b/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c
index 1938ff2f99..ec4d285e0d 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c
@@ -2829,7 +2829,7 @@ EvaluateExpression (
if (StrPtr != NULL) {
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)){
Value->Type = EFI_IFR_TYPE_UNDEFINED;
break;
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
index 56ae7b02c2..6856cc5d96 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
@@ -358,7 +358,7 @@ InitializeDisplayStatement (
//
// Create the refresh event process function.
//
- if (!CompareGuid (&Statement->RefreshGuid, &gZeroGuid)) {
+ if (!IsZeroGuid (&Statement->RefreshGuid)) {
CreateRefreshEventForStatement (Statement);
}
@@ -373,7 +373,7 @@ InitializeDisplayStatement (
// 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 ((!CompareGuid (&Statement->RefreshGuid, &gZeroGuid)) || (Statement->RefreshInterval != 0)) {
+ if ((!IsZeroGuid (&Statement->RefreshGuid)) || (Statement->RefreshInterval != 0)) {
gDisplayFormData.FormRefreshEvent = mValueChangedEvent;
}
@@ -628,7 +628,7 @@ AddStatementToDisplayForm (
//
// Create the refresh event process function for Form.
//
- if (!CompareGuid (&gCurrentSelection->Form->RefreshGuid, &gZeroGuid)) {
+ if (!IsZeroGuid (&gCurrentSelection->Form->RefreshGuid)) {
CreateRefreshEventForForm (gCurrentSelection->Form);
if (gDisplayFormData.FormRefreshEvent == NULL) {
gDisplayFormData.FormRefreshEvent = mValueChangedEvent;
@@ -1410,7 +1410,7 @@ ProcessGotoOpCode (
CopyMem (&Selection->FormSetGuid,&Statement->HiiValue.Value.ref.FormSetGuid, sizeof (EFI_GUID));
Selection->FormId = Statement->HiiValue.Value.ref.FormId;
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) {
return Status;
}
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c
index 00f4b4136c..3f368b54ec 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c
@@ -181,7 +181,7 @@ UiFindMenuList (
// Find the same FromSet.
//
if (MenuList->HiiHandle == HiiHandle) {
- if (CompareGuid (&MenuList->FormSetGuid, &gZeroGuid)) {
+ if (IsZeroGuid (&MenuList->FormSetGuid)) {
//
// FormSetGuid is not specified.
//
@@ -5689,7 +5689,7 @@ GetIfrBinaryData (
//
// Try to compare against formset GUID
//
- if (CompareGuid (FormSetGuid, &gZeroGuid) ||
+ if (IsZeroGuid (FormSetGuid) ||
CompareGuid (ComparingGuid, (EFI_GUID *)(OpCodeData + sizeof (EFI_IFR_OP_HEADER)))) {
break;
}
diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.c
index fb16af31b1..2ceba37904 100644
--- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.c
+++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.c
@@ -14,7 +14,7 @@
VariableServiceSetVariable(), VariableServiceQueryVariableInfo(), ReclaimForOS(),
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
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
@@ -35,7 +35,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Library/SmmMemLib.h>
#include <Guid/SmmVariableCommon.h>
-#include <Guid/ZeroGuid.h>
#include "Variable.h"
extern VARIABLE_INFO_ENTRY *gVariableInfo;
@@ -373,7 +372,7 @@ SmmVariableGetStatistics (
CopyGuid (&VendorGuid, &InfoEntry->VendorGuid);
- if (CompareGuid (&VendorGuid, &gZeroGuid)) {
+ if (IsZeroGuid (&VendorGuid)) {
//
// Return the first variable info
//
diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf
index 5f90172524..ccfb6fc740 100644
--- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf
+++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf
@@ -114,7 +114,6 @@
## SOMETIMES_CONSUMES ## Variable:L"VarErrorFlag"
## SOMETIMES_PRODUCES ## Variable:L"VarErrorFlag"
gEdkiiVarErrorFlagGuid
- gZeroGuid ## SOMETIMES_CONSUMES ## GUID
[Pcd]
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize ## CONSUMES