From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (NAM11-DM6-obe.outbound.protection.outlook.com [40.92.19.11]) by mx.groups.io with SMTP id smtpd.web11.17925.1586462785828599203 for ; Thu, 09 Apr 2020 13:06:26 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@outlook.com header.s=selector1 header.b=OiW6tGIf; spf=pass (domain: outlook.com, ip: 40.92.19.11, mailfrom: michael.kubacki@outlook.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aWOXVNMTsyS+rfaar+1+0oIOCynS/QvQVq/RPuk7kWxDbhwMvjrIQKkYwkW7VKllNXIixXV5bid5ICyhI5SLNVZ3yoQt51Yw8J4Mz1ZEP1ubl+l0rTaxXCXafu+65d3k/0EzBZ1n1ZaKnYsBcSTj+b9PcrFOvyQkyMz8C4cp/4yD2NJ8zmvsjbIEDxbcgBPDziCHnJeNQopTje6SUqyqIv4v30RiwB3KTEvggSSCQj5ByXqRH0hGdB0oaIrQF5GOtbkqk88UtAXnZS6XhFY+HE7Keg76mVsYoFd2GpM8HBdt1muvusgsj8YOOgF/6UuyWd0cb7n0nyVxHZt0mgODPA== 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=ufkupsphM6sJ99Zs/nHSlAbYmg/cQLhrA86kEOKD9yI=; b=W8EBqwQCuDjiIYM4NLcg43Vi5guUcH8d4N0gClJRaTXxd5sv4Rh82jN9lIncq7/VFRwjN8g6ErvWklBKo7U+2HBr2EjV2eAnluyVnC+jQGt30tVNcBZSU3VswWkKizH/dGEyxHICSDzZEzc2gaIqd9V9eRkOEZ4tUdTgxybRQlgib5JqWfCFWPSIRO/0n1Xib6C/HVGIOlNJfuDbxMj6DaDE5FfhxCua7+FgaLKDVjsG68LeG7ZdB/jN4mVSRm7vcu4pHhrsulZaqTiCUveTB+mXXsAQEorNoiqqprDiseXZb60iiAZs4j5uvRXR2VMG4ASawHACC6usfxcHzoym1Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=outlook.com; dmarc=pass action=none header.from=outlook.com; dkim=pass header.d=outlook.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ufkupsphM6sJ99Zs/nHSlAbYmg/cQLhrA86kEOKD9yI=; b=OiW6tGIfubnj6HvKxF8WIqNx1srf18dh8vZ6yQjcM1TxJKBuzn8i7JPfQsnps7iijyffd11WzexEL3wD46G80kOhRMUG2ueWZMoXbA3lkwElWq0FjhARpGxsQcQniJUFtErwOSk3eOSGYZpgsdpzFQJEYcZ5bKMImXh7qJgUo+N3vcXjCAgWD/LZBBMcjw++L+5tMCAPMnLMQte9HA0nw7SMNKSn+sXkT8/hWUkwbQCyEKuqW2peyADjgXPdtemoNWcjLTQrfwDuZmAcDgt319qMrVijaLN/I2ksL3xI27jUDgHdDNRctnf9MEFgDAzn+PYx9BjzBWONblyHJKJJxg== Received: from BN8NAM11FT019.eop-nam11.prod.protection.outlook.com (2a01:111:e400:fc4b::4d) by BN8NAM11HT113.eop-nam11.prod.protection.outlook.com (2a01:111:e400:fc4b::284) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2900.18; Thu, 9 Apr 2020 20:06:24 +0000 Received: from DM5PR07MB3435.namprd07.prod.outlook.com (2a01:111:e400:fc4b::44) by BN8NAM11FT019.mail.protection.outlook.com (2a01:111:e400:fc4b::158) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2900.18 via Frontend Transport; Thu, 9 Apr 2020 20:06:24 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:E256374FC8DCAA9DE4D978F14EF363DA525C07D75311B127433C89E4B6FABB47;UpperCasedChecksum:9BB4BC574C486AE3BC4A22EE646B0F108D3835CE559E31E5C46732EED8282303;SizeAsReceived:7892;Count:49 Received: from DM5PR07MB3435.namprd07.prod.outlook.com ([fe80::801e:fde0:da7d:191f]) by DM5PR07MB3435.namprd07.prod.outlook.com ([fe80::801e:fde0:da7d:191f%6]) with mapi id 15.20.2900.015; Thu, 9 Apr 2020 20:06:24 +0000 From: "Michael Kubacki" To: devel@edk2.groups.io Cc: Dandan Bi , Hao A Wu , Jian J Wang , Liming Gao , Ray Ni , Sean Brogan Subject: [PATCH v1 3/7] MdeModulePkg/EhciPei: Use BaseLib linked list iteration macros Date: Thu, 9 Apr 2020 13:05:10 -0700 Message-ID: X-Mailer: git-send-email 2.16.3.windows.1 In-Reply-To: <20200409200514.32796-1-michael.kubacki@outlook.com> References: <20200409200514.32796-1-michael.kubacki@outlook.com> X-ClientProxiedBy: MWHPR10CA0062.namprd10.prod.outlook.com (2603:10b6:300:2c::24) To DM5PR07MB3435.namprd07.prod.outlook.com (2603:10b6:4:67::14) Return-Path: michael.kubacki@outlook.com X-Microsoft-Original-Message-ID: <20200409200514.32796-4-michael.kubacki@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (2001:4898:80e8:7:9d66:7f00:4b99:db3e) by MWHPR10CA0062.namprd10.prod.outlook.com (2603:10b6:300:2c::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2900.15 via Frontend Transport; Thu, 9 Apr 2020 20:06:23 +0000 X-Mailer: git-send-email 2.16.3.windows.1 X-Microsoft-Original-Message-ID: <20200409200514.32796-4-michael.kubacki@outlook.com> X-TMN: [n4pmE2t4r4NvYn36Yp8ADZsB4gtj3w+KYMdwlao5DWn2ObPTtJPoYGsRJkx1NAK8] X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 49 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: fe14afad-1819-4005-493f-08d7dcc17ab7 X-MS-TrafficTypeDiagnostic: BN8NAM11HT113: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: j4o3NJNKitbSgjl3u4XXKeTZM+rbbxpRSVjb0np4WiM/Hs55//k04/MqcXn9IPqrjqwCPkdOXoOe/YgP/zKon6VlH5eyHQ+RCeP4jRcUgr2gPj784dM9eUiMHQTja0fSuxUKMhpcw5/smRMWs8kycajG/0U4QXvnwLUZcLoDI0O5mZ66eIOIW+1joxydKn3nrX8LlG5m+QXnpHso9pFwv/ae7C+mf/o9FRKg7inxJvg= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:0;SRV:;IPV:NLI;SFV:NSPM;H:DM5PR07MB3435.namprd07.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:;DIR:OUT;SFP:1901; X-MS-Exchange-AntiSpam-MessageData: sTCT/2ITZTy2U17zk+b40X5GhaJSRRx7kxZ56CWh/CDjDvizQFiLgf0+PfwnFO/BOZT5ASbncjrodp1nK3C69ttrZ4rl62GUda0pRoE4jHYQUCm90+fEYzCIefPma544yMOiUZNhIF/9Xrf6/d5jh5r9j/IcHVDE+H7Fy284xGBSlHUW3flzC+eAHs8gykTL/6bep735oVuESnORC8XOsA== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: fe14afad-1819-4005-493f-08d7dcc17ab7 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Apr 2020 20:06:24.4224 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8NAM11HT113 Content-Type: text/plain From: Michael Kubacki REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1959 Replaces usage of the linked list iteration macros defined in EhcPeim.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 --- MdeModulePkg/Bus/Pci/EhciPei/EhciSched.c | 3 ++- MdeModulePkg/Bus/Pci/EhciPei/EhciUrb.c | 5 +++-- MdeModulePkg/Bus/Pci/EhciPei/EhcPeim.h | 15 +-------------- 3 files changed, 6 insertions(+), 17 deletions(-) diff --git a/MdeModulePkg/Bus/Pci/EhciPei/EhciSched.c b/MdeModulePkg/Bus/Pci/EhciPei/EhciSched.c index 8eb432dfc31d..311f50198062 100644 --- a/MdeModulePkg/Bus/Pci/EhciPei/EhciSched.c +++ b/MdeModulePkg/Bus/Pci/EhciPei/EhciSched.c @@ -3,6 +3,7 @@ PEIM to produce gPeiUsb2HostControllerPpiGuid based on gPeiUsbControllerPpiGuid which is used to enable recovery function from USB Drivers. Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
+Copyright (c) Microsoft Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent @@ -323,7 +324,7 @@ EhcCheckUrbResult ( goto ON_EXIT; } - EFI_LIST_FOR_EACH (Entry, &Urb->Qh->Qtds) { + BASE_LIST_FOR_EACH (Entry, &Urb->Qh->Qtds) { Qtd = EFI_LIST_CONTAINER (Entry, PEI_EHC_QTD, QtdList); QtdHw = &Qtd->QtdHw; State = (UINT8) QtdHw->Status; diff --git a/MdeModulePkg/Bus/Pci/EhciPei/EhciUrb.c b/MdeModulePkg/Bus/Pci/EhciPei/EhciUrb.c index 995ccd2463d2..df512ed6fa59 100644 --- a/MdeModulePkg/Bus/Pci/EhciPei/EhciUrb.c +++ b/MdeModulePkg/Bus/Pci/EhciPei/EhciUrb.c @@ -3,6 +3,7 @@ PEIM to produce gPeiUsb2HostControllerPpiGuid based on gPeiUsbControllerPpiGuid which is used to enable recovery function from USB Drivers. Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
+Copyright (c) Microsoft Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent @@ -290,7 +291,7 @@ EhcFreeQtds ( EFI_LIST_ENTRY *Next; PEI_EHC_QTD *Qtd; - EFI_LIST_FOR_EACH_SAFE (Entry, Next, Qtds) { + BASE_LIST_FOR_EACH_SAFE (Entry, Next, Qtds) { Qtd = EFI_LIST_CONTAINER (Entry, PEI_EHC_QTD, QtdList); RemoveEntryList (&Qtd->QtdList); @@ -461,7 +462,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 = EFI_LIST_CONTAINER (Entry, PEI_EHC_QTD, QtdList); // diff --git a/MdeModulePkg/Bus/Pci/EhciPei/EhcPeim.h b/MdeModulePkg/Bus/Pci/EhciPei/EhcPeim.h index 6b69f7a656ce..962cbc458986 100644 --- a/MdeModulePkg/Bus/Pci/EhciPei/EhcPeim.h +++ b/MdeModulePkg/Bus/Pci/EhciPei/EhcPeim.h @@ -2,6 +2,7 @@ Private Header file for Usb Host Controller PEIM Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
+Copyright (c) Microsoft Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent @@ -60,20 +61,6 @@ typedef struct _PEI_USB2_HC_DEV PEI_USB2_HC_DEV; // #define EHC_SYNC_POLL_INTERVAL (6 * EHC_1_MILLISECOND) -// -//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) - -// -//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 = (ListHead)->ForwardLink, NextEntry = Entry->ForwardLink;\ - Entry != (ListHead); Entry = NextEntry, NextEntry = Entry->ForwardLink) - #define EFI_LIST_CONTAINER(Entry, Type, Field) BASE_CR(Entry, Type, Field) -- 2.16.3.windows.1