From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mx.groups.io with SMTP id smtpd.web10.21629.1586473817683106483 for ; Thu, 09 Apr 2020 16:10:18 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.65, mailfrom: jiewen.yao@intel.com) IronPort-SDR: LJdZnlwtcPypYHk2lqQ4vLJJPHcRaD6t59N8sUX9sMrrXJuOatyR1FEPTJXMA2wlUHGvMw9Sw9 P7Oe76/uvbMA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Apr 2020 16:10:16 -0700 IronPort-SDR: TXURIaYL8nhl8RhSRqjlJH276TN0EjOBoeWBIWTYr57lcH2AyJ225kNjv2VhfWmv/69KL+I+uV QktMH0VE48zA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,364,1580803200"; d="scan'208";a="240783601" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga007.jf.intel.com with ESMTP; 09 Apr 2020 16:10:16 -0700 Received: from fmsmsx114.amr.corp.intel.com (10.18.116.8) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 9 Apr 2020 16:10:16 -0700 Received: from shsmsx105.ccr.corp.intel.com (10.239.4.158) by FMSMSX114.amr.corp.intel.com (10.18.116.8) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 9 Apr 2020 16:10:16 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.138]) by SHSMSX105.ccr.corp.intel.com ([169.254.11.213]) with mapi id 14.03.0439.000; Fri, 10 Apr 2020 07:10:13 +0800 From: "Yao, Jiewen" To: "michael.kubacki@outlook.com" , "devel@edk2.groups.io" CC: "Zhang, Chao B" , "Wu, Hao A" , "Wang, Jian J" , Sean Brogan Subject: Re: [PATCH v1 7/7] SecurityPkg/HddPassword: Use BaseLib linked list iteration macros Thread-Topic: [PATCH v1 7/7] SecurityPkg/HddPassword: Use BaseLib linked list iteration macros Thread-Index: AQHWDqpoyVqvSDdoFUmdN+24i6fNw6hxaqdg Date: Thu, 9 Apr 2020 23:10:13 +0000 Message-ID: <74D8A39837DF1E4DA445A8C0B3885C503F9D507E@shsmsx102.ccr.corp.intel.com> References: <20200409200514.32796-1-michael.kubacki@outlook.com> In-Reply-To: Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: jiewen.yao@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Jiewen.yao@intel.com > -----Original Message----- > From: michael.kubacki@outlook.com > Sent: Friday, April 10, 2020 4:05 AM > To: devel@edk2.groups.io > Cc: Zhang, Chao B ; Wu, Hao A > ; Wang, Jian J ; Yao, Jiewen > ; Sean Brogan > Subject: [PATCH v1 7/7] SecurityPkg/HddPassword: Use BaseLib linked list > iteration macros >=20 > From: Michael Kubacki >=20 > REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D1959 >=20 > Replaces usage of the linked list iteration macros defined in > HddPasswordDxe.h with the common definition in BaseLib.h. >=20 > Cc: Chao Zhang > Cc: Hao A Wu > Cc: Jian J Wang > Cc: Jiewen Yao > Cc: Sean Brogan > Signed-off-by: Michael Kubacki > --- > SecurityPkg/HddPassword/HddPasswordDxe.c | 13 +++++++------ > SecurityPkg/HddPassword/HddPasswordDxe.h | 7 +------ > 2 files changed, 8 insertions(+), 12 deletions(-) >=20 > diff --git a/SecurityPkg/HddPassword/HddPasswordDxe.c > b/SecurityPkg/HddPassword/HddPasswordDxe.c > index a25b3471d073..32b55a6a8b72 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. >=20 > Copyright (c) 2019, Intel Corporation. All rights reserved.
> + Copyright (c) Microsoft Corporation.
>=20 > SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > @@ -115,7 +116,7 @@ BuildHddPasswordDeviceInfo ( > // Build HDD password device info and save them to LockBox. > // > DevInfoLength =3D 0; > - EFI_LIST_FOR_EACH (Entry, &mHddPasswordConfigFormList) { > + BASE_LIST_FOR_EACH (Entry, &mHddPasswordConfigFormList) { > ConfigFormEntry =3D BASE_CR (Entry, HDD_PASSWORD_CONFIG_FORM_ENTRY, > Link); >=20 > // > @@ -164,7 +165,7 @@ BuildHddPasswordDeviceInfo ( > ASSERT (DevInfo !=3D NULL); >=20 > TempDevInfo =3D DevInfo; > - EFI_LIST_FOR_EACH (Entry, &mHddPasswordConfigFormList) { > + BASE_LIST_FOR_EACH (Entry, &mHddPasswordConfigFormList) { > ConfigFormEntry =3D BASE_CR (Entry, HDD_PASSWORD_CONFIG_FORM_ENTRY, > Link); >=20 > 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 =3D BASE_CR (Entry, HDD_PASSWORD_CONFIG_FORM_ENTRY, > Link); >=20 > ZeroMem (ConfigFormEntry->Password, HDD_PASSWORD_MAX_LENGTH); > @@ -2026,7 +2027,7 @@ HddPasswordGetConfigFormEntryByIndex ( > CurrentIndex =3D 0; > ConfigFormEntry =3D NULL; >=20 > - EFI_LIST_FOR_EACH (Entry, &mHddPasswordConfigFormList) { > + BASE_LIST_FOR_EACH (Entry, &mHddPasswordConfigFormList) { > if (CurrentIndex =3D=3D Index) { > ConfigFormEntry =3D BASE_CR (Entry, > HDD_PASSWORD_CONFIG_FORM_ENTRY, Link); > break; > @@ -2408,7 +2409,7 @@ HddPasswordConfigUpdateForm ( > ConfigFormEntry =3D NULL; > EntryExisted =3D FALSE; >=20 > - EFI_LIST_FOR_EACH (Entry, &mHddPasswordConfigFormList) { > + BASE_LIST_FOR_EACH (Entry, &mHddPasswordConfigFormList) { > ConfigFormEntry =3D BASE_CR (Entry, HDD_PASSWORD_CONFIG_FORM_ENTRY, > Link); >=20 > if ((ConfigFormEntry->Bus =3D=3D Bus) && > @@ -2503,7 +2504,7 @@ HddPasswordConfigUpdateForm ( > EndLabel->Number =3D HDD_DEVICE_LABEL_END; >=20 > mNumberOfHddDevices =3D 0; > - EFI_LIST_FOR_EACH (Entry, &mHddPasswordConfigFormList) { > + BASE_LIST_FOR_EACH (Entry, &mHddPasswordConfigFormList) { > ConfigFormEntry =3D BASE_CR (Entry, > HDD_PASSWORD_CONFIG_FORM_ENTRY, Link); >=20 > HiiCreateGotoOpCode ( > diff --git a/SecurityPkg/HddPassword/HddPasswordDxe.h > b/SecurityPkg/HddPassword/HddPasswordDxe.h > index 87db587eb6f0..a6c87169dc59 100644 > --- a/SecurityPkg/HddPassword/HddPasswordDxe.h > +++ b/SecurityPkg/HddPassword/HddPasswordDxe.h > @@ -1,6 +1,7 @@ > /** @file >=20 > Copyright (c) 2019, Intel Corporation. All rights reserved.
> + Copyright (c) Microsoft Corporation.
>=20 > SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > @@ -87,12 +88,6 @@ typedef struct _HDD_PASSWORD_DXE_PRIVATE_DATA { >=20 > #define HDD_PASSWORD_DXE_PRIVATE_FROM_THIS(a) CR (a, > HDD_PASSWORD_DXE_PRIVATE_DATA, ConfigAccess, > HDD_PASSWORD_DXE_PRIVATE_SIGNATURE) >=20 > -// > -//Iterate through the double linked list. NOT delete safe > -// > -#define EFI_LIST_FOR_EACH(Entry, ListHead) \ > - for (Entry =3D (ListHead)->ForwardLink; Entry !=3D (ListHead); Entry = =3D Entry- > >ForwardLink) > - > #define PASSWORD_SALT_SIZE 32 >=20 > #define HDD_PASSWORD_REQUEST_VARIABLE_NAME > L"HddPasswordRequest" > -- > 2.16.3.windows.1