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.92.23.38]) by mx.groups.io with SMTP id smtpd.web12.4890.1586548964051293028 for ; Fri, 10 Apr 2020 13:02:44 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@outlook.com header.s=selector1 header.b=IowRgB2S; spf=pass (domain: outlook.com, ip: 40.92.23.38, mailfrom: michael.kubacki@outlook.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=O7a04dw2NG9Kl3FTrkHNmuI5/5P1aXWznr9H2mqwF1ORw2KjAOou39pMsw6RnNSXnlOTYqbe5hHpJDegI4/zI3LZqEFLCy+YqtG14Nr3C6Bcs7p+jrp/x57m8Y44T+OZ8hG4yDjXcJrBkl8Lm0Ptlg5O5kXifEXOypxW3BOK5hwy1FC5U0mhYjCZB/gu2826XPwluCPF4kiVEc4sz39wMizS4d2ntO5tBsFPZdUHsS7Zz9MNgRCYYIDxu/NJEnJ1FaykJAdLgd80bCYIjDISBoOxgHgIKxNzyHRSEfl/R3xGmHzEI1Af1yYv894HdMugWFgDr9OmkEY4tV0yVGCpXA== 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=Y73qLu8jkCp6ei9jHmynMGmKZUFAhq4duRhLk0Zi9ec=; b=P5lAdmEoFW8VnLIz4Yn64GS4byC8N33in+0TCJtsHVB9rKDOKPyXPILdSbXBeUOR5i7lOM6S/RkRur97E6Znup1hfzIi81RdvF/LgsRd0LNpGxgrZ/IobhQ/E+g0KtrhWozemDFpjOcfV0Y00uK9proNp+YkxUUYNTTDLf9ucFfDxrb4QNgMmizvG9wqds2fkP0QceSPmMRktU8l/nz02IXdxaTl/j+uoIsnFMkqFDTu9gvXl3hUHQCMiHpMxbqsY4meZBZWndsKnUiW5cmKxgUDMhj0Ill5I2g7ajDI+HtCZPsrxC47AxxHFEpQLq7q7xcGX6W1Asx9Bs6tRjPmCw== 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=Y73qLu8jkCp6ei9jHmynMGmKZUFAhq4duRhLk0Zi9ec=; b=IowRgB2SWYCcWnc0UTBb0dy9zQsi+cuD29Lh7ji7YoTeopxCjEeteJ+mLYw3PyDSQFaFimECQtsXsBSCUJ6kkWTmhWsopaUoRSfsowqAMn8I9xTigjKNC83OFieI6VgQ01tnfoN7cPVnFhJmQnsRpnb/K+D7TaC6zVBSY3uzaCW/j1S/NagTMkB72GrBjEVjFrUgJwgQE2RctcAjkAXzG1tVjOGGECiW7HdAJTILaxgzl6mly9mEVajO/X9h56qZEqXVTKJEofLAo0v8UZuPGXGRpq+DKOJ8ZV2Jfnnx/1GMDoi8pYK3Mcr8mnFM4AmruXO7tqdOocNVz4PYmq0T+Q== Received: from MW2NAM12FT048.eop-nam12.prod.protection.outlook.com (2a01:111:e400:fc65::4c) by MW2NAM12HT100.eop-nam12.prod.protection.outlook.com (2a01:111:e400:fc65::505) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2921.12; Fri, 10 Apr 2020 20:02:42 +0000 Received: from MWHPR07MB3440.namprd07.prod.outlook.com (2a01:111:e400:fc65::48) by MW2NAM12FT048.mail.protection.outlook.com (2a01:111:e400:fc65::215) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2921.12 via Frontend Transport; Fri, 10 Apr 2020 20:02:42 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:745693949F4D4CD9AC6E9BEF97F0C7989371D08EEAC4B1C33758EDCF3FB22D54;UpperCasedChecksum:0EBF78E13AA96958E0F2C671B2D04DA08855840AE95A83FA1BACB284460E0EA6;SizeAsReceived:7883;Count:49 Received: from MWHPR07MB3440.namprd07.prod.outlook.com ([fe80::bcc9:271b:20db:52e3]) by MWHPR07MB3440.namprd07.prod.outlook.com ([fe80::bcc9:271b:20db:52e3%6]) with mapi id 15.20.2900.015; Fri, 10 Apr 2020 20:02:42 +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 v2 2/7] MdeModulePkg/EhciDxe: Use BaseLib linked list iteration macros Date: Fri, 10 Apr 2020 13:02:13 -0700 Message-ID: X-Mailer: git-send-email 2.16.3.windows.1 In-Reply-To: <20200410200218.24992-1-michael.kubacki@outlook.com> References: <20200410200218.24992-1-michael.kubacki@outlook.com> X-ClientProxiedBy: MWHPR01CA0033.prod.exchangelabs.com (2603:10b6:300:101::19) To MWHPR07MB3440.namprd07.prod.outlook.com (2603:10b6:301:69::28) Return-Path: michael.kubacki@outlook.com X-Microsoft-Original-Message-ID: <20200410200218.24992-3-michael.kubacki@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (2001:4898:80e8:1:71cb:63a2:e2d4:2255) by MWHPR01CA0033.prod.exchangelabs.com (2603:10b6:300:101::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2900.15 via Frontend Transport; Fri, 10 Apr 2020 20:02:42 +0000 X-Mailer: git-send-email 2.16.3.windows.1 X-Microsoft-Original-Message-ID: <20200410200218.24992-3-michael.kubacki@outlook.com> X-TMN: [ESnp9txoXPrhk+nW/WOCAdFtr9WrMqKnjyTU8X4DANvV5SVsR6u1+DFb/3ndIxGQ] X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 49 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: d8cc713e-1079-455d-6886-08d7dd8a2111 X-MS-TrafficTypeDiagnostic: MW2NAM12HT100: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: h9jkDK+a48PE74iakW+hwkEOFXu7lWOJevlY7pJP4JHjKaSCmqQvaa/gCFsN/F9/p1MjgGAeYOVWy8Xy39qDjOIOi2CdCEbol1Cbehux1bglR3XQCq/X52Ov3AN82PdFgqOkSOrsPh/jNjhkG2Ey5NM8m4pReiJZNRrMMpsuzuU7EjllrIoFNFP2EsnVafV98W+hdwVe5AuDMcuFRT7/Q5sefPJNdeXd3WlKRwzxH94= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:0;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR07MB3440.namprd07.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:;DIR:OUT;SFP:1901; X-MS-Exchange-AntiSpam-MessageData: FwkZ4P76hkDZ2eIv5oz3Sv0pZz4AVxbQ3drUJuFvzV4csf1GnqK+e/1zfGulga3R2geButA4aOHIVnenwFHfmK3141GFdTw0L7LK/Z5d3EuuKl7RHqK+TMX25JPbEmwGn8qoHXGCuhzB90jwFH8yDY5PY/nn6OYWS9CI7E63Ct9+14fL3pG+ULe4Y0JIQy7ctaUIBTw7ykgLdhlDC3aFcQ== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: d8cc713e-1079-455d-6886-08d7dd8a2111 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Apr 2020 20:02:42.7738 (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: MW2NAM12HT100 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 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/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