public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Michael Kubacki" <michael.kubacki@outlook.com>
To: devel@edk2.groups.io
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: [PATCH v1 5/7] MdeModulePkg/UfsPassThruDxe: Use BaseLib linked list iteration macros
Date: Thu,  9 Apr 2020 13:05:12 -0700	[thread overview]
Message-ID: <DM5PR07MB34353EA56417D665C1527056E9C10@DM5PR07MB3435.namprd07.prod.outlook.com> (raw)
In-Reply-To: <20200409200514.32796-1-michael.kubacki@outlook.com>

From: Michael Kubacki <michael.kubacki@microsoft.com>

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1959

Replaces usage of the linked list iteration macros defined in UfsPassThru.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>
---
 MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.c    | 3 ++-
 MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c | 3 ++-
 MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.h    | 9 +--------
 3 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.c b/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.c
index 26c5a8b85554..9768c2e6fb22 100644
--- a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.c
+++ b/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.c
@@ -1,6 +1,7 @@
 /** @file
 
   Copyright (c) 2014 - 2019, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) Microsoft Corporation.<BR>
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -1083,7 +1084,7 @@ UfsPassThruDriverBindingStop (
   // Cleanup the resources of I/O requests in the async I/O queue
   //
   if (!IsListEmpty(&Private->Queue)) {
-    EFI_LIST_FOR_EACH_SAFE (Entry, NextEntry, &Private->Queue) {
+    BASE_LIST_FOR_EACH_SAFE (Entry, NextEntry, &Private->Queue) {
       TransReq  = UFS_PASS_THRU_TRANS_REQ_FROM_THIS (Entry);
 
       //
diff --git a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c b/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c
index 93ac958f658f..0b1030ab4788 100644
--- a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c
+++ b/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c
@@ -3,6 +3,7 @@
   for upper layer application to execute UFS-supported SCSI cmds.
 
   Copyright (c) 2014 - 2019, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) Microsoft Corporation.<BR>
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -2285,7 +2286,7 @@ ProcessAsyncTaskList (
   // Check the entries in the async I/O queue are done or not.
   //
   if (!IsListEmpty(&Private->Queue)) {
-    EFI_LIST_FOR_EACH_SAFE (Entry, NextEntry, &Private->Queue) {
+    BASE_LIST_FOR_EACH_SAFE (Entry, NextEntry, &Private->Queue) {
       TransReq  = UFS_PASS_THRU_TRANS_REQ_FROM_THIS (Entry);
       Packet    = TransReq->Packet;
 
diff --git a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.h b/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.h
index cbc0c2126eee..ef33250c89d7 100644
--- a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.h
+++ b/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.h
@@ -1,6 +1,7 @@
 /** @file
 
   Copyright (c) 2014 - 2019, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) Microsoft Corporation.<BR>
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -46,14 +47,6 @@ typedef struct {
   UINT16   Rsvd:4;
 } UFS_EXPOSED_LUNS;
 
-//
-// Iterate through the double linked list. This is delete-safe.
-// Do not 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)
-
 typedef struct _UFS_PASS_THRU_PRIVATE_DATA {
   UINT32                              Signature;
   EFI_HANDLE                          Handle;
-- 
2.16.3.windows.1


  parent reply	other threads:[~2020-04-09 20:06 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20200409200514.32796-1-michael.kubacki@outlook.com>
2020-04-09 20:05 ` [PATCH v1 1/7] MdePkg/BaseLib: Add linked list iteration macros Michael Kubacki
2020-04-10  1:45   ` [edk2-devel] " Guomin Jiang
2020-04-09 20:05 ` [PATCH v1 2/7] MdeModulePkg/EhciDxe: Use BaseLib " Michael Kubacki
2020-04-10  1:46   ` [edk2-devel] " Guomin Jiang
2020-04-09 20:05 ` [PATCH v1 3/7] MdeModulePkg/EhciPei: " Michael Kubacki
2020-04-10  1:47   ` [edk2-devel] " Guomin Jiang
2020-04-09 20:05 ` [PATCH v1 4/7] MdeModulePkg/XhciDxe: " Michael Kubacki
2020-04-10  1:47   ` [edk2-devel] " Guomin Jiang
2020-04-09 20:05 ` Michael Kubacki [this message]
2020-04-09 20:05 ` [PATCH v1 6/7] MdeModulePkg/RamDiskDxe: " Michael Kubacki
2020-04-09 20:05 ` [PATCH v1 7/7] SecurityPkg/HddPassword: " Michael Kubacki
2020-04-09 23:10   ` Yao, Jiewen

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=DM5PR07MB34353EA56417D665C1527056E9C10@DM5PR07MB3435.namprd07.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