summaryrefslogtreecommitdiffstats
path: root/SecurityPkg/HddPassword
diff options
context:
space:
mode:
authorMichael Kubacki <michael.kubacki@microsoft.com>2020-04-11 04:02:18 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2020-04-21 02:20:51 +0000
commit3571e1360e812e6963db0e7aad0304d11e889041 (patch)
tree91dd72c893928b853120892aa73e4a2182114d59 /SecurityPkg/HddPassword
parent9c463f6f59d44afca386f63c70aabc751263a4a7 (diff)
downloadedk2-3571e1360e812e6963db0e7aad0304d11e889041.tar.gz
edk2-3571e1360e812e6963db0e7aad0304d11e889041.tar.bz2
edk2-3571e1360e812e6963db0e7aad0304d11e889041.zip
SecurityPkg/HddPassword: Use BaseLib linked list iteration macros
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1959 Replaces usage of the linked list iteration macros defined in HddPasswordDxe.h with the common definition in BaseLib.h. Cc: Chao Zhang <chao.b.zhang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Bret Barkelew <bret.barkelew@microsoft.com>
Diffstat (limited to 'SecurityPkg/HddPassword')
-rw-r--r--SecurityPkg/HddPassword/HddPasswordDxe.c13
-rw-r--r--SecurityPkg/HddPassword/HddPasswordDxe.h7
2 files changed, 8 insertions, 12 deletions
diff --git a/SecurityPkg/HddPassword/HddPasswordDxe.c b/SecurityPkg/HddPassword/HddPasswordDxe.c
index a25b3471d0..32b55a6a8b 100644
--- a/SecurityPkg/HddPassword/HddPasswordDxe.c
+++ b/SecurityPkg/HddPassword/HddPasswordDxe.c
@@ -2,6 +2,7 @@
HDD password driver which is used to support HDD security feature.
Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) Microsoft Corporation.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -115,7 +116,7 @@ BuildHddPasswordDeviceInfo (
// Build HDD password device info and save them to LockBox.
//
DevInfoLength = 0;
- EFI_LIST_FOR_EACH (Entry, &mHddPasswordConfigFormList) {
+ BASE_LIST_FOR_EACH (Entry, &mHddPasswordConfigFormList) {
ConfigFormEntry = BASE_CR (Entry, HDD_PASSWORD_CONFIG_FORM_ENTRY, Link);
//
@@ -164,7 +165,7 @@ BuildHddPasswordDeviceInfo (
ASSERT (DevInfo != NULL);
TempDevInfo = DevInfo;
- EFI_LIST_FOR_EACH (Entry, &mHddPasswordConfigFormList) {
+ BASE_LIST_FOR_EACH (Entry, &mHddPasswordConfigFormList) {
ConfigFormEntry = BASE_CR (Entry, HDD_PASSWORD_CONFIG_FORM_ENTRY, Link);
if ((!PasswordIsFullZero (ConfigFormEntry->Password)) ||
@@ -472,7 +473,7 @@ HddPasswordEndOfDxeEventNotify (
//
// Zero passsword and freeze lock device.
//
- EFI_LIST_FOR_EACH (Entry, &mHddPasswordConfigFormList) {
+ BASE_LIST_FOR_EACH (Entry, &mHddPasswordConfigFormList) {
ConfigFormEntry = BASE_CR (Entry, HDD_PASSWORD_CONFIG_FORM_ENTRY, Link);
ZeroMem (ConfigFormEntry->Password, HDD_PASSWORD_MAX_LENGTH);
@@ -2026,7 +2027,7 @@ HddPasswordGetConfigFormEntryByIndex (
CurrentIndex = 0;
ConfigFormEntry = NULL;
- EFI_LIST_FOR_EACH (Entry, &mHddPasswordConfigFormList) {
+ BASE_LIST_FOR_EACH (Entry, &mHddPasswordConfigFormList) {
if (CurrentIndex == Index) {
ConfigFormEntry = BASE_CR (Entry, HDD_PASSWORD_CONFIG_FORM_ENTRY, Link);
break;
@@ -2408,7 +2409,7 @@ HddPasswordConfigUpdateForm (
ConfigFormEntry = NULL;
EntryExisted = FALSE;
- EFI_LIST_FOR_EACH (Entry, &mHddPasswordConfigFormList) {
+ BASE_LIST_FOR_EACH (Entry, &mHddPasswordConfigFormList) {
ConfigFormEntry = BASE_CR (Entry, HDD_PASSWORD_CONFIG_FORM_ENTRY, Link);
if ((ConfigFormEntry->Bus == Bus) &&
@@ -2503,7 +2504,7 @@ HddPasswordConfigUpdateForm (
EndLabel->Number = HDD_DEVICE_LABEL_END;
mNumberOfHddDevices = 0;
- EFI_LIST_FOR_EACH (Entry, &mHddPasswordConfigFormList) {
+ BASE_LIST_FOR_EACH (Entry, &mHddPasswordConfigFormList) {
ConfigFormEntry = BASE_CR (Entry, HDD_PASSWORD_CONFIG_FORM_ENTRY, Link);
HiiCreateGotoOpCode (
diff --git a/SecurityPkg/HddPassword/HddPasswordDxe.h b/SecurityPkg/HddPassword/HddPasswordDxe.h
index 87db587eb6..a6c87169dc 100644
--- a/SecurityPkg/HddPassword/HddPasswordDxe.h
+++ b/SecurityPkg/HddPassword/HddPasswordDxe.h
@@ -1,6 +1,7 @@
/** @file
Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) Microsoft Corporation.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -87,12 +88,6 @@ typedef struct _HDD_PASSWORD_DXE_PRIVATE_DATA {
#define HDD_PASSWORD_DXE_PRIVATE_FROM_THIS(a) CR (a, HDD_PASSWORD_DXE_PRIVATE_DATA, ConfigAccess, HDD_PASSWORD_DXE_PRIVATE_SIGNATURE)
-//
-//Iterate through the double linked list. NOT delete safe
-//
-#define EFI_LIST_FOR_EACH(Entry, ListHead) \
- for (Entry = (ListHead)->ForwardLink; Entry != (ListHead); Entry = Entry->ForwardLink)
-
#define PASSWORD_SALT_SIZE 32
#define HDD_PASSWORD_REQUEST_VARIABLE_NAME L"HddPasswordRequest"