From dc528558c99406c811d19f598c4f3303e8953160 Mon Sep 17 00:00:00 2001 From: Michael Kubacki Date: Sat, 11 Apr 2020 04:02:15 +0800 Subject: MdeModulePkg/XhciDxe: Use BaseLib linked list iteration macros REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1959 Replaces usage of the linked list iteration macros defined in Xhci.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 Reviewed-by: Liming Gao Reviewed-by: Bret Barkelew --- MdeModulePkg/Bus/Pci/XhciDxe/Xhci.h | 9 +-------- MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c | 9 +++++---- 2 files changed, 6 insertions(+), 12 deletions(-) (limited to 'MdeModulePkg/Bus') diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.h b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.h index 72b4e084f1..3285eb8798 100644 --- a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.h +++ b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.h @@ -3,6 +3,7 @@ Provides some data structure definitions used by the XHCI host controller driver. Copyright (c) 2011 - 2017, Intel Corporation. All rights reserved.
+Copyright (c) Microsoft Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -82,14 +83,6 @@ typedef struct _USB_DEV_CONTEXT USB_DEV_CONTEXT; #define INT_INTER 3 #define INT_INTER_ASYNC 4 -// -// 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) #define XHC_LOW_32BIT(Addr64) ((UINT32)(((UINTN)(Addr64)) & 0xFFFFFFFF)) diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c index c0c374fc47..ab8957c546 100644 --- a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c +++ b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c @@ -3,6 +3,7 @@ XHCI transfer scheduling routines. Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
+Copyright (c) Microsoft Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -1051,7 +1052,7 @@ IsAsyncIntTrb ( LIST_ENTRY *Next; URB *CheckedUrb; - EFI_LIST_FOR_EACH_SAFE (Entry, Next, &Xhc->AsyncIntTransfers) { + BASE_LIST_FOR_EACH_SAFE (Entry, Next, &Xhc->AsyncIntTransfers) { CheckedUrb = EFI_LIST_CONTAINER (Entry, URB, UrbList); if (IsTransferRingTrb (Xhc, Trb, CheckedUrb)) { *Urb = CheckedUrb; @@ -1346,7 +1347,7 @@ XhciDelAsyncIntTransfer ( Urb = NULL; - EFI_LIST_FOR_EACH_SAFE (Entry, Next, &Xhc->AsyncIntTransfers) { + BASE_LIST_FOR_EACH_SAFE (Entry, Next, &Xhc->AsyncIntTransfers) { Urb = EFI_LIST_CONTAINER (Entry, URB, UrbList); if ((Urb->Ep.BusAddr == BusAddr) && (Urb->Ep.EpAddr == EpNum) && @@ -1386,7 +1387,7 @@ XhciDelAllAsyncIntTransfers ( URB *Urb; EFI_STATUS Status; - EFI_LIST_FOR_EACH_SAFE (Entry, Next, &Xhc->AsyncIntTransfers) { + BASE_LIST_FOR_EACH_SAFE (Entry, Next, &Xhc->AsyncIntTransfers) { Urb = EFI_LIST_CONTAINER (Entry, URB, UrbList); // @@ -1578,7 +1579,7 @@ XhcMonitorAsyncRequests ( Xhc = (USB_XHCI_INSTANCE*) Context; - EFI_LIST_FOR_EACH_SAFE (Entry, Next, &Xhc->AsyncIntTransfers) { + BASE_LIST_FOR_EACH_SAFE (Entry, Next, &Xhc->AsyncIntTransfers) { Urb = EFI_LIST_CONTAINER (Entry, URB, UrbList); // -- cgit v1.2.3