From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mx.groups.io with SMTP id smtpd.web11.1639.1586483209948287022 for ; Thu, 09 Apr 2020 18:46:50 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=PmK0g4of; spf=pass (domain: intel.com, ip: 134.134.136.126, mailfrom: guomin.jiang@intel.com) IronPort-SDR: ODyeuaorNvv75F8roQIQ3T5HtqOIAA5DF+Id1eXdwt9cO5MGzsdBkAJXriXV+8xDQWqyiB9xLx y0v04eYNudJQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Apr 2020 18:46:49 -0700 IronPort-SDR: gKXxZ6CRoXUmUJFn4K2J1ji3+tjwGzIhNkUPMnQB0lUDscrjDpVq5q+wwmNzJ/yCoJ0p4fFjVT CRuAkaGvoBtQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,364,1580803200"; d="scan'208";a="240813050" Received: from orsmsx106.amr.corp.intel.com ([10.22.225.133]) by orsmga007.jf.intel.com with ESMTP; 09 Apr 2020 18:46:45 -0700 Received: from orsmsx162.amr.corp.intel.com (10.22.240.85) by ORSMSX106.amr.corp.intel.com (10.22.225.133) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 9 Apr 2020 18:46:44 -0700 Received: from ORSEDG002.ED.cps.intel.com (10.7.248.5) by ORSMSX162.amr.corp.intel.com (10.22.240.85) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 9 Apr 2020 18:46:44 -0700 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.103) by edgegateway.intel.com (134.134.137.101) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 9 Apr 2020 18:46:44 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TrvH8pt5GmqFHfOus2VkaaDXAYKhN5Fa/y0KTZRAqkUPicwkL2kIP0CL7G38gcS/CVQltA4eZTqpoIZmk+jH23bhmGp/ZsyGBM3YuStic61Ug5BsYdoxD/yASzg0UalxEjUflsTp3rb1/Cn832LBpKeZNJqgN6XWd6QVUEC+w6rBCX9OGMdyJGrPYMVu2I9wiDiSxQRYHmsrBZD4qkt1aWJqe1WzL37nLAEfeDAj9hvkkuMlwPM81WU+yKWCIKnrDCIJfbxO0iPct1HWz5htwzlsf3MIWOO3ywb4zex5N1w5vXqNiPSOgJ73GkQbr3PCqoOvWOKJcEsjrRe7/avyJg== 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=TCZXNtFHeCG4X6h1QjD4Iiw/gV6xPKbHIYIYOroj+Ks=; b=YvWORKQMQs0qLwmafvVA2Kl7yAcc5gcPUBlbtGZL4UBJtHyM6wSgJtTF8DhS5161i7DrR2/bGHok2fSIZqqnb+sbYHg6v/wgcFw4TH9UpYM+tt/IYBYatNLjIJ+G1QEKJqYXHwDCNT236QDi2QJH/7evWP7BPUbHj7e8xzYkUqXtwUPyF4Qrx4Lno7WQTwy17eRDUUdGEDZdwUGO7moBFTi4hJfiAunOr2xRPUHDCj93CYOtYOZFlBMBMgq/BKouPlwOpNr+a+22hya8zU1Ex9LkdAk5dQ3JzHLqEuUCo747Drfy30cdp5kmKmIBisy6wvvighms6DJxiccLVJ/t7A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TCZXNtFHeCG4X6h1QjD4Iiw/gV6xPKbHIYIYOroj+Ks=; b=PmK0g4ofwyCb++nt0E9t5yUDLC87UN99Yy3CVgKLG0AOTIV8u+b+l+w5tpoT2gd61Esh0Bhvk0T7E0Ss1Yw7YVQoKCXQnKVmE0LkLhXl3P7KARS5I3pH0i6rpzpcFw4PYGkfz0nyJaWK6Vk9/HfnK6DIn31caHqqqOnF1btfHaY= Received: from DM6PR11MB2955.namprd11.prod.outlook.com (2603:10b6:5:65::31) by DM6PR11MB3770.namprd11.prod.outlook.com (2603:10b6:5:13c::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.20; Fri, 10 Apr 2020 01:46:43 +0000 Received: from DM6PR11MB2955.namprd11.prod.outlook.com ([fe80::f1ec:734d:b127:4519]) by DM6PR11MB2955.namprd11.prod.outlook.com ([fe80::f1ec:734d:b127:4519%3]) with mapi id 15.20.2878.022; Fri, 10 Apr 2020 01:46:43 +0000 From: "Guomin Jiang" To: "devel@edk2.groups.io" , "michael.kubacki@outlook.com" CC: "Bi, Dandan" , "Wu, Hao A" , "Wang, Jian J" , "Gao, Liming" , "Ni, Ray" , Sean Brogan Subject: Re: [edk2-devel] [PATCH v1 2/7] MdeModulePkg/EhciDxe: Use BaseLib linked list iteration macros Thread-Topic: [edk2-devel] [PATCH v1 2/7] MdeModulePkg/EhciDxe: Use BaseLib linked list iteration macros Thread-Index: AQHWDqprZZ+c2G93XkKWg1jvdduxvqhxljew Date: Fri, 10 Apr 2020 01:46:43 +0000 Message-ID: References: <20200409200514.32796-1-michael.kubacki@outlook.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.2.0.6 dlp-product: dlpe-windows dlp-reaction: no-action authentication-results: spf=none (sender IP is ) smtp.mailfrom=guomin.jiang@intel.com; x-originating-ip: [192.55.52.200] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 165d8aa8-10bf-4bbf-6c71-08d7dcf10588 x-ms-traffictypediagnostic: DM6PR11MB3770: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1169; x-forefront-prvs: 0369E8196C x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR11MB2955.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(10019020)(376002)(366004)(136003)(346002)(396003)(39860400002)(4326008)(81156014)(55016002)(8676002)(33656002)(966005)(45080400002)(110136005)(478600001)(2906002)(86362001)(186003)(9686003)(316002)(54906003)(64756008)(8936002)(7696005)(71200400001)(5660300002)(66556008)(76116006)(52536014)(81166007)(66476007)(66946007)(6506007)(66446008)(53546011)(26005);DIR:OUT;SFP:1102; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: rGFkvQNACF+26ovSDjXgk/aSG9O+uaPI6Vr01hfv9nIqPhdAtjUkM9YzQ3P2XqUzywwKfNUT3YCGz9veSGaNatWJoM/FEFiheEwpxpRwKs3CA7W8WY/SAFNYcIcybVX2PpeL+5G6Mqc9YuExO0dGiPf5lRoHlFdoTRTiz8aVoa5HaVREe9vkP2QZ6fbnmxCTHR+zkBngnrn81mjFUQC/KznzSD86XKfhNMjRS1h00J9C/5COnKIMkPmKAenJY2F9/M/rnGF9vv1a1H3ujLgLA7No2FG9hKpoqx4I8Gn+h0g/1s2SHRPpDDDj9M0O3Sfu8J0LLrQtFHgpmUPbbOJyaZoqwPJxbaCXLoQJysFrbcgNc0CQXx8Si4xNXS6K3MAPWUq8kONaCG+++93M46pfH/O+6DsRt7IVDcw+Ihalz7rsMXy1HALFXcHMkPnmtY4LCFb1grdIFyx9BvjXoUGAB46fkNbWqyPFIdSXIBieQd63vkvtkqgKqHkbRwOW2S2sHWzYy59hVoQ7Sl2SKaUD8A== x-ms-exchange-antispam-messagedata: tDSJBgugkJLpglIYsKydc954WmjJ4wSGqRDFevDNNkkBoigq/A6nX5z4/1Rm9AWJpimGuFRnyMm2up3GYG3cPZf+DME3eekWqVgSEh/8Z8dynkvvr3nYhuekY0vBADlsNSK8O/nnyVuMRqwhQHXPXw== MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 165d8aa8-10bf-4bbf-6c71-08d7dcf10588 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Apr 2020 01:46:43.2361 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: TnsbTewOLxUYcGR6JwmGlCQ3cfN/EsDwB9LzwhXZg5hRh7c63tw+u9BOiIWZCLAf6FL2crobypOVWaCVX6eVrQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB3770 Return-Path: guomin.jiang@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Guomin Jiang > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Michael > Kubacki > Sent: Friday, April 10, 2020 4:05 AM > To: devel@edk2.groups.io > Cc: Bi, Dandan ; Wu, Hao A ; > Wang, Jian J ; Gao, Liming = ; > Ni, Ray ; Sean Brogan > Subject: [edk2-devel] [PATCH v1 2/7] MdeModulePkg/EhciDxe: 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 Ehci.h wit= h the > common definition in BaseLib.h. >=20 > 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 > --- > 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(-) >=20 > diff --git a/MdeModulePkg/Bus/Pci/EhciDxe/EhciDebug.c > b/MdeModulePkg/Bus/Pci/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 debu= g > mode. >=20 > Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.
> +Copyright (c) Microsoft Corporation.
> SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > **/ > @@ -185,7 +186,7 @@ EhcDumpQh ( >=20 > DEBUG ((EFI_D_VERBOSE, "\n")); >=20 > - 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); >=20 > diff --git a/MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.c > b/MdeModulePkg/Bus/Pci/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. >=20 > Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
> +Copyright (c) Microsoft Corporation.
> SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > **/ > @@ -577,7 +578,7 @@ EhcCheckUrbResult ( > goto ON_EXIT; > } >=20 > - 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; >=20 > - 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); >=20 > if ((Urb->Ep.DevAddr =3D=3D DevAddr) && (Urb->Ep.EpAddr =3D=3D EpNu= m) && > @@ -797,7 +798,7 @@ EhciDelAllAsyncIntTransfers ( > LIST_ENTRY *Next; > URB *Urb; >=20 > - 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); >=20 > EhcUnlinkQhFromPeriod (Ehc, Urb->Qh); @@ -965,7 +966,7 @@ > EhcUpdateAsyncRequest ( > if (Urb->Result =3D=3D EFI_USB_NOERROR) { > FirstQtd =3D NULL; >=20 > - 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); >=20 > if (FirstQtd =3D=3D NULL) { > @@ -1049,7 +1050,7 @@ EhcMonitorAsyncRequests ( > OldTpl =3D gBS->RaiseTPL (EHC_TPL); > Ehc =3D (USB2_HC_DEV *) Context; >=20 > - 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); >=20 > // > 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). >=20 > Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.
> +Copyright (c) Microsoft Corporation.
> SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > **/ > @@ -299,7 +300,7 @@ EhcFreeQtds ( > LIST_ENTRY *Next; > EHC_QTD *Qtd; >=20 > - 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); >=20 > 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); >=20 > // > diff --git a/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.h > b/MdeModulePkg/Bus/Pci/EhciDxe/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. >=20 > Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
> +Copyright (c) Microsoft Corporation.
> SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > **/ > @@ -80,20 +81,6 @@ typedef struct _USB2_HC_DEV USB2_HC_DEV; // > #define EHC_TPL TPL_NOTIFY >=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) > - > -// > -//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->ForwardLi= nk;\ > - Entry !=3D (ListHead); Entry =3D NextEntry, NextEntry =3D Entry->= ForwardLink) > - > #define EFI_LIST_CONTAINER(Entry, Type, Field) BASE_CR(Entry, Type, Fie= ld) >=20 >=20 > -- > 2.16.3.windows.1 >=20 >=20 >=20