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.34]) by mx.groups.io with SMTP id smtpd.web10.18110.1586462780856044915 for ; Thu, 09 Apr 2020 13:06:21 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@outlook.com header.s=selector1 header.b=XO0arIX4; spf=pass (domain: outlook.com, ip: 40.92.19.34, mailfrom: michael.kubacki@outlook.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OpvHaGkTD3M3eIfAw77xkJieAiS/UxG8v2yiLVACw4BoB55JZPBgbZglv0qgjncEbBcxOex6JJOIczVvAFmX10ejfEmIlU2qSoGA0u6e6stB4cQACVS4ovBm0RNlm1937dkCKoYcNPP4yJ0T649lf5yPURhV7owpYhO5ds025wsmozaTdcPqKnCI+rlMwCHYp8EneFEsD1+Z6mnKp7MIuJdAORl4Yax72U0sj1OyYRNKe1NQ/J7ZVinaxwB/or5hjR58ylrHmZGeplpxMZ87BS71eseVc0qIKOuFlbRIpBnPFp1/FXAFwmF8StY4Cr7HxaT5humcSxpXioDnHWyGbA== 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=cBbXLpVbxrEYOkr4GpbO6F5Yaxkib3VBIDgC9qIZFFE=; b=HZpR9MQ7ShpC0lwQa3dCtBUZD9dDvNTjwkWob2J4TiZg9Kjy7F7Wvl+RPfs46KYYUqpv4BnDGZy9l2Tjb9+gv6ihwxlZtzr22ce/fEPyk7nzVOXJ6ujusUelCOu3AIn4IiU48kJqF9cmZqmido1mWnegB8RcdDptJaXJZk3ZPCEv4Xm3KBFHzAeyuwORGQP86GkzmiJJd3gaFtoKQ/yfVrui3t/hxT+YZMgXyGScIH/FFFFtzo4gzM2fTx42D0mfSoFJmHJRFxghskhNA0PQt11O9Z0cEXW+x66X8uTgqvIE1NG8Jpk7H67euy94f6Bd/jzsn9AUiVAIC6jFjx4M/A== 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=cBbXLpVbxrEYOkr4GpbO6F5Yaxkib3VBIDgC9qIZFFE=; b=XO0arIX4nu4xDmOZAgns1uYfCJlfhTBKULZ/CTtQZIqKu/ElIUtXlN6z2IAuq0PY/wJ6jzDYbLNeMFq0irKPOszH1JEErdJZGSqhrb0wOHkebCz6RhYQThzcVmE+8F9DEzvxcDr4JSOgtk/zLEE3KZiCVwf8jdf6/PwrO2NwSCf6WOgApgkmIbvFQY6Rp9M1UHqOFrI9DopjEpf5SEqCN9LgjN+83UAB6xflh9SbnvyZ8IGD2a2jraFzFrAMkupxCos507+cdBhj7cBXtvzR18lvmVPE/oUO/Or8oB2jkk/o5BS8r5/F4YeWkrQapuxpZePu2nBBodL67IB4rCnLSw== Received: from BN8NAM11FT019.eop-nam11.prod.protection.outlook.com (2a01:111:e400:fc4b::48) by BN8NAM11HT123.eop-nam11.prod.protection.outlook.com (2a01:111:e400:fc4b::286) 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:19 +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:19 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:FC9F7D27ADFB2D032F137DD4D759F16E111B43A5E591C836B7F3346F5E5C6617;UpperCasedChecksum:A0225F468BEACA3443573893ECF03DC01710183F1A20C159BC49A3B9CA556ACC;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:19 +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 2/7] MdeModulePkg/EhciDxe: Use BaseLib linked list iteration macros Date: Thu, 9 Apr 2020 13:05:09 -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-3-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:18 +0000 X-Mailer: git-send-email 2.16.3.windows.1 X-Microsoft-Original-Message-ID: <20200409200514.32796-3-michael.kubacki@outlook.com> X-TMN: [tjc3k/tgZ1lbUglus5W+kvrmuaAMmuFADlMxypSS7wskwd9UClYEqPVaoHgQxNjl] X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 49 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: cd355156-defe-4d5e-7834-08d7dcc177e0 X-MS-TrafficTypeDiagnostic: BN8NAM11HT123: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: dRmmMA5JdtW+NDctnjOdzq3/LAlcnTqZ56nx2dq/SPS7t3jc5yBHr17tCt7re5aXdO0fRb1D2VIcn4xBHmHq1AIA9j+oUJT2vxRG0oa8ZGuKElffyAmDEOyzzEmYqOg2s0jnpqIFU7LrOaKTxlVwCVld6SBTTxYFa2VD/Vx0aSfZIhCYs/Gy6BElibdw3Qx+F6hrMHK78hVzOsF6zG5LbhUnpX4Nm8hq4JIWdasqW2k= 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: sc7WAqMz3QwcFnenKsk5sxwr3f3TSNxWceFxf/Tq50RUTvwegqzKQq3orXuXrHzX6zFaVD8obq68o4BpVl2DLnyaVAySianM7vYBkMUOIMW1Fksh4M2EvF2t4rG7CgeQTZZe6lNi+xRhVeUjzNuRXvs9wsIvo2RMLDnXFrTHVYKmxioFySixpJgh76XGnkKOljkWWxK10UBEVeYJ8T4YXg== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: cd355156-defe-4d5e-7834-08d7dcc177e0 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Apr 2020 20:06:19.6151 (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: BN8NAM11HT123 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 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 --- 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/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 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 = EFI_LIST_CONTAINER (Entry, EHC_QTD, QtdList); EhcDumpQtd (Qtd, NULL); 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. 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 = EFI_LIST_CONTAINER (Entry, EHC_QTD, QtdList); QtdHw = &Qtd->QtdHw; State = (UINT8) QtdHw->Status; @@ -757,7 +758,7 @@ EhciDelAsyncIntTransfer ( Direction = (((EpNum & 0x80) != 0) ? EfiUsbDataIn : EfiUsbDataOut); EpNum &= 0x0F; - EFI_LIST_FOR_EACH_SAFE (Entry, Next, &Ehc->AsyncIntTransfers) { + BASE_LIST_FOR_EACH_SAFE (Entry, Next, &Ehc->AsyncIntTransfers) { Urb = EFI_LIST_CONTAINER (Entry, URB, UrbList); if ((Urb->Ep.DevAddr == DevAddr) && (Urb->Ep.EpAddr == 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 = EFI_LIST_CONTAINER (Entry, URB, UrbList); EhcUnlinkQhFromPeriod (Ehc, Urb->Qh); @@ -965,7 +966,7 @@ EhcUpdateAsyncRequest ( if (Urb->Result == EFI_USB_NOERROR) { FirstQtd = NULL; - EFI_LIST_FOR_EACH (Entry, &Urb->Qh->Qtds) { + BASE_LIST_FOR_EACH (Entry, &Urb->Qh->Qtds) { Qtd = EFI_LIST_CONTAINER (Entry, EHC_QTD, QtdList); if (FirstQtd == NULL) { @@ -1049,7 +1050,7 @@ EhcMonitorAsyncRequests ( OldTpl = gBS->RaiseTPL (EHC_TPL); Ehc = (USB2_HC_DEV *) Context; - EFI_LIST_FOR_EACH_SAFE (Entry, Next, &Ehc->AsyncIntTransfers) { + BASE_LIST_FOR_EACH_SAFE (Entry, Next, &Ehc->AsyncIntTransfers) { Urb = 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 = 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 = EFI_LIST_CONTAINER (Entry, EHC_QTD, QtdList); // 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. 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 = (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