From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (NAM12-MW2-obe.outbound.protection.outlook.com [40.107.244.130]) by mx.groups.io with SMTP id smtpd.web10.512.1586561828292857999 for ; Fri, 10 Apr 2020 16:37:08 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@microsoft.com header.s=selector2 header.b=jcVbfRg+; spf=pass (domain: microsoft.com, ip: 40.107.244.130, mailfrom: bret.barkelew@microsoft.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oRdQZ2lFIUy0kTePPNqiLCTegC6dBRV0zol0RGwHFPJ2OrCWfq0471kPU9JNpQx2cbQ5HxW4PpH4lbJSZRdTCjSkj4g4ExYm+Ov1PMlZsgLjU84WYTiUIInOcuA9YJEq6iz0G6vvimzTkM7cNmzSHWStWe+EurucigoUyq1+qtenjBivxbvPNYZW/Aei/yGrlSOMw8g7BUXFIvHtu4U1ZZcSC+AWjWUVwU/I92A9CdPI25osvwuj/8gnBEVgC1DQCW9BwwKobKNJhxDxSsIJcdcq7ct170nKK9MSEaaNAUUBiInRZWnFjgHDBjOIRyVtHeXwZ7TAbBIB+sY7EXiOJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BmxIEB44AhEFMKhvmfK0J0Eb21b4QKgLmyXD2sT++L8=; b=Ny0xtbJnyRsFQ7d1LxS5haDuW8GdBKG1Hk7CdVyKFm9Iu7zeU7RVMNLXaA4EyXwjy/zB75rRkOTY0Cmop9Ji3IOOQsM0ck11rkREErmL3WoSWmriScQGU707Z/oasKHS63l3c7xua8x/OZ36JDr3L0UWMvaoTTTRlc+e51Pnw4Mivla+3s+nVRMTf9vfXPz42grS31LUg1QbuRMmrW8qWHREmRYR7P6EeCjvBFbtzj1CC1NG6WVpjYMawI1aNKwQfxgzvoQmeS+Usl5zYsHAb7ZyZyKsfwPR8oOHOEADyXinU4sW0S73TFiYFg+BicJP9b8mmSH/kJSYsy0K8KwIuw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microsoft.com; dmarc=pass action=none header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BmxIEB44AhEFMKhvmfK0J0Eb21b4QKgLmyXD2sT++L8=; b=jcVbfRg+vIsWcG2fIY+9MX6tfYeg0BX2k5OkxS2fJKNTs5v4cvURlQZ+Cj/lBgDnGks/xShR88Cjdc08+FkXYdZwy6cTHwOC9AcgiIcECIKdwLGWnzpKeKku5OMyhKxidondHmvWVH7J9K5kbZMuphnQLCKMfXu46aCjmiHLxKo= Received: from CY4PR21MB0743.namprd21.prod.outlook.com (2603:10b6:903:b2::9) by CY4PR21MB0790.namprd21.prod.outlook.com (2603:10b6:903:13b::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2900.2; Fri, 10 Apr 2020 23:37:06 +0000 Received: from CY4PR21MB0743.namprd21.prod.outlook.com ([fe80::90d:10d9:c5bc:5318]) by CY4PR21MB0743.namprd21.prod.outlook.com ([fe80::90d:10d9:c5bc:5318%12]) with mapi id 15.20.2921.009; Fri, 10 Apr 2020 23:37:06 +0000 From: "Bret Barkelew" To: "devel@edk2.groups.io" , "michael.kubacki@outlook.com" CC: Dandan Bi , Hao A Wu , Jian J Wang , Liming Gao , Ray Ni , Sean Brogan Subject: Re: [EXTERNAL] [edk2-devel] [PATCH v2 6/7] MdeModulePkg/RamDiskDxe: Use BaseLib linked list iteration macros Thread-Topic: [EXTERNAL] [edk2-devel] [PATCH v2 6/7] MdeModulePkg/RamDiskDxe: Use BaseLib linked list iteration macros Thread-Index: AQHWD3MI2V8CP+CqtUyA2EtVAPEPnahzAvVu Date: Fri, 10 Apr 2020 23:37:06 +0000 Message-ID: References: <20200410200218.24992-1-michael.kubacki@outlook.com>, In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=True;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2020-04-10T23:36:58.7306279Z;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ContentBits=0;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Method=Privileged authentication-results: spf=none (sender IP is ) smtp.mailfrom=Bret.Barkelew@microsoft.com; x-originating-ip: [71.212.145.195] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 8619ed25-2058-4131-1e74-08d7dda814a9 x-ms-traffictypediagnostic: CY4PR21MB0790:|CY4PR21MB0790: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-forefront-prvs: 0369E8196C x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CY4PR21MB0743.namprd21.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(10019020)(4636009)(136003)(39860400002)(376002)(396003)(366004)(346002)(7696005)(8990500004)(76116006)(66946007)(8676002)(26005)(186003)(82950400001)(33656002)(91956017)(8936002)(53546011)(82960400001)(6506007)(71200400001)(66476007)(4326008)(52536014)(478600001)(5660300002)(107886003)(54906003)(966005)(10290500003)(2906002)(316002)(66446008)(81156014)(66556008)(55016002)(64756008)(86362001)(110136005)(9686003)(44824005);DIR:OUT;SFP:1102; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: VF81hpk7v8sM45xW7fwbfzMfGomG6qSXdfc30B4J2IGEUdcTM8EbwjkOD+PRo3hqTy6JBTNNB6Z+jeZHPkzJ+RK0nrGF/fDDkgD/9HxfF1nk8axxRk+G9h9JqL5llxn1t8fVfPShiYAWKBpC1kaVwTtewwjYXhkzZBScQQHpU26uaE9RzElqmmJlfD3c1+XhDpjSjX0EE+iqPkLqtrFjuk9QIaoLH297SvpYAt/0JnpvFa92xu5s2mgLDeJz0f8Ghk6+OHFdswPlglWk6wuYmRjsVVSNldrz1WqWEjpEQ8sJ13n+zOBWPbNtzajaQ/LZ1UaxIUfFD/fgbvtZNl52xYXIWYmyEZVGYruLhgLZnnBRIeibqPwO2C/6MyKJPzxxQQXmvWKqpnMVUVvDCMSlTIVApn0BXrRSO4m0bDnAlyflQ7goov8prUai55DszyX9HN7Rb+fa7uuPR6JYIoYC4BdzY9CvqZmdp45k8GDuMZFglXQYIZLSeJlOu7toXH9EWeQULf3ehDZedG+UWbet6L1Hjwh7YYgpssCB7bx0CeWGg6UT0sTSmt9jrtxEVJE7 x-ms-exchange-antispam-messagedata: Xg9sfLAyrriTo2UXH8FSCorOlS8PgBLwRWlSTLPCHyy4HJ7o+cqy6tMPOxeOEff3YjPmBvWkwQQSItNvQomdBqzOopZEHKfqDQ1dk4pkCK8AVUxy0vv2dHpMh8JIAK4Z634WxNh3u6HSmIkJXvIGtg== MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8619ed25-2058-4131-1e74-08d7dda814a9 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Apr 2020 23:37:06.5427 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: T/HjKp05vO1LsxhBmdyeGpJDxYu+99JoWuMJLAzuNJGLPwiv32rpa1b+tuKdIswCztSu/dRCm6DMJHaIBYPFPg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR21MB0790 Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_CY4PR21MB0743824808D5F21907F6170BEFDE0CY4PR21MB0743namp_" --_000_CY4PR21MB0743824808D5F21907F6170BEFDE0CY4PR21MB0743namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Bret Barkelew - Bret ________________________________ From: devel@edk2.groups.io on behalf of Michael Kub= acki via groups.io Sent: Friday, April 10, 2020 1:02:17 PM To: devel@edk2.groups.io Cc: Dandan Bi ; Hao A Wu ; Jian J= Wang ; Liming Gao ; Ray Ni ; Sean Brogan Subject: [EXTERNAL] [edk2-devel] [PATCH v2 6/7] MdeModulePkg/RamDiskDxe: U= se BaseLib linked list iteration macros From: Michael Kubacki REF:https://nam06.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fbu= gzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D1959&data=3D02%7C01%7Cbret.b= arkelew%40microsoft.com%7C12b6ab8be60a43c8326808d7dd8a2a52%7C72f988bf86f141= af91ab2d7cd011db47%7C1%7C0%7C637221457789115342&sdata=3DSoQ2JMwtD84nofS= N%2B0Ge71u1hTL%2BFds8FcmWYcPd39o%3D&reserved=3D0 Replaces usage of the linked list iteration macros defined in RamDiskImpl.= h with the common definition in BaseLib.h. Cc: Dandan Bi Cc: Hao A Wu Cc: Jian J Wang Cc: Liming Gao Cc: Ray Ni Cc: Sean Brogan Signed-off-by: Michael Kubacki Reviewed-by: Hao A Wu --- MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDriver.c | 3 ++- MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskImpl.c | 9 +++++---- MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskProtocol.c | 5 +++-- MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskImpl.h | 15 +----------= ---- 4 files changed, 11 insertions(+), 21 deletions(-) diff --git a/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDriver.c b/MdeM= odulePkg/Universal/Disk/RamDiskDxe/RamDiskDriver.c index a80ef271df9c..fcbf4f117dc6 100644 --- a/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDriver.c +++ b/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDriver.c @@ -2,6 +2,7 @@ The driver entry point for RamDiskDxe driver. Copyright (c) 2016, Intel Corporation. All rights reserved.
+ Copyright (c) Microsoft Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -92,7 +93,7 @@ RamDiskAcpiCheck ( return; } - EFI_LIST_FOR_EACH (Entry, &RegisteredRamDisks) { + BASE_LIST_FOR_EACH (Entry, &RegisteredRamDisks) { PrivateData =3D RAM_DISK_PRIVATE_FROM_THIS (Entry); RamDiskPublishNfit (PrivateData); } diff --git a/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskImpl.c b/MdeMod= ulePkg/Universal/Disk/RamDiskDxe/RamDiskImpl.c index 96ea74a9a536..e35b8fa2296c 100644 --- a/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskImpl.c +++ b/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskImpl.c @@ -3,6 +3,7 @@ Copyright (c) 2016, Intel Corporation. All rights reserved.
(C) Copyright 2016-2018 Hewlett Packard Enterprise Development LP
+ Copyright (c) Microsoft Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -165,7 +166,7 @@ UnregisterAllRamDisks ( RAM_DISK_PRIVATE_DATA *PrivateData; if (!IsListEmpty(&RegisteredRamDisks)) { - EFI_LIST_FOR_EACH_SAFE (Entry, NextEntry, &RegisteredRamDisks) { + BASE_LIST_FOR_EACH_SAFE (Entry, NextEntry, &RegisteredRamDisks) { PrivateData =3D RAM_DISK_PRIVATE_FROM_THIS (Entry); gBS->UninstallMultipleProtocolInterfaces ( @@ -507,7 +508,7 @@ UpdateMainForm ( EndLabel->Number =3D MAIN_LABEL_LIST_END; Index =3D 0; - EFI_LIST_FOR_EACH (Entry, &RegisteredRamDisks) { + BASE_LIST_FOR_EACH (Entry, &RegisteredRamDisks) { PrivateData =3D RAM_DISK_PRIVATE_FROM_THIS (Entry); PrivateData->CheckBoxId =3D (EFI_QUESTION_ID) (MAIN_CHECKBOX_QUESTION_ID_START + Ind= ex); @@ -689,7 +690,7 @@ RamDiskCallback ( // // Remove the selected RAM disks // - EFI_LIST_FOR_EACH_SAFE (Entry, NextEntry, &RegisteredRamDisks) { + BASE_LIST_FOR_EACH_SAFE (Entry, NextEntry, &RegisteredRamDisks) { PrivateData =3D RAM_DISK_PRIVATE_FROM_THIS (Entry); if (PrivateData->CheckBoxChecked) { RamDiskUnregister ( @@ -742,7 +743,7 @@ RamDiskCallback ( // if ((QuestionId >=3D MAIN_CHECKBOX_QUESTION_ID_START) && (QuestionId < CREATE_RAW_RAM_DISK_FORM_ID)) { - EFI_LIST_FOR_EACH (Entry, &RegisteredRamDisks) { + BASE_LIST_FOR_EACH (Entry, &RegisteredRamDisks) { PrivateData =3D RAM_DISK_PRIVATE_FROM_THIS (Entry); if (PrivateData->CheckBoxId =3D=3D QuestionId) { PrivateData->CheckBoxChecked =3D (BOOLEAN) (Value->u8 !=3D 0)= ; diff --git a/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskProtocol.c b/Md= eModulePkg/Universal/Disk/RamDiskDxe/RamDiskProtocol.c index 36d635e4bc31..4333e000539b 100644 --- a/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskProtocol.c +++ b/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskProtocol.c @@ -3,6 +3,7 @@ Copyright (c) 2016 - 2019, Intel Corporation. All rights reserved.
(C) Copyright 2016 Hewlett Packard Enterprise Development LP
+ Copyright (c) Microsoft Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -662,7 +663,7 @@ RamDiskRegister ( if (!IsListEmpty(&RegisteredRamDisks)) { DevicePathSize =3D GetDevicePathSize (PrivateData->DevicePath); - EFI_LIST_FOR_EACH (Entry, &RegisteredRamDisks) { + BASE_LIST_FOR_EACH (Entry, &RegisteredRamDisks) { RegisteredPrivateData =3D RAM_DISK_PRIVATE_FROM_THIS (Entry); if (DevicePathSize =3D=3D GetDevicePathSize (RegisteredPrivateData-= >DevicePath)) { // @@ -797,7 +798,7 @@ RamDiskUnregister ( EndingAddr =3D ReadUnaligned64 ((UINT64 *) &(RamDiskDevNode->Ending= Addr[0])); if (!IsListEmpty(&RegisteredRamDisks)) { - EFI_LIST_FOR_EACH_SAFE (Entry, NextEntry, &RegisteredRamDisks) { + BASE_LIST_FOR_EACH_SAFE (Entry, NextEntry, &RegisteredRamDisks) { PrivateData =3D RAM_DISK_PRIVATE_FROM_THIS (Entry); // diff --git a/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskImpl.h b/MdeMod= ulePkg/Universal/Disk/RamDiskDxe/RamDiskImpl.h index 25fec15c1882..ed80b47ccc33 100644 --- a/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskImpl.h +++ b/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskImpl.h @@ -2,6 +2,7 @@ The header file of RamDiskDxe driver. Copyright (c) 2016 - 2019, Intel Corporation. All rights reserved.
+ Copyright (c) Microsoft Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -47,20 +48,6 @@ // #define RAM_DISK_DEFAULT_BLOCK_SIZE 512 -// -// 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) - -// -// Iterate through the double linked list. This is delete-safe. -// Do not touch NextEntry -// -#define EFI_LIST_FOR_EACH_SAFE(Entry, NextEntry, ListHead) \ - for(Entry =3D (ListHead)->ForwardLink, NextEntry =3D Entry->ForwardLink= ;\ - Entry !=3D (ListHead); Entry =3D NextEntry, NextEntry =3D Entry->Fo= rwardLink) - // // RamDiskDxe driver maintains a list of registered RAM disks. // -- 2.16.3.windows.1 --_000_CY4PR21MB0743824808D5F21907F6170BEFDE0CY4PR21MB0743namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Reviewed-by: Bret Barkelew <bret.barkelew@micros= oft.com>

 

- Bret

 


From: devel@edk2.groups.io= <devel@edk2.groups.io> on behalf of Michael Kubacki via groups.io &l= t;michael.kubacki=3Doutlook.com@groups.io>
Sent: Friday, April 10, 2020 1:02:17 PM
To: devel@edk2.groups.io <devel@edk2.groups.io>
Cc: Dandan Bi <dandan.bi@intel.com>; Hao A Wu <hao.a.wu@in= tel.com>; Jian J Wang <jian.j.wang@intel.com>; Liming Gao <limi= ng.gao@intel.com>; Ray Ni <ray.ni@intel.com>; Sean Brogan <sean= .brogan@microsoft.com>
Subject: [EXTERNAL] [edk2-devel] [PATCH v2 6/7] MdeModulePkg/RamDis= kDxe: Use BaseLib linked list iteration macros
 
From: Michael Kubacki <michael.kubacki@microso= ft.com>

REF:https://nam06.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fbu= gzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D1959&amp;data=3D02%7C01%7Cbr= et.barkelew%40microsoft.com%7C12b6ab8be60a43c8326808d7dd8a2a52%7C72f988bf86= f141af91ab2d7cd011db47%7C1%7C0%7C637221457789115342&amp;sdata=3DSoQ2JMw= tD84nofSN%2B0Ge71u1hTL%2BFds8FcmWYcPd39o%3D&amp;reserved=3D0

Replaces usage of the linked list iteration macros defined in RamDiskImpl.= h
with the common definition in BaseLib.h.

Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
---
 MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDriver.c   |=   3 ++-
 MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskImpl.c  &nbs= p;  |  9 +++++----
 MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskProtocol.c |  5 &= #43;++--
 MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskImpl.h  &nbs= p;  | 15 +--------------
 4 files changed, 11 insertions(+), 21 deletions(-)

diff --git a/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDriver.c b/MdeM= odulePkg/Universal/Disk/RamDiskDxe/RamDiskDriver.c
index a80ef271df9c..fcbf4f117dc6 100644
--- a/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDriver.c
+++ b/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDriver.c @@ -2,6 +2,7 @@
   The driver entry point for RamDiskDxe driver.
 
   Copyright (c) 2016, Intel Corporation. All rights reserved.&l= t;BR>
+  Copyright (c) Microsoft Corporation.<BR>
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -92,7 +93,7 @@ RamDiskAcpiCheck (
     return;
   }
 
-  EFI_LIST_FOR_EACH (Entry, &RegisteredRamDisks) {
+  BASE_LIST_FOR_EACH (Entry, &RegisteredRamDisks) {
     PrivateData =3D RAM_DISK_PRIVATE_FROM_THIS (Entry= );
     RamDiskPublishNfit (PrivateData);
   }
diff --git a/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskImpl.c b/MdeMod= ulePkg/Universal/Disk/RamDiskDxe/RamDiskImpl.c
index 96ea74a9a536..e35b8fa2296c 100644
--- a/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskImpl.c
+++ b/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskImpl.c
@@ -3,6 +3,7 @@
 
   Copyright (c) 2016, Intel Corporation. All rights reserved.&l= t;BR>
   (C) Copyright 2016-2018 Hewlett Packard Enterprise Developmen= t LP<BR>
+  Copyright (c) Microsoft Corporation.<BR>
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -165,7 +166,7 @@ UnregisterAllRamDisks (
   RAM_DISK_PRIVATE_DATA      &nbs= p;    *PrivateData;
 
   if (!IsListEmpty(&RegisteredRamDisks)) {
-    EFI_LIST_FOR_EACH_SAFE (Entry, NextEntry, &Registe= redRamDisks) {
+    BASE_LIST_FOR_EACH_SAFE (Entry, NextEntry, &Re= gisteredRamDisks) {
       PrivateData =3D RAM_DISK_PRIVATE_FROM= _THIS (Entry);
 
       gBS->UninstallMultipleProtocolInte= rfaces (
@@ -507,7 +508,7 @@ UpdateMainForm (
   EndLabel->Number       =3D M= AIN_LABEL_LIST_END;
 
   Index =3D 0;
-  EFI_LIST_FOR_EACH (Entry, &RegisteredRamDisks) {
+  BASE_LIST_FOR_EACH (Entry, &RegisteredRamDisks) {
     PrivateData      &n= bsp;           =3D RAM_DI= SK_PRIVATE_FROM_THIS (Entry);
     PrivateData->CheckBoxId    = ;  =3D (EFI_QUESTION_ID)
            &n= bsp;            = ;           (MAIN_CHECKBO= X_QUESTION_ID_START + Index);
@@ -689,7 +690,7 @@ RamDiskCallback (
       //
       // Remove the selected RAM disks
       //
-      EFI_LIST_FOR_EACH_SAFE (Entry, NextEntry, = &RegisteredRamDisks) {
+      BASE_LIST_FOR_EACH_SAFE (Entry, NextEn= try, &RegisteredRamDisks) {
         PrivateData =3D RAM_DISK_= PRIVATE_FROM_THIS (Entry);
         if (PrivateData->Check= BoxChecked) {
           RamDiskUnregi= ster (
@@ -742,7 +743,7 @@ RamDiskCallback (
       //
       if ((QuestionId >=3D MAIN_CHECKBOX= _QUESTION_ID_START) &&
           (QuestionId &= lt; CREATE_RAW_RAM_DISK_FORM_ID)) {
-        EFI_LIST_FOR_EACH (Entry, &= ;RegisteredRamDisks) {
+        BASE_LIST_FOR_EACH (Entry,= &RegisteredRamDisks) {
           PrivateData = =3D RAM_DISK_PRIVATE_FROM_THIS (Entry);
           if (PrivateDa= ta->CheckBoxId =3D=3D QuestionId) {
             P= rivateData->CheckBoxChecked =3D (BOOLEAN) (Value->u8 !=3D 0);
diff --git a/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskProtocol.c b/Md= eModulePkg/Universal/Disk/RamDiskDxe/RamDiskProtocol.c
index 36d635e4bc31..4333e000539b 100644
--- a/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskProtocol.c
+++ b/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskProtocol.c=
@@ -3,6 +3,7 @@
 
   Copyright (c) 2016 - 2019, Intel Corporation. All rights rese= rved.<BR>
   (C) Copyright 2016 Hewlett Packard Enterprise Development LP&= lt;BR>
+  Copyright (c) Microsoft Corporation.<BR>
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -662,7 +663,7 @@ RamDiskRegister (
   if (!IsListEmpty(&RegisteredRamDisks)) {
     DevicePathSize =3D GetDevicePathSize (PrivateData= ->DevicePath);
 
-    EFI_LIST_FOR_EACH (Entry, &RegisteredRamDisks) { +    BASE_LIST_FOR_EACH (Entry, &RegisteredRamDisks= ) {
       RegisteredPrivateData =3D RAM_DISK_PR= IVATE_FROM_THIS (Entry);
       if (DevicePathSize =3D=3D GetDevicePa= thSize (RegisteredPrivateData->DevicePath)) {
         //
@@ -797,7 +798,7 @@ RamDiskUnregister (
   EndingAddr     =3D ReadUnaligned64 ((UINT= 64 *) &(RamDiskDevNode->EndingAddr[0]));
 
   if (!IsListEmpty(&RegisteredRamDisks)) {
-    EFI_LIST_FOR_EACH_SAFE (Entry, NextEntry, &Registe= redRamDisks) {
+    BASE_LIST_FOR_EACH_SAFE (Entry, NextEntry, &Re= gisteredRamDisks) {
       PrivateData =3D RAM_DISK_PRIVATE_FROM= _THIS (Entry);
 
       //
diff --git a/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskImpl.h b/MdeMod= ulePkg/Universal/Disk/RamDiskDxe/RamDiskImpl.h
index 25fec15c1882..ed80b47ccc33 100644
--- a/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskImpl.h
+++ b/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskImpl.h
@@ -2,6 +2,7 @@
   The header file of RamDiskDxe driver.
 
   Copyright (c) 2016 - 2019, Intel Corporation. All rights rese= rved.<BR>
+  Copyright (c) Microsoft Corporation.<BR>
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -47,20 +48,6 @@
 //
 #define RAM_DISK_DEFAULT_BLOCK_SIZE 512
 
-//
-// Iterate through the double linked list. NOT delete safe
-//
-#define EFI_LIST_FOR_EACH(Entry, ListHead)    \
-  for(Entry =3D (ListHead)->ForwardLink; Entry !=3D (ListHead); E= ntry =3D Entry->ForwardLink)
-
-//
-// Iterate through the double linked list. This is delete-safe.
-// Do not touch NextEntry
-//
-#define EFI_LIST_FOR_EACH_SAFE(Entry, NextEntry, ListHead)  &nb= sp;         \
-  for(Entry =3D (ListHead)->ForwardLink, NextEntry =3D Entry->= ForwardLink;\
-      Entry !=3D (ListHead); Entry =3D NextEntry= , NextEntry =3D Entry->ForwardLink)
-
 //
 // RamDiskDxe driver maintains a list of registered RAM disks.
 //
--
2.16.3.windows.1




--_000_CY4PR21MB0743824808D5F21907F6170BEFDE0CY4PR21MB0743namp_--