From: "Bret Barkelew" <bret.barkelew@microsoft.com>
To: "devel@edk2.groups.io" <devel@edk2.groups.io>,
"michael.kubacki@outlook.com" <michael.kubacki@outlook.com>
Cc: Dandan Bi <dandan.bi@intel.com>, Hao A Wu <hao.a.wu@intel.com>,
Jian J Wang <jian.j.wang@intel.com>,
Liming Gao <liming.gao@intel.com>, Ray Ni <ray.ni@intel.com>,
Sean Brogan <sean.brogan@microsoft.com>
Subject: Re: [EXTERNAL] [edk2-devel] [PATCH v2 2/7] MdeModulePkg/EhciDxe: Use BaseLib linked list iteration macros
Date: Fri, 10 Apr 2020 23:42:52 +0000 [thread overview]
Message-ID: <CY4PR21MB074342C7451CCF8D04929994EFDE0@CY4PR21MB0743.namprd21.prod.outlook.com> (raw)
In-Reply-To: <MWHPR07MB34406CB1BEBABACFD5427EB5E9DE0@MWHPR07MB3440.namprd07.prod.outlook.com>
[-- Attachment #1: Type: text/plain, Size: 6982 bytes --]
Reviewed-by: Bret Barkelew <bret.barkelew@micrsoft.com>
- Bret
From: Michael Kubacki via groups.io<mailto:michael.kubacki=outlook.com@groups.io>
Sent: Friday, April 10, 2020 1:02 PM
To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>
Cc: Dandan Bi<mailto:dandan.bi@intel.com>; Hao A Wu<mailto:hao.a.wu@intel.com>; Jian J Wang<mailto:jian.j.wang@intel.com>; Liming Gao<mailto:liming.gao@intel.com>; Ray Ni<mailto:ray.ni@intel.com>; Sean Brogan<mailto:sean.brogan@microsoft.com>
Subject: [EXTERNAL] [edk2-devel] [PATCH v2 2/7] MdeModulePkg/EhciDxe: Use BaseLib linked list iteration macros
From: Michael Kubacki <michael.kubacki@microsoft.com>
REF:https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D1959&data=02%7C01%7Cbret.barkelew%40microsoft.com%7Ce3d00585bdea48b8a1c308d7dd8a2296%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637221457660162476&sdata=%2BbDiOEckmCFTUHLWOAa1pohNf65HMeHx5YiJQ7C5hHc%3D&reserved=0
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 ++++++-----
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.<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 = 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.<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 = 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.<BR>
+Copyright (c) Microsoft Corporation.<BR>
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.<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 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
[-- Attachment #2: Type: text/html, Size: 11594 bytes --]
next prev parent reply other threads:[~2020-04-10 23:42 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20200410200218.24992-1-michael.kubacki@outlook.com>
2020-04-10 20:02 ` [PATCH v2 1/7] MdePkg/BaseLib: Add linked list iteration macros Michael Kubacki
2020-04-10 23:43 ` [EXTERNAL] [edk2-devel] " Bret Barkelew
2020-04-17 1:44 ` Zhiguang Liu
2020-04-10 20:02 ` [PATCH v2 2/7] MdeModulePkg/EhciDxe: Use BaseLib " Michael Kubacki
2020-04-10 23:42 ` Bret Barkelew [this message]
2020-04-10 20:02 ` [PATCH v2 3/7] MdeModulePkg/EhciPei: " Michael Kubacki
2020-04-10 23:38 ` [EXTERNAL] [edk2-devel] " Bret Barkelew
2020-04-10 20:02 ` [PATCH v2 4/7] MdeModulePkg/XhciDxe: " Michael Kubacki
2020-04-10 23:37 ` [EXTERNAL] [edk2-devel] " Bret Barkelew
2020-04-10 20:02 ` [PATCH v2 5/7] MdeModulePkg/UfsPassThruDxe: " Michael Kubacki
2020-04-10 23:37 ` [EXTERNAL] [edk2-devel] " Bret Barkelew
2020-04-10 20:02 ` [PATCH v2 6/7] MdeModulePkg/RamDiskDxe: " Michael Kubacki
2020-04-10 23:37 ` [EXTERNAL] [edk2-devel] " Bret Barkelew
2020-04-10 20:02 ` [PATCH v2 7/7] SecurityPkg/HddPassword: " Michael Kubacki
2020-04-10 23:36 ` [EXTERNAL] [edk2-devel] " Bret Barkelew
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CY4PR21MB074342C7451CCF8D04929994EFDE0@CY4PR21MB0743.namprd21.prod.outlook.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox