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.107.244.100]) by mx.groups.io with SMTP id smtpd.web10.515.1586561848419257213 for ; Fri, 10 Apr 2020 16:37:28 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@microsoft.com header.s=selector2 header.b=Reug19/w; spf=pass (domain: microsoft.com, ip: 40.107.244.100, mailfrom: bret.barkelew@microsoft.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DK+8qqEfaji0vo2ej8UTzuaQgkek8CqK7+eqxySSiOtU5iumYsZAU82J3zAoBa0/2MrO+YTztQ9bRsLh9uyPDhCJSUEd8VIQbPVdTR9houJUF3ck+aGFrKvLKqGxuZW07UGhf+q1uPrUS+/ilDKzfEfhCC7Zp2LcxvtjvNRC5iMXU24JvyH8HvEbRX2cFEdMdUWx8XNpPhnkDNSTGtJ3ftyOvCgZEHRLNbzlgNMWof3kZPbVA4TEtjmC3avmo9T8hTTCF0kG09XJB+uQhrSOkkW4pTHXU5tGikbry2V4NXepRgTuukw/DauV3amo1mh/WtCbcGa5tj8kB26sd2+F2g== 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=nv4/uVuVzD447yeJ4pdbR8dBGonx9zTwScDY68X9zXM=; b=Q84vK/kJQa1PvHas/kKasJHUMqrpI6+oBzxyhvAcpp1dTsgLVh9PqVjVfujR616QalK6Kv3gA/zwg1U11Hppn13p0PEqItraiIEdJy27cdQ1CXZuS2jO8bA8nCHrsi1BBL3QaJFBSWHRkpzV/FNrtUsR//hSmN66nv1FHU9A/252AhZzImyyDDshAY2UZarW295fdpQLKQyCsoIm8ld0QaY2jxJ1rHCzO6euKGiF5Q5ebNXo8fx8r1JkunL991NPG8AHVRklHv+WKeLA/JffGzQExaNq1/GXHqdMbGY+rYZ25ZxCXA35l7mSY921Cdv2RYul1ASUVLPgHyWhWyZPzw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microsoft.com; dmarc=pass action=none header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nv4/uVuVzD447yeJ4pdbR8dBGonx9zTwScDY68X9zXM=; b=Reug19/wXEfNnTBR6a8VyYQ4j0Ro1GyaPKt+3xHYpMgc4lYY1g5jtJHLtsjD6IkqIkWtNlIk84i+7dJ3uKIM9/BgMqulkVm99CzbE7hMkx4tGVk1ef96oufhKnGCVX4jL7O4o7nqqcp6ebTIXUXzN3vaf53NUSIJmjq+bfPuKUM= Received: from CY4PR21MB0743.namprd21.prod.outlook.com (2603:10b6:903:b2::9) by CY4PR21MB0790.namprd21.prod.outlook.com (2603:10b6:903:13b::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2900.2; Fri, 10 Apr 2020 23:37:27 +0000 Received: from CY4PR21MB0743.namprd21.prod.outlook.com ([fe80::90d:10d9:c5bc:5318]) by CY4PR21MB0743.namprd21.prod.outlook.com ([fe80::90d:10d9:c5bc:5318%12]) with mapi id 15.20.2921.009; Fri, 10 Apr 2020 23:37:27 +0000 From: "Bret Barkelew" To: "devel@edk2.groups.io" , "michael.kubacki@outlook.com" CC: Dandan Bi , Hao A Wu , Jian J Wang , Liming Gao , Ray Ni , Sean Brogan Subject: Re: [EXTERNAL] [edk2-devel] [PATCH v2 5/7] MdeModulePkg/UfsPassThruDxe: Use BaseLib linked list iteration macros Thread-Topic: [EXTERNAL] [edk2-devel] [PATCH v2 5/7] MdeModulePkg/UfsPassThruDxe: Use BaseLib linked list iteration macros Thread-Index: AQHWD3MGWuwIk8b+cU6FkLArqfvpnKhzAwex Date: Fri, 10 Apr 2020 23:37:27 +0000 Message-ID: References: <20200410200218.24992-1-michael.kubacki@outlook.com>, In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=True;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2020-04-10T23:37:14.0758754Z;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ContentBits=0;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Method=Privileged authentication-results: spf=none (sender IP is ) smtp.mailfrom=Bret.Barkelew@microsoft.com; x-originating-ip: [71.212.145.195] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 21e7d4d2-810c-4ab9-da97-08d7dda820e6 x-ms-traffictypediagnostic: CY4PR21MB0790:|CY4PR21MB0790: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6790; x-forefront-prvs: 0369E8196C x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CY4PR21MB0743.namprd21.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(10019020)(4636009)(136003)(39860400002)(376002)(396003)(366004)(346002)(7696005)(8990500004)(76116006)(66946007)(8676002)(26005)(186003)(82950400001)(33656002)(91956017)(8936002)(53546011)(82960400001)(6506007)(71200400001)(66476007)(4326008)(52536014)(478600001)(5660300002)(107886003)(54906003)(966005)(10290500003)(2906002)(316002)(66446008)(81156014)(66556008)(55016002)(64756008)(86362001)(110136005)(9686003);DIR:OUT;SFP:1102; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: pFnVzfs1+HQZhaEwEYoHLZU1pfWfhwSs3/ZDjuWgCzWqAFZbLYaTeestwNJQs5wt834igFDqyioxxai4M5HmtmPFg+P+AvlM793WUoHvQIDQPTKGLas4zEc8JU9XRyokeG7ioxSN/CtyAvc70htqXxS+FODUn6ZYsyl3/FZCfhpWgNhHLEyGHdJRA79iGMW4Hn+g3YQr0UzZ9cOhlEvluK6TTT7rK12rU82MdxG4lIQF4Mkpzlt8TMo209tDxZFs2/RIPLb3rJ+U1CAKumFA76u5DQ3teYcCooPYj7zHKKUp6i1PNCRMYhI3sWn42sVoox0rOckLBkCbFs6HnTS3Mw2tLe3q6HiPc+8pjidSWi/ttFqACHcTU0NMpSVYLkLh7LyEFHKal3yb0mozBFxtspw2fXibdqgw2OHTmHOgH0vJkSQlSPVrfdMXuVKSnr1QoFwyPN28Pmmc7uhNL8vEweu9elA1JTwRlmnyr6rTfW8rQ8km8L39SrbPrW6Gl+PcQFfL25CoJEsS0a1Zxzo8Sg== x-ms-exchange-antispam-messagedata: bgMAgihT9wh/5MYFnuiZ190APKaLr++GtquKX+iN1ID1Be2XyyJMhzJlftL+0XZqrHHzy0ltLRIn5Ax3qXm/Da/UYOnAmL8TrcOgeVJMK8eDX1od28EMMdIbpeKqsHmyBLpYHSGbnIEUKlt0aWJm6A== MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 21e7d4d2-810c-4ab9-da97-08d7dda820e6 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Apr 2020 23:37:27.0689 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: sCF2AV/HmQsBUFZq2InkPlK/az9oyiE/8WmSPrFQS6N342viYtNhQhgVqFfomvO7wXnxu47++nKbAQ2jnFvUpw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR21MB0790 Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_CY4PR21MB0743305D18856D0E0D19844CEFDE0CY4PR21MB0743namp_" --_000_CY4PR21MB0743305D18856D0E0D19844CEFDE0CY4PR21MB0743namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Bret Barkelew - Bret ________________________________ From: devel@edk2.groups.io on behalf of Michael Kub= acki via groups.io Sent: Friday, April 10, 2020 1:02:16 PM To: devel@edk2.groups.io Cc: Dandan Bi ; Hao A Wu ; Jian J= Wang ; Liming Gao ; Ray Ni ; Sean Brogan Subject: [EXTERNAL] [edk2-devel] [PATCH v2 5/7] MdeModulePkg/UfsPassThruDx= e: Use BaseLib linked list iteration macros From: Michael Kubacki REF:https://nam06.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fbu= gzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D1959&data=3D02%7C01%7CBret.B= arkelew%40microsoft.com%7C42a2015727944a46024e08d7dd8a28da%7C72f988bf86f141= af91ab2d7cd011db47%7C1%7C0%7C637221457764169536&sdata=3DiHZJWqVVjPHbOjQ= Qu8if%2Br5NzA9Uexxeo%2BgHV619t3Y%3D&reserved=3D0 Replaces usage of the linked list iteration macros defined in UfsPassThru.= 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: Hao A Wu --- 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/MdeModule= Pkg/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.
+ Copyright (c) Microsoft Corporation.
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 =3D UFS_PASS_THRU_TRANS_REQ_FROM_THIS (Entry); // diff --git a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c b/MdeMod= ulePkg/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.
+ Copyright (c) Microsoft Corporation.
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 =3D UFS_PASS_THRU_TRANS_REQ_FROM_THIS (Entry); Packet =3D TransReq->Packet; diff --git a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.h b/MdeModule= Pkg/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.
+ Copyright (c) Microsoft Corporation.
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 =3D (ListHead)->ForwardLink, NextEntry =3D Entry->ForwardLink= ;\ - Entry !=3D (ListHead); Entry =3D NextEntry, NextEntry =3D Entry->Fo= rwardLink) - typedef struct _UFS_PASS_THRU_PRIVATE_DATA { UINT32 Signature; EFI_HANDLE Handle; -- 2.16.3.windows.1 --_000_CY4PR21MB0743305D18856D0E0D19844CEFDE0CY4PR21MB0743namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Reviewed-by: Bret Barkelew <bret.barkelew@micros= oft.com>

 

- Bret

 


From: devel@edk2.groups.io= <devel@edk2.groups.io> on behalf of Michael Kubacki via groups.io &l= t;michael.kubacki=3Doutlook.com@groups.io>
Sent: Friday, April 10, 2020 1:02:16 PM
To: devel@edk2.groups.io <devel@edk2.groups.io>
Cc: Dandan Bi <dandan.bi@intel.com>; Hao A Wu <hao.a.wu@in= tel.com>; Jian J Wang <jian.j.wang@intel.com>; Liming Gao <limi= ng.gao@intel.com>; Ray Ni <ray.ni@intel.com>; Sean Brogan <sean= .brogan@microsoft.com>
Subject: [EXTERNAL] [edk2-devel] [PATCH v2 5/7] MdeModulePkg/UfsPas= sThruDxe: Use BaseLib linked list iteration macros
 
From: Michael Kubacki <michael.kubacki@microso= ft.com>

REF:https://nam06.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fbu= gzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D1959&amp;data=3D02%7C01%7CBr= et.Barkelew%40microsoft.com%7C42a2015727944a46024e08d7dd8a28da%7C72f988bf86= f141af91ab2d7cd011db47%7C1%7C0%7C637221457764169536&amp;sdata=3DiHZJWqV= VjPHbOjQQu8if%2Br5NzA9Uexxeo%2BgHV619t3Y%3D&amp;reserved=3D0

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>
Reviewed-by: Hao A Wu <hao.a.wu@intel.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/MdeModule= Pkg/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 rese= rved.<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 que= ue
   //
   if (!IsListEmpty(&Private->Queue)) {
-    EFI_LIST_FOR_EACH_SAFE (Entry, NextEntry, &Private= ->Queue) {
+    BASE_LIST_FOR_EACH_SAFE (Entry, NextEntry, &Pr= ivate->Queue) {
       TransReq  =3D UFS_PASS_THRU_TRAN= S_REQ_FROM_THIS (Entry);
 
       //
diff --git a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c b/MdeMod= ulePkg/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 cmd= s.
 
   Copyright (c) 2014 - 2019, Intel Corporation. All rights rese= rved.<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.<= br>    //
   if (!IsListEmpty(&Private->Queue)) {
-    EFI_LIST_FOR_EACH_SAFE (Entry, NextEntry, &Private= ->Queue) {
+    BASE_LIST_FOR_EACH_SAFE (Entry, NextEntry, &Pr= ivate->Queue) {
       TransReq  =3D UFS_PASS_THRU_TRAN= S_REQ_FROM_THIS (Entry);
       Packet    =3D TransReq= ->Packet;
 
diff --git a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.h b/MdeModule= Pkg/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 rese= rved.<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)  &nb= sp;         \
-  for(Entry =3D (ListHead)->ForwardLink, NextEntry =3D Entry->= ForwardLink;\
-      Entry !=3D (ListHead); Entry =3D NextEntry= , NextEntry =3D Entry->ForwardLink)
-
 typedef struct _UFS_PASS_THRU_PRIVATE_DATA {
   UINT32         &= nbsp;           &nbs= p;        Signature;
   EFI_HANDLE        &nb= sp;            =      Handle;
--
2.16.3.windows.1




--_000_CY4PR21MB0743305D18856D0E0D19844CEFDE0CY4PR21MB0743namp_--