From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (NAM11-CO1-obe.outbound.protection.outlook.com [40.107.220.118]) by mx.groups.io with SMTP id smtpd.web12.571.1586562174137760557 for ; Fri, 10 Apr 2020 16:42:54 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@microsoft.com header.s=selector2 header.b=jflGteVW; spf=pass (domain: microsoft.com, ip: 40.107.220.118, mailfrom: bret.barkelew@microsoft.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AwGqBMSEpqHmHmXlxVSBW0ahh93eH2QthESJAiMhOpyof25ZJuOccXpgQoiRDOXDmvYUTDfLjTBXoznsLongFJ/7lk5KtRicNJ8pf/lmcHiW1NPWhTFK30xTO/Hte/g7EeNw33Gpg0u1vQxs6YMPo6d+1BAW+pLPpePujoDoswRL6GXH4vocLbPuOFw4uLRdeDFfk26U7NmwbJGFL609Lygru/kmtRnlDt1RmKG5c4O4c9+M2FuoXPKnwXkN0yrbxfMYGXl43e4vAxLHY2gelKLPQTIngBUYBKYr6ur4CLGfADJKuAiqvEKsh7Cr+dHP8eVWRZUngCsFwkQX82qGjQ== 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=2kYos05X1TifXO9L6+hFynw4mYKuJRZ0Xka4cpXm5bQ=; b=nERlARL5wp0z7WsfSxTewv/zK3fW4GF379Z8EUqymP3zy7YIL94wdHEgP4KfeucuxYkGujx+p5x6XVnvn3N312YeCWt7QGrquiEnArARXmbNYBTCHRUzfR+9W1TlOGQzcZNif7jslZV4S9A0o9Bxjqp9GLTqpKUdVzWTjLSZmM58rArZ8GpXXgZlnoGeYiwfqhyQdorOgG52fA1SpWH/BhoDzBHYmf/HuKvmLPqb+ovCfME6Hnxhn+t2zu75/quvRaRhqryzzzMD6n6lQmEjNdAsqrUZtqOBeWrdb+MZ2KeNzdItmkaxtM+tlBMV0cj9zJc58N3DGKx1vYOc17Qa7A== 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=2kYos05X1TifXO9L6+hFynw4mYKuJRZ0Xka4cpXm5bQ=; b=jflGteVWeoZl5JCmCz7Pfzd8BJ/bMCweQxWLOEg56zYRXypOx0Jo5u8xxPx+yhblzeZjsJqe/GC90UCekOny2cSbyhX+unIydciyiliHaD/IlZJRflthT9P0KAuQeRTHwdgeI945HYg8ZAvuc6tQIRNhNBBJcDkbpJEQoegsz4E= Received: from CY4PR21MB0743.namprd21.prod.outlook.com (2603:10b6:903:b2::9) by CY4PR21MB0776.namprd21.prod.outlook.com (2603:10b6:903:b8::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2921.8; Fri, 10 Apr 2020 23:42:52 +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:42:52 +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 2/7] MdeModulePkg/EhciDxe: Use BaseLib linked list iteration macros Thread-Topic: [EXTERNAL] [edk2-devel] [PATCH v2 2/7] MdeModulePkg/EhciDxe: Use BaseLib linked list iteration macros Thread-Index: AQHWD3MAvizEu/UHLkaS6ZRiWQqwkqhzBHf+ Date: Fri, 10 Apr 2020 23:42:52 +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:42:23.0289789Z;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: 35759f15-107c-46ca-91ab-08d7dda8e29d x-ms-traffictypediagnostic: CY4PR21MB0776:|CY4PR21MB0776: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3513; 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)(346002)(366004)(136003)(396003)(376002)(39860400002)(2906002)(8990500004)(52536014)(82950400001)(5660300002)(9686003)(64756008)(4326008)(66946007)(66476007)(91956017)(76116006)(33656002)(86362001)(55016002)(66446008)(66556008)(107886003)(82960400001)(10290500003)(26005)(6506007)(110136005)(54906003)(478600001)(8676002)(186003)(8936002)(81156014)(316002)(7696005)(966005)(53546011)(71200400001);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: sRxe8biGwmh0mWjrUHKL7ea537O5B15ydcmkwoZUup3At0JVtfa7qnj+RTD8hnaQqU2WHHHU9wE1YZvZg6zu4fvkk0qKj6HhcDurZ2o6isOHOX1UFAGJ46miSorSNkqFKkOi6w+mAX+ricwvzSn+6KztElseT+sMOmB5+exy2/PVdUa00N5vS7cuWQmDRe9NrFKFg0wTnFLmjvep/e6nYM25IY6jZyblu4GeNEElDOfxRxMaixag3dmq8eFld5D9MP0pMVWxdKldnUSba4vl+QjfB8cdUEcCjB/uWCPq3hVB07uz75xNk1XP+r4s3Ra2PkgO9pFztskaLvDFEZh4S0uEANFuinX27tShmB3h5zSyUY7Bws6ySL1dVpVOAD2/q5I52BdcWUxGmGzHqf/DDMGJvAzLKmtZqgVfLbPzH0ELw+x21i0DE+CcJewX+rHKaQrQ2Uf8Z/WgkseTv7T6TrmD6TEsGRF+laXfkXOZd5fgOc2OviAlHy49Al6sn0eKQ7Eh7IgnlXR+mjluVLZyag== x-ms-exchange-antispam-messagedata: P89BhOYUEa6q58scs9JIqkuJS+1JIVdKbbCm2csCgfYCzLLvoR7qTrEhY4mFRy2vKXocJ63IA7lENHGQOplumRljyfxn/MVuxCK76P/OZQWKn/O9HoS9TX91PucBOyXnwypJAJTA0DrI59Off/2vgQ== MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 35759f15-107c-46ca-91ab-08d7dda8e29d X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Apr 2020 23:42:52.1296 (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: bnmlWmbYHhEJqeHOdLl/FvCLZtVArtbKabrfgBM9YoiBQebFEZ7PJLcki+ml596Lz8ROWJPm6QnEn5yaioVV+Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR21MB0776 Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_CY4PR21MB074342C7451CCF8D04929994EFDE0CY4PR21MB0743namp_" --_000_CY4PR21MB074342C7451CCF8D04929994EFDE0CY4PR21MB0743namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Bret Barkelew - Bret From: Michael Kubacki via groups.io Sent: Friday, April 10, 2020 1:02 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 2/7] MdeModulePkg/EhciDxe: Use = 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%7Ce3d00585bdea48b8a1c308d7dd8a2296%7C72f988bf86f141= af91ab2d7cd011db47%7C1%7C0%7C637221457660162476&sdata=3D%2BbDiOEckmCFTU= HLWOAa1pohNf65HMeHx5YiJQ7C5hHc%3D&reserved=3D0 Replaces usage of the linked list iteration macros defined in Ehci.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: Guomin Jiang Reviewed-by: Hao A Wu --- MdeModulePkg/Bus/Pci/EhciDxe/EhciDebug.c | 3 ++- MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.c | 11 ++++++----- MdeModulePkg/Bus/Pci/EhciDxe/EhciUrb.c | 5 +++-- MdeModulePkg/Bus/Pci/EhciDxe/Ehci.h | 15 +-------------- 4 files changed, 12 insertions(+), 22 deletions(-) diff --git a/MdeModulePkg/Bus/Pci/EhciDxe/EhciDebug.c b/MdeModulePkg/Bus/P= ci/EhciDxe/EhciDebug.c index e10f6bb357ab..db0e2c6d39c6 100644 --- a/MdeModulePkg/Bus/Pci/EhciDxe/EhciDebug.c +++ b/MdeModulePkg/Bus/Pci/EhciDxe/EhciDebug.c @@ -3,6 +3,7 @@ This file provides the information dump support for EHCI when in debug = mode. Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.
+Copyright (c) Microsoft Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -185,7 +186,7 @@ EhcDumpQh ( DEBUG ((EFI_D_VERBOSE, "\n")); - EFI_LIST_FOR_EACH (Entry, &Qh->Qtds) { + BASE_LIST_FOR_EACH (Entry, &Qh->Qtds) { Qtd =3D EFI_LIST_CONTAINER (Entry, EHC_QTD, QtdList); EhcDumpQtd (Qtd, NULL); diff --git a/MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.c b/MdeModulePkg/Bus/P= ci/EhciDxe/EhciSched.c index 7db637aa2cb9..5fe7cf466939 100644 --- a/MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.c +++ b/MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.c @@ -3,6 +3,7 @@ EHCI transfer scheduling routines. Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
+Copyright (c) Microsoft Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -577,7 +578,7 @@ EhcCheckUrbResult ( goto ON_EXIT; } - EFI_LIST_FOR_EACH (Entry, &Urb->Qh->Qtds) { + BASE_LIST_FOR_EACH (Entry, &Urb->Qh->Qtds) { Qtd =3D EFI_LIST_CONTAINER (Entry, EHC_QTD, QtdList); QtdHw =3D &Qtd->QtdHw; State =3D (UINT8) QtdHw->Status; @@ -757,7 +758,7 @@ EhciDelAsyncIntTransfer ( Direction =3D (((EpNum & 0x80) !=3D 0) ? EfiUsbDataIn : EfiUsbDataOut); EpNum &=3D 0x0F; - EFI_LIST_FOR_EACH_SAFE (Entry, Next, &Ehc->AsyncIntTransfers) { + BASE_LIST_FOR_EACH_SAFE (Entry, Next, &Ehc->AsyncIntTransfers) { Urb =3D EFI_LIST_CONTAINER (Entry, URB, UrbList); if ((Urb->Ep.DevAddr =3D=3D DevAddr) && (Urb->Ep.EpAddr =3D=3D EpNum)= && @@ -797,7 +798,7 @@ EhciDelAllAsyncIntTransfers ( LIST_ENTRY *Next; URB *Urb; - EFI_LIST_FOR_EACH_SAFE (Entry, Next, &Ehc->AsyncIntTransfers) { + BASE_LIST_FOR_EACH_SAFE (Entry, Next, &Ehc->AsyncIntTransfers) { Urb =3D EFI_LIST_CONTAINER (Entry, URB, UrbList); EhcUnlinkQhFromPeriod (Ehc, Urb->Qh); @@ -965,7 +966,7 @@ EhcUpdateAsyncRequest ( if (Urb->Result =3D=3D EFI_USB_NOERROR) { FirstQtd =3D NULL; - EFI_LIST_FOR_EACH (Entry, &Urb->Qh->Qtds) { + BASE_LIST_FOR_EACH (Entry, &Urb->Qh->Qtds) { Qtd =3D EFI_LIST_CONTAINER (Entry, EHC_QTD, QtdList); if (FirstQtd =3D=3D NULL) { @@ -1049,7 +1050,7 @@ EhcMonitorAsyncRequests ( OldTpl =3D gBS->RaiseTPL (EHC_TPL); Ehc =3D (USB2_HC_DEV *) Context; - EFI_LIST_FOR_EACH_SAFE (Entry, Next, &Ehc->AsyncIntTransfers) { + BASE_LIST_FOR_EACH_SAFE (Entry, Next, &Ehc->AsyncIntTransfers) { Urb =3D EFI_LIST_CONTAINER (Entry, URB, UrbList); // diff --git a/MdeModulePkg/Bus/Pci/EhciDxe/EhciUrb.c b/MdeModulePkg/Bus/Pci= /EhciDxe/EhciUrb.c index ac5ddd259a83..37cef6d130f7 100644 --- a/MdeModulePkg/Bus/Pci/EhciDxe/EhciUrb.c +++ b/MdeModulePkg/Bus/Pci/EhciDxe/EhciUrb.c @@ -4,6 +4,7 @@ URB (Usb Request Block). Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.
+Copyright (c) Microsoft Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -299,7 +300,7 @@ EhcFreeQtds ( LIST_ENTRY *Next; EHC_QTD *Qtd; - EFI_LIST_FOR_EACH_SAFE (Entry, Next, Qtds) { + BASE_LIST_FOR_EACH_SAFE (Entry, Next, Qtds) { Qtd =3D EFI_LIST_CONTAINER (Entry, EHC_QTD, QtdList); RemoveEntryList (&Qtd->QtdList); @@ -482,7 +483,7 @@ EhcCreateQtds ( // // OK, all the QTDs needed are created. Now, fix the NextQtd point // - EFI_LIST_FOR_EACH (Entry, &Qh->Qtds) { + BASE_LIST_FOR_EACH (Entry, &Qh->Qtds) { Qtd =3D EFI_LIST_CONTAINER (Entry, EHC_QTD, QtdList); // diff --git a/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.h b/MdeModulePkg/Bus/Pci/Eh= ciDxe/Ehci.h index 31fb171497a8..65933d94396e 100644 --- a/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.h +++ b/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.h @@ -3,6 +3,7 @@ Provides some data struct used by EHCI controller driver. Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
+Copyright (c) Microsoft Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -80,20 +81,6 @@ typedef struct _USB2_HC_DEV USB2_HC_DEV; // #define EHC_TPL TPL_NOTIFY -// -//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. -//Don't 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) - #define EFI_LIST_CONTAINER(Entry, Type, Field) BASE_CR(Entry, Type, Field= ) -- 2.16.3.windows.1 --_000_CY4PR21MB074342C7451CCF8D04929994EFDE0CY4PR21MB0743namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Reviewed-by: Bret Barkelew <bret.barkelew@micrso= ft.com>

 

- Bret

 

From: Michael Kubacki via = groups.io
Sent: Friday, April 10, 2020 1:02 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 2/7] MdeModulePkg/EhciDx= e: Use BaseLib linked list iteration macros

 

From: Michael Kuback= i <michael.kubacki@microsoft.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%7Ce3d00585bdea48b8a1c308d7dd8a2296%7C72f988bf86= f141af91ab2d7cd011db47%7C1%7C0%7C637221457660162476&amp;sdata=3D%2BbDiO= EckmCFTUHLWOAa1pohNf65HMeHx5YiJQ7C5hHc%3D&amp;reserved=3D0

Replaces usage of the linked list iteration macros defined in Ehci.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: Guomin Jiang <guomin.jiang@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
---
 MdeModulePkg/Bus/Pci/EhciDxe/EhciDebug.c |  3 ++-
 MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.c | 11 ++++&#= 43;+-----
 MdeModulePkg/Bus/Pci/EhciDxe/EhciUrb.c   |  5 +&#= 43;+--
 MdeModulePkg/Bus/Pci/EhciDxe/Ehci.h      | = 15 +--------------
 4 files changed, 12 insertions(+), 22 deletions(-)

diff --git a/MdeModulePkg/Bus/Pci/EhciDxe/EhciDebug.c b/MdeModulePkg/Bus/P= ci/EhciDxe/EhciDebug.c
index e10f6bb357ab..db0e2c6d39c6 100644
--- a/MdeModulePkg/Bus/Pci/EhciDxe/EhciDebug.c
+++ b/MdeModulePkg/Bus/Pci/EhciDxe/EhciDebug.c
@@ -3,6 +3,7 @@
   This file provides the information dump support for EHCI when= in debug mode.
 
 Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.&l= t;BR>
+Copyright (c) Microsoft Corporation.<BR>
 SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -185,7 +186,7 @@ EhcDumpQh (
 
   DEBUG ((EFI_D_VERBOSE, "\n"));
 
-  EFI_LIST_FOR_EACH (Entry, &Qh->Qtds) {
+  BASE_LIST_FOR_EACH (Entry, &Qh->Qtds) {
     Qtd =3D EFI_LIST_CONTAINER (Entry, EHC_QTD, QtdLi= st);
     EhcDumpQtd (Qtd, NULL);
 
diff --git a/MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.c b/MdeModulePkg/Bus/P= ci/EhciDxe/EhciSched.c
index 7db637aa2cb9..5fe7cf466939 100644
--- a/MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.c
+++ b/MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.c
@@ -3,6 +3,7 @@
   EHCI transfer scheduling routines.
 
 Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.&l= t;BR>
+Copyright (c) Microsoft Corporation.<BR>
 SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -577,7 +578,7 @@ EhcCheckUrbResult (
     goto ON_EXIT;
   }
 
-  EFI_LIST_FOR_EACH (Entry, &Urb->Qh->Qtds) {
+  BASE_LIST_FOR_EACH (Entry, &Urb->Qh->Qtds) {
     Qtd   =3D EFI_LIST_CONTAINER (Entry, EH= C_QTD, QtdList);
     QtdHw =3D &Qtd->QtdHw;
     State =3D (UINT8) QtdHw->Status;
@@ -757,7 +758,7 @@ EhciDelAsyncIntTransfer (
   Direction =3D (((EpNum & 0x80) !=3D 0) ? EfiUsbDataIn : E= fiUsbDataOut);
   EpNum    &=3D 0x0F;
 
-  EFI_LIST_FOR_EACH_SAFE (Entry, Next, &Ehc->AsyncIntTransfer= s) {
+  BASE_LIST_FOR_EACH_SAFE (Entry, Next, &Ehc->AsyncIntTra= nsfers) {
     Urb =3D EFI_LIST_CONTAINER (Entry, URB, UrbList);=
 
     if ((Urb->Ep.DevAddr =3D=3D DevAddr) &&= ; (Urb->Ep.EpAddr =3D=3D EpNum) &&
@@ -797,7 +798,7 @@ EhciDelAllAsyncIntTransfers (
   LIST_ENTRY        &nb= sp;     *Next;
   URB         &nbs= p;           *Urb;
 
-  EFI_LIST_FOR_EACH_SAFE (Entry, Next, &Ehc->AsyncIntTransfer= s) {
+  BASE_LIST_FOR_EACH_SAFE (Entry, Next, &Ehc->AsyncIntTra= nsfers) {
     Urb =3D EFI_LIST_CONTAINER (Entry, URB, UrbList);=
 
     EhcUnlinkQhFromPeriod (Ehc, Urb->Qh);
@@ -965,7 +966,7 @@ EhcUpdateAsyncRequest (
   if (Urb->Result =3D=3D EFI_USB_NOERROR) {
     FirstQtd =3D NULL;
 
-    EFI_LIST_FOR_EACH (Entry, &Urb->Qh->Qtds) {<= br> +    BASE_LIST_FOR_EACH (Entry, &Urb->Qh->Qtd= s) {
       Qtd =3D EFI_LIST_CONTAINER (Entry, EH= C_QTD, QtdList);
 
       if (FirstQtd =3D=3D NULL) {
@@ -1049,7 +1050,7 @@ EhcMonitorAsyncRequests (
   OldTpl  =3D gBS->RaiseTPL (EHC_TPL);
   Ehc     =3D (USB2_HC_DEV *) Context;
 
-  EFI_LIST_FOR_EACH_SAFE (Entry, Next, &Ehc->AsyncIntTransfer= s) {
+  BASE_LIST_FOR_EACH_SAFE (Entry, Next, &Ehc->AsyncIntTra= nsfers) {
     Urb =3D EFI_LIST_CONTAINER (Entry, URB, UrbList);=
 
     //
diff --git a/MdeModulePkg/Bus/Pci/EhciDxe/EhciUrb.c b/MdeModulePkg/Bus/Pci= /EhciDxe/EhciUrb.c
index ac5ddd259a83..37cef6d130f7 100644
--- a/MdeModulePkg/Bus/Pci/EhciDxe/EhciUrb.c
+++ b/MdeModulePkg/Bus/Pci/EhciDxe/EhciUrb.c
@@ -4,6 +4,7 @@
     URB (Usb Request Block).
 
 Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.&l= t;BR>
+Copyright (c) Microsoft Corporation.<BR>
 SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -299,7 +300,7 @@ EhcFreeQtds (
   LIST_ENTRY        &nb= sp;     *Next;
   EHC_QTD         =         *Qtd;
 
-  EFI_LIST_FOR_EACH_SAFE (Entry, Next, Qtds) {
+  BASE_LIST_FOR_EACH_SAFE (Entry, Next, Qtds) {
     Qtd =3D EFI_LIST_CONTAINER (Entry, EHC_QTD, QtdLi= st);
 
     RemoveEntryList (&Qtd->QtdList);
@@ -482,7 +483,7 @@ EhcCreateQtds (
   //
   // OK, all the QTDs needed are created. Now, fix the NextQtd = point
   //
-  EFI_LIST_FOR_EACH (Entry, &Qh->Qtds) {
+  BASE_LIST_FOR_EACH (Entry, &Qh->Qtds) {
     Qtd =3D EFI_LIST_CONTAINER (Entry, EHC_QTD, QtdLi= st);
 
     //
diff --git a/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.h b/MdeModulePkg/Bus/Pci/Eh= ciDxe/Ehci.h
index 31fb171497a8..65933d94396e 100644
--- a/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.h
+++ b/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.h
@@ -3,6 +3,7 @@
   Provides some data struct used by EHCI controller driver.
 
 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.&l= t;BR>
+Copyright (c) Microsoft Corporation.<BR>
 SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -80,20 +81,6 @@ typedef struct _USB2_HC_DEV  USB2_HC_DEV;
 //
 #define  EHC_TPL        = ;             T= PL_NOTIFY
 
-//
-//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.
-//Don't 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)
-
 #define EFI_LIST_CONTAINER(Entry, Type, Field) BASE_CR(Entry, Type, = Field)
 
 
--
2.16.3.windows.1


 

--_000_CY4PR21MB074342C7451CCF8D04929994EFDE0CY4PR21MB0743namp_--