From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (using TLSv1 with cipher CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id C2B871A1E05 for ; Mon, 29 Aug 2016 19:43:23 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 29 Aug 2016 19:43:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,254,1470726000"; d="scan'208";a="1022039479" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga001.jf.intel.com with ESMTP; 29 Aug 2016 19:43:21 -0700 Received: from fmsmsx111.amr.corp.intel.com (10.18.116.5) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 29 Aug 2016 19:43:21 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by fmsmsx111.amr.corp.intel.com (10.18.116.5) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 29 Aug 2016 19:43:20 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.91]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.102]) with mapi id 14.03.0248.002; Tue, 30 Aug 2016 10:43:18 +0800 From: "Tian, Feng" To: "Wu, Hao A" , "edk2-devel@lists.01.org" , "Gao, Liming" CC: "Zeng, Star" , "Tian, Feng" Thread-Topic: [PATCH 2/3] MdeModulePkg: Use IsZeroGuid API for zero GUID checking Thread-Index: AQHSAmdTaCwDBjqP7Ei44SoQFiQ03KBgy60g Date: Tue, 30 Aug 2016 02:43:18 +0000 Message-ID: <7F1BAD85ADEA444D97065A60D2E97EE566D7E2B7@SHSMSX101.ccr.corp.intel.com> References: <1472524574-17732-1-git-send-email-hao.a.wu@intel.com> <1472524574-17732-3-git-send-email-hao.a.wu@intel.com> In-Reply-To: <1472524574-17732-3-git-send-email-hao.a.wu@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH 2/3] MdeModulePkg: Use IsZeroGuid API for zero GUID checking X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Aug 2016 02:43:24 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Feng Tian Thanks Feng -----Original Message----- From: Wu, Hao A=20 Sent: Tuesday, August 30, 2016 10:36 AM To: edk2-devel@lists.01.org; Gao, Liming Cc: Wu, Hao A ; Tian, Feng ; Zeng,= Star Subject: [PATCH 2/3] MdeModulePkg: Use IsZeroGuid API for zero GUID checkin= g Instead of comparing a GUID with gZeroGuid via the CompareGuid API, the com= mit uses the IsZeroGuid API to check if the given GUID is a zero GUID. Cc: Feng Tian Cc: Star Zeng Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu --- MdeModulePkg/Application/MemoryProfileInfo/MemoryProfileInfo.c | 3 +-- MdeModulePkg/Application/MemoryProfileInfo/MemoryProfileInfo.inf | 1 - MdeModulePkg/Core/Dxe/DxeMain.h | 1 - MdeModulePkg/Core/Dxe/DxeMain.inf | 1 - MdeModulePkg/Core/PiSmmCore/PiSmmCore.h | 1 - MdeModulePkg/Core/PiSmmCore/PiSmmCore.inf | 1 - MdeModulePkg/Library/UefiBootManagerLib/BmDriverHealth.c | 4 ++-- MdeModulePkg/Library/UefiBootManagerLib/InternalBm.h | 1 - MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf | 1 - MdeModulePkg/Library/VarCheckHiiLib/VarCheckHii.h | 4 +--- MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiGenFromFv.c | 6 +++--= - MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiLib.inf | 3 --- MdeModulePkg/Universal/SetupBrowserDxe/Expression.c | 2 +- MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c | 8 ++++-= --- MdeModulePkg/Universal/SetupBrowserDxe/Setup.c | 4 ++-- MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.c | 5 ++--- MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf | 1 - 17 files changed, 16 insertions(+), 31 deletions(-) diff --git a/MdeModulePkg/Application/MemoryProfileInfo/MemoryProfileInfo.c= b/MdeModulePkg/Application/MemoryProfileInfo/MemoryProfileInfo.c index e82ee9c..14e8934 100644 --- a/MdeModulePkg/Application/MemoryProfileInfo/MemoryProfileInfo.c +++ b/MdeModulePkg/Application/MemoryProfileInfo/MemoryProfileInfo.c @@ -27,7 +27,6 @@ #include #include =20 -#include #include #include =20 @@ -255,7 +254,7 @@ GetDriverNameString ( return mNameString; } =20 - if (!CompareGuid (&DriverInfo->FileName, &gZeroGuid)) { + if (!IsZeroGuid (&DriverInfo->FileName)) { // // Try to get the image's FFS UI section by image GUID // diff --git a/MdeModulePkg/Application/MemoryProfileInfo/MemoryProfileInfo.i= nf b/MdeModulePkg/Application/MemoryProfileInfo/MemoryProfileInfo.inf index c512a3f..4bb7a9d 100644 --- a/MdeModulePkg/Application/MemoryProfileInfo/MemoryProfileInfo.inf +++ b/MdeModulePkg/Application/MemoryProfileInfo/MemoryProfileInfo.inf @@ -52,7 +52,6 @@ ## SOMETIMES_CONSUMES ## GUID # Locate protocol ## SOMETIMES_CONSUMES ## GUID # SmiHandlerRegister gEdkiiMemoryProfileGuid - gZeroGuid ## SOMETIMES_CONSUMES ## GUID gEdkiiPiSmmCommunicationRegionTableGuid ## SOMETIMES_CONSUMES ## Syst= emTable =20 [Protocols] diff --git a/MdeModulePkg/Core/Dxe/DxeMain.h b/MdeModulePkg/Core/Dxe/DxeMai= n.h index 60d85f0..aefeeb7 100644 --- a/MdeModulePkg/Core/Dxe/DxeMain.h +++ b/MdeModulePkg/Core/Dxe/DxeMain.h @@ -69,7 +69,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER= EXPRESS OR IMPLIED. #include #include #include -#include #include =20 #include diff --git a/MdeModulePkg/Core/Dxe/DxeMain.inf b/MdeModulePkg/Core/Dxe/DxeM= ain.inf index 450da57..13a2381 100644 --- a/MdeModulePkg/Core/Dxe/DxeMain.inf +++ b/MdeModulePkg/Core/Dxe/DxeMain.inf @@ -124,7 +124,6 @@ gEventExitBootServicesFailedGuid ## SOMETIMES_PRODUCES ##= Event gEfiVectorHandoffTableGuid ## SOMETIMES_PRODUCES ##= SystemTable gEdkiiMemoryProfileGuid ## SOMETIMES_PRODUCES ##= GUID # Install protocol - gZeroGuid ## SOMETIMES_CONSUMES ##= GUID gEfiPropertiesTableGuid ## SOMETIMES_PRODUCES ##= SystemTable gEfiMemoryAttributesTableGuid ## SOMETIMES_PRODUCES ##= SystemTable gEfiEndOfDxeEventGroupGuid ## SOMETIMES_CONSUMES ##= Event diff --git a/MdeModulePkg/Core/PiSmmCore/PiSmmCore.h b/MdeModulePkg/Core/Pi= SmmCore/PiSmmCore.h index 000864d..f46ee72 100644 --- a/MdeModulePkg/Core/PiSmmCore/PiSmmCore.h +++ b/MdeModulePkg/Core/PiSmmCore/PiSmmCore.h @@ -36,7 +36,6 @@ #include #include #include -#include #include =20 #include diff --git a/MdeModulePkg/Core/PiSmmCore/PiSmmCore.inf b/MdeModulePkg/Core/= PiSmmCore/PiSmmCore.inf index f7e32c4..1f73cbb 100644 --- a/MdeModulePkg/Core/PiSmmCore/PiSmmCore.inf +++ b/MdeModulePkg/Core/PiSmmCore/PiSmmCore.inf @@ -96,7 +96,6 @@ gEdkiiMemoryProfileGuid ## SOMETIMES_PRODUCES ## GUID # Install protocol gEdkiiSmmMemoryProfileGuid - gZeroGuid ## SOMETIMES_CONSUMES ##= GUID =20 [UserExtensions.TianoCore."ExtraFiles"] PiSmmCoreExtra.uni diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmDriverHealth.c b/Mde= ModulePkg/Library/UefiBootManagerLib/BmDriverHealth.c index 1e68cbc..ddcee8b 100644 --- a/MdeModulePkg/Library/UefiBootManagerLib/BmDriverHealth.c +++ b/MdeModulePkg/Library/UefiBootManagerLib/BmDriverHealth.c @@ -1,7 +1,7 @@ /** @file Library functions which relates with driver health. =20 -Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.
+Copyright (c) 2011 - 2016, Intel Corporation. All rights reserved.
(C) Copyright 2015 Hewlett-Packard Development Company, L.P.
(C) Copyright 2016 Hewlett Packard Enterprise Development LP
This pro= gram and the accompanying materials @@ -446,7 +446,7 @@ BmRepairAllControll= ers ( // // Configure PcdDriverHealthConfigureForm to ZeroGuid to disable driver = health check. // - if (CompareGuid (PcdGetPtr (PcdDriverHealthConfigureForm), &gZeroGuid)) = { + if (IsZeroGuid (PcdGetPtr (PcdDriverHealthConfigureForm))) { return; } =20 diff --git a/MdeModulePkg/Library/UefiBootManagerLib/InternalBm.h b/MdeModu= lePkg/Library/UefiBootManagerLib/InternalBm.h index 07ee45b..cb719e9 100644 --- a/MdeModulePkg/Library/UefiBootManagerLib/InternalBm.h +++ b/MdeModulePkg/Library/UefiBootManagerLib/InternalBm.h @@ -45,7 +45,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER= EXPRESS OR IMPLIED. #include #include =20 -#include #include #include #incl= ude diff --git a/MdeModulePkg/Library/UefiBootManag= erLib/UefiBootManagerLib.inf b/MdeModulePkg/Library/UefiBootManagerLib/Uefi= BootManagerLib.inf index 5d0bd1d..8c3fd7f 100644 --- a/MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf +++ b/MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf @@ -87,7 +87,6 @@ gEfiDiskInfoAhciInterfaceGuid ## SOMETIMES_CONSUMES ## G= UID gEfiDiskInfoIdeInterfaceGuid ## SOMETIMES_CONSUMES ## G= UID gEfiDiskInfoScsiInterfaceGuid ## SOMETIMES_CONSUMES ## G= UID - gZeroGuid ## CONSUMES ## GUID =20 [Protocols] gEfiPciRootBridgeIoProtocolGuid ## CONSUMES diff --git a/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHii.h b/MdeModuleP= kg/Library/VarCheckHiiLib/VarCheckHii.h index d770785..a54b867 100644 --- a/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHii.h +++ b/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHii.h @@ -1,7 +1,7 @@ /** @file Include file for Var Check Hii handler and bin. =20 -Copyright (c) 2015, Intel Corporation. All rights reserved.
+Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made availab= le under the terms and conditions of the BSD License which accompanies thi= s 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 I= MPLIED. #include #include =20 -#include - #include #include #include diff --git a/MdeModulePkg/Librar= y/VarCheckHiiLib/VarCheckHiiGenFromFv.c b/MdeModulePkg/Library/VarCheckHiiL= ib/VarCheckHiiGenFromFv.c index 21fc80e..71ece27 100644 --- a/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiGenFromFv.c +++ b/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiGenFromFv.c @@ -1,7 +1,7 @@ /** @file Var Check Hii generation from FV. =20 -Copyright (c) 2015, Intel Corporation. All rights reserved.
+Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made availab= le under the terms and conditions of the BSD License which accompanies thi= s distribution. The full text of the license may be found at @@ -372,7 +37= 2,7 @@ CreateVfrDriverList ( UINTN Index; VAR_CHECK_VFR_DRIVER_INFO *VfrDriverInfo; =20 - for (Index =3D 0; !CompareGuid (&DriverGuidArray[Index], &gZeroGuid); In= dex++) { + for (Index =3D 0; !IsZeroGuid (&DriverGuidArray[Index]); Index++) { DEBUG ((EFI_D_INFO, "CreateVfrDriverList: %g\n", &DriverGuidArray[Ind= ex])); VfrDriverInfo =3D InternalVarCheckAllocateZeroPool (sizeof (*VfrDrive= rInfo)); ASSERT (VfrDriverInfo !=3D NULL); @@ -421,7 +421,7 @@ VarCheckHiiGenFromFv ( // DriverGuidArray =3D (EFI_GUID *) PcdGetPtr (PcdVarCheckVfrDriverGuidArra= y); =20 - if (CompareGuid (&DriverGuidArray[0], &gZeroGuid)) { + if (IsZeroGuid (&DriverGuidArray[0])) { // // No VFR driver will be parsed from FVs. // diff --git a/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiLib.inf b/MdeMo= dulePkg/Library/VarCheckHiiLib/VarCheckHiiLib.inf index 24d24c5..98e6983 100644 --- a/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiLib.inf +++ b/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiLib.inf @@ -46,9 +46,6 @@ PcdLib VarCheckLib =20 -[Guids] - gZeroGuid ## SOMETIMES_CONSUMES ## GUI= D - [Protocols] gEfiFirmwareVolume2ProtocolGuid ## SOMETIMES_CONSUMES gEfiFirmwareVolumeBlock2ProtocolGuid ## SOMETIMES_CONSUMES diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c b/MdeModul= ePkg/Universal/SetupBrowserDxe/Expression.c index 1938ff2..ec4d285 100644 --- a/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c +++ b/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c @@ -2829,7 +2829,7 @@ EvaluateExpression ( if (StrPtr !=3D NULL) { FreePool (StrPtr); } - } else if (CompareGuid (&OpCode->Guid, &gZeroGuid) !=3D 0) { + } else if (IsZeroGuid (&OpCode->Guid)) { if (!GetQuestionValueFromForm(NULL, FormSet->HiiHandle, &OpCode->G= uid, Value->Value.u16, &QuestionVal)){ Value->Type =3D EFI_IFR_TYPE_UNDEFINED; break; diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c b/MdeMod= ulePkg/Universal/SetupBrowserDxe/Presentation.c index 56ae7b0..6856cc5 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); } =20 @@ -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 !=3D 0)) { + if ((!IsZeroGuid (&Statement->RefreshGuid)) ||=20 + (Statement->RefreshInterval !=3D 0)) { gDisplayFormData.FormRefreshEvent =3D mValueChangedEvent; } =20 @@ -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 =3D=3D NULL) { gDisplayFormData.FormRefreshEvent =3D mValueChangedEvent; @@ -1410,7= +1410,7 @@ ProcessGotoOpCode ( CopyMem (&Selection->FormSetGuid,&Statement->HiiValue.Value.ref.FormSe= tGuid, sizeof (EFI_GUID)); Selection->FormId =3D Statement->HiiValue.Value.ref.FormId; Selection->QuestionId =3D Statement->HiiValue.Value.ref.QuestionId; - } else if (!CompareGuid (&Statement->HiiValue.Value.ref.FormSetGuid, &gZ= eroGuid)) { + } else if (!IsZeroGuid (&Statement->HiiValue.Value.ref.FormSetGuid))=20 + { if (Selection->Form->ModalForm) { return Status; } diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c b/MdeModulePkg/= Universal/SetupBrowserDxe/Setup.c index 00f4b41..3f368b5 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 =3D=3D 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) ||=20 + if (IsZeroGuid (FormSetGuid) || CompareGuid (ComparingGuid, (EFI_GUID *)(OpCodeData + sizeof= (EFI_IFR_OP_HEADER)))) { break; } diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.c b/Mde= ModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.c index fb16af3..2ceba37 100644 --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.c +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.c @@ -14,7 +14,7 @@ VariableServiceSetVariable(), VariableServiceQueryVariableInfo(), Reclai= mForOS(), SmmVariableGetStatistics() should also do validation based on its own kn= owledge. =20 -Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved.
+Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made availab= le under the terms and conditions of the BSD License which accompanies thi= s 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 I= MPLIED. #include =20 #include -#include #include "Variable.h" =20 extern VARIABLE_INFO_ENTRY *gVariableInfo; @@ -373,7 +372,7 @@ SmmVariableGetStatistics ( =20 CopyGuid (&VendorGuid, &InfoEntry->VendorGuid); =20 - if (CompareGuid (&VendorGuid, &gZeroGuid)) { + if (IsZeroGuid (&VendorGuid)) { // // Return the first variable info // diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf b/M= deModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf index 5f90172..ccfb6fc 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 =20 [Pcd] gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize ## CO= NSUMES -- 1.9.5.msysgit.0