From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (NAM11-DM6-obe.outbound.protection.outlook.com [40.92.19.22]) by mx.groups.io with SMTP id smtpd.web10.18116.1586462799563764957 for ; Thu, 09 Apr 2020 13:06:39 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@outlook.com header.s=selector1 header.b=b2pL0rAu; spf=pass (domain: outlook.com, ip: 40.92.19.22, mailfrom: michael.kubacki@outlook.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bZPam/COrq9ry3HqE3nl+WnXhNm1qHOhGAu82s8zsiyl1IgxhMaL36RpbgQ1Dj+0nD+xQ2R61sTWL/aWsYoMk2QhFmKF1QhHfmt/kmoMb5VpcTA+YF05EQ3mVLTe8e04k5h3vKruaSlmi+8B59jrXyXuvxaQSczAqFnaO62mvJpKfBmb22pbSQ+I3BIb3dCmxZKAwkJE6ueQbq2YkwtogXkJtksSH1bQJJshPfxnC1AprZNNcYZ70iVumKAxeYmsulNL12beRgrJkukDz8yzDvXNA3PRbXbnbnpDeBLyVRcmOT12iir+zBlBpNJPxHGHfVTofp3p/4Q8++vp1cc1Sw== 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=6rY2NRZ1Gb+Kxe9tp0ebSG80ru8XXBdhpYW0IKxFNkI=; b=lWKrktM8JKS9Itvzcuck1/ObWWU3NDqiJoEGiCecTbxo6Cnmac4sYG3bTuv8VCGhf5Y0ZmF3UWbd1rARTqxVnmy/m4SYzv57HfMW/T74WSy0AjfAThNDQIU0+ddRMEEEX3tbUBSlznz8qRd7oEoIiSa7x9eUsNtcDdFu+kf82NFqoPQep4CJjyln0u0OFaOaLvKsEgTC9QvRtNZYStCpTMlvKygeE58Inlr9uh39+2ySeaeMNOcN2m3fYlwhrzY2Co5AbZbcHtxcH6L0T1FX6Q2aEosiwJiUa5aacN/96nlbBK6tdkVMa54YqUm2IsBSg9u3K7daO5VBrrWEiHJzvg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=outlook.com; dmarc=pass action=none header.from=outlook.com; dkim=pass header.d=outlook.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6rY2NRZ1Gb+Kxe9tp0ebSG80ru8XXBdhpYW0IKxFNkI=; b=b2pL0rAuhykNC1A4hVdcKwTOQCy2vmn/XSBpfvERXfrhvymFRVlQ6rwug/t3EX8Ec17EGeImsIk/S0y4HifKGms0f8AyADVC67Yo+SMC0QxC1E+F8Ey4oIYQuQzixiuX2/1LGqW/IH7ooFvzUTLViT2wrDzkbDIDAkGKttmvhyjFPvKfRM4MV0hIWjWmRenavrXWLGkvWnvz6ncnhw+DGTslJlo22ZLMDpTAg8Q3ud/lns23HDtdr39MdWMbp/j6iZZ0aiSL251lfg93Aa5EwDz1MUCzo0D1Nmpu2NnF8QVgcquVapmzoT6aoEEotKc26XQewfiKoz5vzHK/lRTnhA== Received: from BN8NAM11FT019.eop-nam11.prod.protection.outlook.com (2a01:111:e400:fc4b::4c) by BN8NAM11HT116.eop-nam11.prod.protection.outlook.com (2a01:111:e400:fc4b::445) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2900.18; Thu, 9 Apr 2020 20:06:38 +0000 Received: from DM5PR07MB3435.namprd07.prod.outlook.com (2a01:111:e400:fc4b::44) by BN8NAM11FT019.mail.protection.outlook.com (2a01:111:e400:fc4b::158) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2900.18 via Frontend Transport; Thu, 9 Apr 2020 20:06:38 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:F7E02DF3EA83031C24E36A03F23CC59E7CE4BD69DC8DC9BA5799776AC6575DE5;UpperCasedChecksum:285916D78466A6C93BECD7CF490020770F7B38052C093AC1BF75E2AA976A793C;SizeAsReceived:7896;Count:49 Received: from DM5PR07MB3435.namprd07.prod.outlook.com ([fe80::801e:fde0:da7d:191f]) by DM5PR07MB3435.namprd07.prod.outlook.com ([fe80::801e:fde0:da7d:191f%6]) with mapi id 15.20.2900.015; Thu, 9 Apr 2020 20:06:38 +0000 From: "Michael Kubacki" To: devel@edk2.groups.io Cc: Dandan Bi , Hao A Wu , Jian J Wang , Liming Gao , Ray Ni , Sean Brogan Subject: [PATCH v1 6/7] MdeModulePkg/RamDiskDxe: Use BaseLib linked list iteration macros Date: Thu, 9 Apr 2020 13:05:13 -0700 Message-ID: X-Mailer: git-send-email 2.16.3.windows.1 In-Reply-To: <20200409200514.32796-1-michael.kubacki@outlook.com> References: <20200409200514.32796-1-michael.kubacki@outlook.com> X-ClientProxiedBy: MWHPR10CA0062.namprd10.prod.outlook.com (2603:10b6:300:2c::24) To DM5PR07MB3435.namprd07.prod.outlook.com (2603:10b6:4:67::14) Return-Path: michael.kubacki@outlook.com X-Microsoft-Original-Message-ID: <20200409200514.32796-7-michael.kubacki@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (2001:4898:80e8:7:9d66:7f00:4b99:db3e) by MWHPR10CA0062.namprd10.prod.outlook.com (2603:10b6:300:2c::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2900.15 via Frontend Transport; Thu, 9 Apr 2020 20:06:37 +0000 X-Mailer: git-send-email 2.16.3.windows.1 X-Microsoft-Original-Message-ID: <20200409200514.32796-7-michael.kubacki@outlook.com> X-TMN: [L1WSauiNCr51Uk8ybJj/6Krxmd4jhUB6nITczl63ErpedG7gw7V6kNtCouCzZNvY] X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 49 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 32e4a1c3-0584-4f87-a0d9-08d7dcc182d6 X-MS-TrafficTypeDiagnostic: BN8NAM11HT116: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 34CdW9hwB11Zp/vsOSR0p+BMiFbh+eyFQfk/AvL6dKCITDP9nST31WDZdJsihS0Fl+QyI9ZJqhRlFMPNC+EqXAs8xmgRw9MD8ZknSaGHV/sGSWqFvBcTawtwAT8Ay8kyRe7hl5XSeO45xVBijCCSunNz8+2w5gtllZgQNpC7SiZrL3NXh0r09nRFHtJEkR+alum9gO6yrv1s7nv9KLomUmn/NOrQCNA3uwtBtV6z8p4= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:0;SRV:;IPV:NLI;SFV:NSPM;H:DM5PR07MB3435.namprd07.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:;DIR:OUT;SFP:1901; X-MS-Exchange-AntiSpam-MessageData: tJt+2k60kuVCsxKxQM+O/xv2GNkOI9j3n6uWr5M3vHzIgpzIeJpPh15MQsP78tzPfMls2wzqDpPB9XNXO34JYMp4mWR3H2mpURZ45J1qjC45ZFIMC1TJd4zwc/okywBsGtIXKtCK//AAr9ltg+TnL5tvcGdTw0Wd1S3a2wO5lQyJhwrqPMBpyX37TqZMmT9z8kijNOq2pwYoyE5qg3a+qA== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 32e4a1c3-0584-4f87-a0d9-08d7dcc182d6 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Apr 2020 20:06:38.0705 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8NAM11HT116 Content-Type: text/plain From: Michael Kubacki REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1959 Replaces usage of the linked list iteration macros defined in RamDiskImpl.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 --- MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDriver.c | 3 ++- MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskImpl.c | 9 +++++---- MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskProtocol.c | 5 +++-- MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskImpl.h | 15 +-------------- 4 files changed, 11 insertions(+), 21 deletions(-) diff --git a/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDriver.c b/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDriver.c index a80ef271df9c..fcbf4f117dc6 100644 --- a/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDriver.c +++ b/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDriver.c @@ -2,6 +2,7 @@ The driver entry point for RamDiskDxe driver. Copyright (c) 2016, Intel Corporation. All rights reserved.
+ Copyright (c) Microsoft Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -92,7 +93,7 @@ RamDiskAcpiCheck ( return; } - EFI_LIST_FOR_EACH (Entry, &RegisteredRamDisks) { + BASE_LIST_FOR_EACH (Entry, &RegisteredRamDisks) { PrivateData = RAM_DISK_PRIVATE_FROM_THIS (Entry); RamDiskPublishNfit (PrivateData); } diff --git a/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskImpl.c b/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskImpl.c index 96ea74a9a536..e35b8fa2296c 100644 --- a/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskImpl.c +++ b/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskImpl.c @@ -3,6 +3,7 @@ Copyright (c) 2016, Intel Corporation. All rights reserved.
(C) Copyright 2016-2018 Hewlett Packard Enterprise Development LP
+ Copyright (c) Microsoft Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -165,7 +166,7 @@ UnregisterAllRamDisks ( RAM_DISK_PRIVATE_DATA *PrivateData; if (!IsListEmpty(&RegisteredRamDisks)) { - EFI_LIST_FOR_EACH_SAFE (Entry, NextEntry, &RegisteredRamDisks) { + BASE_LIST_FOR_EACH_SAFE (Entry, NextEntry, &RegisteredRamDisks) { PrivateData = RAM_DISK_PRIVATE_FROM_THIS (Entry); gBS->UninstallMultipleProtocolInterfaces ( @@ -507,7 +508,7 @@ UpdateMainForm ( EndLabel->Number = MAIN_LABEL_LIST_END; Index = 0; - EFI_LIST_FOR_EACH (Entry, &RegisteredRamDisks) { + BASE_LIST_FOR_EACH (Entry, &RegisteredRamDisks) { PrivateData = RAM_DISK_PRIVATE_FROM_THIS (Entry); PrivateData->CheckBoxId = (EFI_QUESTION_ID) (MAIN_CHECKBOX_QUESTION_ID_START + Index); @@ -689,7 +690,7 @@ RamDiskCallback ( // // Remove the selected RAM disks // - EFI_LIST_FOR_EACH_SAFE (Entry, NextEntry, &RegisteredRamDisks) { + BASE_LIST_FOR_EACH_SAFE (Entry, NextEntry, &RegisteredRamDisks) { PrivateData = RAM_DISK_PRIVATE_FROM_THIS (Entry); if (PrivateData->CheckBoxChecked) { RamDiskUnregister ( @@ -742,7 +743,7 @@ RamDiskCallback ( // if ((QuestionId >= MAIN_CHECKBOX_QUESTION_ID_START) && (QuestionId < CREATE_RAW_RAM_DISK_FORM_ID)) { - EFI_LIST_FOR_EACH (Entry, &RegisteredRamDisks) { + BASE_LIST_FOR_EACH (Entry, &RegisteredRamDisks) { PrivateData = RAM_DISK_PRIVATE_FROM_THIS (Entry); if (PrivateData->CheckBoxId == QuestionId) { PrivateData->CheckBoxChecked = (BOOLEAN) (Value->u8 != 0); diff --git a/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskProtocol.c b/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskProtocol.c index 36d635e4bc31..4333e000539b 100644 --- a/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskProtocol.c +++ b/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskProtocol.c @@ -3,6 +3,7 @@ Copyright (c) 2016 - 2019, Intel Corporation. All rights reserved.
(C) Copyright 2016 Hewlett Packard Enterprise Development LP
+ Copyright (c) Microsoft Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -662,7 +663,7 @@ RamDiskRegister ( if (!IsListEmpty(&RegisteredRamDisks)) { DevicePathSize = GetDevicePathSize (PrivateData->DevicePath); - EFI_LIST_FOR_EACH (Entry, &RegisteredRamDisks) { + BASE_LIST_FOR_EACH (Entry, &RegisteredRamDisks) { RegisteredPrivateData = RAM_DISK_PRIVATE_FROM_THIS (Entry); if (DevicePathSize == GetDevicePathSize (RegisteredPrivateData->DevicePath)) { // @@ -797,7 +798,7 @@ RamDiskUnregister ( EndingAddr = ReadUnaligned64 ((UINT64 *) &(RamDiskDevNode->EndingAddr[0])); if (!IsListEmpty(&RegisteredRamDisks)) { - EFI_LIST_FOR_EACH_SAFE (Entry, NextEntry, &RegisteredRamDisks) { + BASE_LIST_FOR_EACH_SAFE (Entry, NextEntry, &RegisteredRamDisks) { PrivateData = RAM_DISK_PRIVATE_FROM_THIS (Entry); // diff --git a/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskImpl.h b/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskImpl.h index 25fec15c1882..ed80b47ccc33 100644 --- a/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskImpl.h +++ b/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskImpl.h @@ -2,6 +2,7 @@ The header file of RamDiskDxe driver. Copyright (c) 2016 - 2019, Intel Corporation. All rights reserved.
+ Copyright (c) Microsoft Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -47,20 +48,6 @@ // #define RAM_DISK_DEFAULT_BLOCK_SIZE 512 -// -// 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. -// 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) - // // RamDiskDxe driver maintains a list of registered RAM disks. // -- 2.16.3.windows.1