From 39cde03cc5efd67c11dc75cd5ba5e8ccf55c5594 Mon Sep 17 00:00:00 2001 From: Hao Wu Date: Tue, 30 Aug 2016 09:57:59 +0800 Subject: 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 Cc: Star Zeng Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu Reviewed-by: Feng Tian --- 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 --- 6 files changed, 6 insertions(+), 13 deletions(-) (limited to 'MdeModulePkg/Library') diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmDriverHealth.c b/MdeModulePkg/Library/UefiBootManagerLib/BmDriverHealth.c index 1e68cbc01f..ddcee8b067 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. -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 program and the accompanying materials @@ -446,7 +446,7 @@ BmRepairAllControllers ( // // Configure PcdDriverHealthConfigureForm to ZeroGuid to disable driver health check. // - if (CompareGuid (PcdGetPtr (PcdDriverHealthConfigureForm), &gZeroGuid)) { + if (IsZeroGuid (PcdGetPtr (PcdDriverHealthConfigureForm))) { return; } diff --git a/MdeModulePkg/Library/UefiBootManagerLib/InternalBm.h b/MdeModulePkg/Library/UefiBootManagerLib/InternalBm.h index 07ee45bbfa..cb719e9d58 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 -#include #include #include #include diff --git a/MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf b/MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf index 5d0bd1d64c..8c3fd7f376 100644 --- a/MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf +++ b/MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf @@ -87,7 +87,6 @@ gEfiDiskInfoAhciInterfaceGuid ## SOMETIMES_CONSUMES ## GUID gEfiDiskInfoIdeInterfaceGuid ## SOMETIMES_CONSUMES ## GUID gEfiDiskInfoScsiInterfaceGuid ## SOMETIMES_CONSUMES ## GUID - gZeroGuid ## CONSUMES ## GUID [Protocols] gEfiPciRootBridgeIoProtocolGuid ## CONSUMES diff --git a/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHii.h b/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHii.h index d770785490..a54b867983 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. -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 available under the terms and conditions of the BSD License 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 #include -#include - #include #include #include diff --git a/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiGenFromFv.c b/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiGenFromFv.c index 21fc80e89c..71ece272e1 100644 --- a/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiGenFromFv.c +++ b/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiGenFromFv.c @@ -1,7 +1,7 @@ /** @file Var Check Hii generation from FV. -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 available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -372,7 +372,7 @@ CreateVfrDriverList ( UINTN Index; 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])); VfrDriverInfo = InternalVarCheckAllocateZeroPool (sizeof (*VfrDriverInfo)); ASSERT (VfrDriverInfo != NULL); @@ -421,7 +421,7 @@ VarCheckHiiGenFromFv ( // DriverGuidArray = (EFI_GUID *) PcdGetPtr (PcdVarCheckVfrDriverGuidArray); - 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/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiLib.inf index 24d24c5dd5..98e6983f6c 100644 --- a/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiLib.inf +++ b/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiLib.inf @@ -46,9 +46,6 @@ PcdLib VarCheckLib -[Guids] - gZeroGuid ## SOMETIMES_CONSUMES ## GUID - [Protocols] gEfiFirmwareVolume2ProtocolGuid ## SOMETIMES_CONSUMES gEfiFirmwareVolumeBlock2ProtocolGuid ## SOMETIMES_CONSUMES -- cgit v1.2.3