]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/EhciPei: Use BaseLib linked list iteration macros
authorMichael Kubacki <michael.kubacki@microsoft.com>
Fri, 10 Apr 2020 20:02:14 +0000 (04:02 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Tue, 21 Apr 2020 02:20:51 +0000 (02:20 +0000)
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 <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>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Bret Barkelew <bret.barkelew@microsoft.com>
MdeModulePkg/Bus/Pci/EhciPei/EhcPeim.h
MdeModulePkg/Bus/Pci/EhciPei/EhciPei.inf
MdeModulePkg/Bus/Pci/EhciPei/EhciSched.c
MdeModulePkg/Bus/Pci/EhciPei/EhciUrb.c

index 6b69f7a656ce0b3b24c32401018cf3f3485027f4..8e5b6418e6eee34efb83ebc0b84ac1cd9fef383b 100644 (file)
@@ -2,6 +2,7 @@
 Private Header file for Usb Host Controller PEIM\r
 \r
 Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) Microsoft Corporation.<BR>\r
 \r
 SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
@@ -17,6 +18,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 #include <Ppi/IoMmu.h>\r
 #include <Ppi/EndOfPeiPhase.h>\r
 \r
+#include <Library/BaseLib.h>\r
 #include <Library/DebugLib.h>\r
 #include <Library/PeimEntryPoint.h>\r
 #include <Library/PeiServicesLib.h>\r
@@ -60,20 +62,6 @@ typedef struct _PEI_USB2_HC_DEV PEI_USB2_HC_DEV;
 //\r
 #define EHC_SYNC_POLL_INTERVAL       (6 * EHC_1_MILLISECOND)\r
 \r
-//\r
-//Iterate through the double linked list. NOT delete safe\r
-//\r
-#define EFI_LIST_FOR_EACH(Entry, ListHead)    \\r
-  for(Entry = (ListHead)->ForwardLink; Entry != (ListHead); Entry = Entry->ForwardLink)\r
-\r
-//\r
-//Iterate through the double linked list. This is delete-safe.\r
-//Don't touch NextEntry\r
-//\r
-#define EFI_LIST_FOR_EACH_SAFE(Entry, NextEntry, ListHead)            \\r
-  for(Entry = (ListHead)->ForwardLink, NextEntry = Entry->ForwardLink;\\r
-      Entry != (ListHead); Entry = NextEntry, NextEntry = Entry->ForwardLink)\r
-\r
 #define EFI_LIST_CONTAINER(Entry, Type, Field) BASE_CR(Entry, Type, Field)\r
 \r
 \r
index 0fc09ffca43495e60f5393a8f8030f795c6106ee..01ebb371a72ed61fc9077c92a00c5fc9fa97561e 100644 (file)
@@ -5,6 +5,7 @@
 # which is used to enable recovery function from USB Drivers.\r
 #\r
 # Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) Microsoft Corporation.<BR>\r
 #\r
 # SPDX-License-Identifier: BSD-2-Clause-Patent\r
 #\r
@@ -47,6 +48,7 @@
 [LibraryClasses]\r
   IoLib\r
   TimerLib\r
+  BaseLib\r
   BaseMemoryLib\r
   PeimEntryPoint\r
   PeiServicesLib\r
index 8eb432dfc31d5466df66fce81e20a9a2b1befd75..311f501980626badece6b79e4a4144ff98194c0d 100644 (file)
@@ -3,6 +3,7 @@ PEIM to produce gPeiUsb2HostControllerPpiGuid based on gPeiUsbControllerPpiGuid
 which is used to enable recovery function from USB Drivers.\r
 \r
 Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) Microsoft Corporation.<BR>\r
 \r
 SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
@@ -323,7 +324,7 @@ EhcCheckUrbResult (
     goto ON_EXIT;\r
   }\r
 \r
-  EFI_LIST_FOR_EACH (Entry, &Urb->Qh->Qtds) {\r
+  BASE_LIST_FOR_EACH (Entry, &Urb->Qh->Qtds) {\r
     Qtd   = EFI_LIST_CONTAINER (Entry, PEI_EHC_QTD, QtdList);\r
     QtdHw = &Qtd->QtdHw;\r
     State = (UINT8) QtdHw->Status;\r
index 995ccd2463d2b42836b15871062ee73ea1c4b32d..df512ed6fa592fe442cba99d00cb15edf863fe07 100644 (file)
@@ -3,6 +3,7 @@ PEIM to produce gPeiUsb2HostControllerPpiGuid based on gPeiUsbControllerPpiGuid
 which is used to enable recovery function from USB Drivers.\r
 \r
 Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) Microsoft Corporation.<BR>\r
 \r
 SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
@@ -290,7 +291,7 @@ EhcFreeQtds (
   EFI_LIST_ENTRY          *Next;\r
   PEI_EHC_QTD             *Qtd;\r
 \r
-  EFI_LIST_FOR_EACH_SAFE (Entry, Next, Qtds) {\r
+  BASE_LIST_FOR_EACH_SAFE (Entry, Next, Qtds) {\r
     Qtd = EFI_LIST_CONTAINER (Entry, PEI_EHC_QTD, QtdList);\r
 \r
     RemoveEntryList (&Qtd->QtdList);\r
@@ -461,7 +462,7 @@ EhcCreateQtds (
   //\r
   // OK, all the QTDs needed are created. Now, fix the NextQtd point\r
   //\r
-  EFI_LIST_FOR_EACH (Entry, &Qh->Qtds) {\r
+  BASE_LIST_FOR_EACH (Entry, &Qh->Qtds) {\r
     Qtd = EFI_LIST_CONTAINER (Entry, PEI_EHC_QTD, QtdList);\r
 \r
     //\r