From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 23DBFAC0319 for ; Mon, 2 Oct 2023 03:00:39 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=F9kfyzxnE2tNA8a10jehTDRwsCJdoCn2xVpr5/VDXKA=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:msip_labels:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1696215638; v=1; b=mttkQF8tPxCB48vdqeopBCTSxku2vcuHKKcPMMo0tIqVy/hqrFS1AuByzr+hHigna31rYnCq Wwiu2S+YhczQQPlbAa56751yZxygC1H7gZU2q71wXw8jUpMWeJ7zTCOTGDP2W6Wv47FJwI/NVqV A9/Rn/KXzhLodlF00bO18Yk8= X-Received: by 127.0.0.2 with SMTP id EKkPYY7687511x5YCzmbeIQs; Sun, 01 Oct 2023 20:00:38 -0700 X-Received: from NAM02-BN1-obe.outbound.protection.outlook.com (NAM02-BN1-obe.outbound.protection.outlook.com [40.107.212.56]) by mx.groups.io with SMTP id smtpd.web11.74083.1696215638016064683 for ; Sun, 01 Oct 2023 20:00:38 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=g76nNACghE32MgqvEKvHPmMGPb1XLvIv2mfFWc4YlxoEFa5wbFvcuZ/RyFVnSdj7YpLRou3rABQros5Zng4vLQx/J/D3y3Z+jkSsRkOdtInd4eJscSd44DvJ78tqwADlaSfO38jTOwZ3Ng2gtOGcjwy+WEZCQnQnmGKnJt0nBgkMalipeGubiu4JahlBVTMPwJ6yRcNEvNzi8PMtY7DzMqQR2Rzh1nGU855KeCOvgYXEZKCrjA8yMBtaH0VcfjgnqfrtoleMMN8mzdjZ3Ouaca6tX5TMEuzaw4/Kz323EN5mmSdn93bkRGm4/K9qBPyZSmAJxdNIniEM3v4DW3PC+Q== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=RwfszQbxyczUMKhhZuDE9mK4q2Xy9kbDNHo3Yg2yoWU=; b=TVjtQoAJdxaGCGbnbiTwjCZAdG2SH93SNjiDy79t6t90ZEWVie9BJkXbJieGpu60DqMwXMnd3kwKCpQISPYcwLEP0G+RHeVRJHXyDY7JN3Kdo3yXTjBsFHWgKsx30JT7KI7muyWZJl6j8TcskNk/gGmk2I14pfX8ZFq2UbTkeyWRw9iSI8d0LeKIhq+wAM3imSQzT01uvdtO3/ofcWtOBvyr/kyukgF9cDRpRBl6ErSqcs/wht3mNmhjAUquzPHZp+dX1uL3T7ThyHmrO4HwL/MlqIDSDPXsNFkLul6DMNctjrm1h0ArK3O+LU6y+gdVrxfPUSazlYtoH6qdCCjvgw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none X-Received: from MN2PR12MB3966.namprd12.prod.outlook.com (2603:10b6:208:165::18) by DM6PR12MB5518.namprd12.prod.outlook.com (2603:10b6:5:1b9::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.30; Mon, 2 Oct 2023 03:00:35 +0000 X-Received: from MN2PR12MB3966.namprd12.prod.outlook.com ([fe80::2061:ca33:b659:2c02]) by MN2PR12MB3966.namprd12.prod.outlook.com ([fe80::2061:ca33:b659:2c02%5]) with mapi id 15.20.6838.029; Mon, 2 Oct 2023 03:00:35 +0000 From: "Chang, Abner via groups.io" To: Mike Maslenkin , "devel@edk2.groups.io" CC: "nicklew@nvidia.com" , "igork@ami.com" Subject: Re: [edk2-devel] [PATCH 5/9] RedfishClientPkg: reduce identation level by adding early return Thread-Topic: [PATCH 5/9] RedfishClientPkg: reduce identation level by adding early return Thread-Index: AQHZ8yA4niDwluvgbUek+G/9o1yxLbA10gxw Date: Mon, 2 Oct 2023 03:00:34 +0000 Message-ID: References: <20230929215915.46616-1-mike.maslenkin@gmail.com> <20230929215915.46616-6-mike.maslenkin@gmail.com> In-Reply-To: <20230929215915.46616-6-mike.maslenkin@gmail.com> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ActionId=5cdc219f-bbed-4cb5-99bb-0a723df84b85;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ContentBits=0;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Enabled=true;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Method=Standard;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Name=General;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SetDate=2023-10-02T02:57:16Z;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MN2PR12MB3966:EE_|DM6PR12MB5518:EE_ x-ms-office365-filtering-correlation-id: 5eda537f-a021-40a6-3cb5-08dbc2f3bf95 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: O4Oi4vfsFaZ02xmxkucqZQkV4ZZql7y6lf0GszEtPySD7M1WZoEBOEp56t4XZU1P3/X521tW7OONazJUujrjRyaUKGwgVc0aIJDQ1XToUsxX9425SVl85XC/0KOV8MlZtof3TG7DTaBPLarofMyNj5TJ3fyEpH+iuA5xoS8OnJdtAGxrlIa+mnhAJ8Qh3ohLZqp8Sz88rbbDMfHjxH+pcpAXVBod8nb9X/rmL3dc6E/n9yykEK9rQnVGZUAKnc6rO3UDt3/6Jg3xdfvlXhiReMg2HU37xflDZyDmHwFQGfpTh8afs+MVvwhZPr8Y0CPKCpFB/on3WVdAKDfdEzHv08iNArZk1d6Z9LiitxXNPC4g/HMRW18HB9kS7AiuPpHDVT3h0+V7T8OOYbxB9YwXIxm3kzv6XizdOnN4I0Em6SDz8UYY/QCSOIubI1Vy0iU2yuP6sU8cApXQEv+nnb0IeevxP8Q/Jq3pgMcwqHFouIiC8sZHLz0IaWVcoIcgRN0gKMmSmovCNxc4az8Zpw7bzDdggEZlIea8ou2T+iHgKLTjHSHNfqCGMBlJfX9gYy5EnseQ/lCAQnrK0617RJDkJVg7MM0j6hoFMBWxj83Lvoe8YjztTcziZ3icBUmwAFze x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?q+D0RICyns+IWpDgFZ/zyEsS+QHGeCmYnGzF8gVSY3HYgWeL4lPXHFvrhEPj?= =?us-ascii?Q?W90iJI7C0dFWd84s/nBnmjmz/PchdoZsvN1BE22sY6/g9+3JfraowTCorPJg?= =?us-ascii?Q?wL4SmCfiJbYaG1+9ZUjqk+EgCoXEPUo8J5OdP0oqGuztH/11+k4KMS8Dhhon?= =?us-ascii?Q?e9sx5NUY119fkq2QFLSn2HHXaTRlYTbh/jBmFVTBrYYeNedTC9OA1x9BIONO?= =?us-ascii?Q?eGb+ImskiH6beHs5o2/Yh+MqMxU9IjWY6b1d4U73Km+3cYHFpUqgDZ5UbD7T?= =?us-ascii?Q?qTJkPsN9JtCgkCKTgeKpTjDXJeZFWFBWNjzyE6ZOIkq4kcbApwTHe7r1/r0h?= =?us-ascii?Q?Ao0KQMsOvOIynEtauW2Iq4z71pZcsaO3DUZowvN7Ulgv9O5WDsy3wOkGaBFM?= =?us-ascii?Q?hjKYbjCoG57RYlbubvWOui2H58C65QK/WnooKcf9Sj1hp84CktHN3wVCnbpU?= =?us-ascii?Q?eJwUhXEpr5XSFtQsqM3rrWeBVVBLXft/SfdbwlE6+2M0QW8AZqnKEBhvXrUe?= =?us-ascii?Q?CKWPFKdt4yZ5APag+JMNkyCEGfPRuL8/r+i6s4kbay8jKFn6y/wAhAwfjH+2?= =?us-ascii?Q?196J5F40OCySYQkBz7yIucDhI217rRhIvdxrSGbdRsLZM742tRLUR+8Uby4x?= =?us-ascii?Q?L+b07IelvKt43bN776Nx0XfxFjhezXadV8jT8zgHCwqydWOBLtaR/2gLCqa5?= =?us-ascii?Q?OSKFi4L0r0ULxUpU5z944LQndmXcuQedDRoPr5wLCU/piy6WWuv1Y1XYKmez?= =?us-ascii?Q?Xm4R4FzF+L9l9czztQxDKVS+h2E2PdBuIcBalKCkj+j3hYuEL27rO9K1YBah?= =?us-ascii?Q?G4TeKqXCCOy++IU8uVaNmQKCFzAnfoQh+zJweHqrNCjlXPphM0FoumQQSl6U?= =?us-ascii?Q?r1b+Rx/6ZgsFlkj6BHJAKzbbke7OT+vClV4nbL88lpFJYbG2S23kRZoGX/Ni?= =?us-ascii?Q?tvROUeo1tlHsXxBA6qJcCNp6NQZMDTZMUrR5dwQWXTXz49pZyFTLZoYjY15O?= =?us-ascii?Q?SzNvaP1DWAZi4RhC0D/mutpAXQltfwbnQmLWoiMoA830QsXxgC6asWFWb2OB?= =?us-ascii?Q?dcZWxSp128xytVylYXGgDNrxnXgsLTrNRaEsInUK/7ddjpIKjWSfTDXs2wv0?= =?us-ascii?Q?IEazY3xGK6R4Xo7wlG9w20JQNWG9Hoe51sHOksIzden5a7BFeQPHMpc6LtNJ?= =?us-ascii?Q?VbkSugBX2ebYXeluGdSMoFMEPv36JbBJE4hhBj5VYiUlggAQbz2S5faxH4gB?= =?us-ascii?Q?ngdZwqlyAnAH8XGLeIEUq/t2tV8y6+WE6WwvOW2wmH47UCBByIsTKcGecWzs?= =?us-ascii?Q?EIf/g0KQfjiH8H1UMmoqfSsMIq5OVvOCEN+3m/kkNIQ06VshkhxLKByggQTJ?= =?us-ascii?Q?MwH3VuZuDQGYd+LUlVP9/iUGVSXS0w2tyJ4isSf9u+7U1eAEyxZ7OD2vr0uK?= =?us-ascii?Q?ymcIEW+YE9kQe9lW+IQ7xzU9/zoeOtwbcyTAy/HBp8vkrlycaACV+wS7llZb?= =?us-ascii?Q?y0jD5Nvq807H1TiEX1ZFt0NRr6GD9IqZOakXdCNJJc0NfIqggsYsCLBSNyE8?= =?us-ascii?Q?jPoBols35dJ55R1wJMs=3D?= MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MN2PR12MB3966.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5eda537f-a021-40a6-3cb5-08dbc2f3bf95 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Oct 2023 03:00:34.9987 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: cNmEd3NC7iBY6JCqBAkwYAs4PRBeIdiCJM0vTf6ygWQeio5ULeQnOByM0R54202+6qzRJKG4z7ZlVrSszDKzgQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB5518 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,abner.chang@amd.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: KalGqVUiVxRBJ3k2vPNs7niHx7686176AA= Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=mttkQF8t; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}"); dmarc=none; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io [AMD Official Use Only - General] Hi Mike, I can't apply the entire patch set from either outlook or Group.io. The for= mat of patch on both are looked weird. I can still review the short ones, b= ut the change of 5/9 is a bit long one. Could you please check the patch fo= rmat and resend 5/9? Thank you. Abner > -----Original Message----- > From: Mike Maslenkin > Sent: Saturday, September 30, 2023 5:59 AM > To: devel@edk2.groups.io > Cc: Chang, Abner ; nicklew@nvidia.com; > igork@ami.com; Mike Maslenkin > Subject: [PATCH 5/9] RedfishClientPkg: reduce identation level by adding = early > return > > Caution: This message originated from an External Source. Use proper caut= ion > when opening attachments, clicking links, or responding. > > > This functions contain memory leaks. > Less identation helps to solve this issues. > > Signed-off-by: Mike Maslenkin > --- > .../RedfishFeatureUtilityLib.c | 289 +++++++++--------- > 1 file changed, 146 insertions(+), 143 deletions(-) > > diff --git > a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtility= Lib. > c > b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtility= Lib. > c > index 8fa1dc2c3535..0941f33fd73a 100644 > --- > a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtility= Lib. > c > +++ > b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtility= Lib. > c > @@ -763,68 +763,69 @@ ApplyFeatureSettingsStringArrayType ( > Status =3D RedfishPlatformConfigGetValue (Schema, Version, ConfigureLa= ng, > &RedfishValue); > > if (EFI_ERROR (Status)) { > > DEBUG ((DEBUG_ERROR, "%a, %a.%a %s failed: %r\n", __func__, Schema, > Version, ConfigureLang, Status)); > > - } else { > > - if (RedfishValue.Type !=3D RedfishValueTypeStringArray) { > > - DEBUG ((DEBUG_ERROR, "%a, %a.%a %s value is not string array type\= n", > __func__, Schema, Version, ConfigureLang)); > > - return EFI_DEVICE_ERROR; > > - } > > + return Status; > > + } > > + > > + if (RedfishValue.Type !=3D RedfishValueTypeStringArray) { > > + DEBUG ((DEBUG_ERROR, "%a, %a.%a %s value is not string array type\n"= , > __func__, Schema, Version, ConfigureLang)); > > + return EFI_DEVICE_ERROR; > > + } > > > > + // > > + // If there is no change in array, do nothing > > + // > > + if (!CompareRedfishStringArrayValues (ArrayHead, > RedfishValue.Value.StringArray, RedfishValue.ArrayCount)) { > > // > > - // If there is no change in array, do nothing > > + // Apply settings from redfish > > // > > - if (!CompareRedfishStringArrayValues (ArrayHead, > RedfishValue.Value.StringArray, RedfishValue.ArrayCount)) { > > - // > > - // Apply settings from redfish > > - // > > - DEBUG ((DEBUG_MANAGEABILITY, "%a, %a.%a apply %s for array\n", > __func__, Schema, Version, ConfigureLang)); > > - FreeArrayTypeRedfishValue (&RedfishValue); > > + DEBUG ((DEBUG_MANAGEABILITY, "%a, %a.%a apply %s for array\n", > __func__, Schema, Version, ConfigureLang)); > > + FreeArrayTypeRedfishValue (&RedfishValue); > > > > - // > > - // Convert array from RedfishCS_char_Array to EDKII_REDFISH_VALUE > > - // > > - RedfishValue.ArrayCount =3D 0; > > - Buffer =3D ArrayHead; > > - while (Buffer !=3D NULL) { > > - RedfishValue.ArrayCount +=3D 1; > > - Buffer =3D Buffer->Next; > > - } > > + // > > + // Convert array from RedfishCS_char_Array to EDKII_REDFISH_VALUE > > + // > > + RedfishValue.ArrayCount =3D 0; > > + Buffer =3D ArrayHead; > > + while (Buffer !=3D NULL) { > > + RedfishValue.ArrayCount +=3D 1; > > + Buffer =3D Buffer->Next; > > + } > > > > - // > > - // Allocate pool for new values > > - // > > - RedfishValue.Value.StringArray =3D AllocatePool (RedfishValue.Arra= yCount > *sizeof (CHAR8 *)); > > - if (RedfishValue.Value.StringArray =3D=3D NULL) { > > + // > > + // Allocate pool for new values > > + // > > + RedfishValue.Value.StringArray =3D AllocatePool (RedfishValue.ArrayC= ount > *sizeof (CHAR8 *)); > > + if (RedfishValue.Value.StringArray =3D=3D NULL) { > > + ASSERT (FALSE); > > + return EFI_OUT_OF_RESOURCES; > > + } > > + > > + Buffer =3D ArrayHead; > > + Index =3D 0; > > + while (Buffer !=3D NULL) { > > + RedfishValue.Value.StringArray[Index] =3D AllocateCopyPool (AsciiS= trSize > (Buffer->ArrayValue), Buffer->ArrayValue); > > + if (RedfishValue.Value.StringArray[Index] =3D=3D NULL) { > > ASSERT (FALSE); > > return EFI_OUT_OF_RESOURCES; > > } > > > > - Buffer =3D ArrayHead; > > - Index =3D 0; > > - while (Buffer !=3D NULL) { > > - RedfishValue.Value.StringArray[Index] =3D AllocateCopyPool (Asci= iStrSize > (Buffer->ArrayValue), Buffer->ArrayValue); > > - if (RedfishValue.Value.StringArray[Index] =3D=3D NULL) { > > - ASSERT (FALSE); > > - return EFI_OUT_OF_RESOURCES; > > - } > > - > > - Buffer =3D Buffer->Next; > > - Index++; > > - } > > + Buffer =3D Buffer->Next; > > + Index++; > > + } > > > > - ASSERT (Index <=3D RedfishValue.ArrayCount); > > + ASSERT (Index <=3D RedfishValue.ArrayCount); > > > > - Status =3D RedfishPlatformConfigSetValue (Schema, Version, Configu= reLang, > RedfishValue); > > - if (!EFI_ERROR (Status)) { > > - // > > - // Configuration changed. Enable system reboot flag. > > - // > > - REDFISH_ENABLE_SYSTEM_REBOOT (); > > - } else { > > - DEBUG ((DEBUG_ERROR, "%a, apply %s array failed: %r\n", __func__= , > ConfigureLang, Status)); > > - } > > + Status =3D RedfishPlatformConfigSetValue (Schema, Version, Configure= Lang, > RedfishValue); > > + if (!EFI_ERROR (Status)) { > > + // > > + // Configuration changed. Enable system reboot flag. > > + // > > + REDFISH_ENABLE_SYSTEM_REBOOT (); > > } else { > > - DEBUG ((DEBUG_ERROR, "%a, %a.%a %s array value has no change\n", > __func__, Schema, Version, ConfigureLang)); > > + DEBUG ((DEBUG_ERROR, "%a, apply %s array failed: %r\n", __func__, > ConfigureLang, Status)); > > } > > + } else { > > + DEBUG ((DEBUG_ERROR, "%a, %a.%a %s array value has no change\n", > __func__, Schema, Version, ConfigureLang)); > > } > > > > return Status; > > @@ -866,63 +867,64 @@ ApplyFeatureSettingsNumericArrayType ( > Status =3D RedfishPlatformConfigGetValue (Schema, Version, ConfigureLa= ng, > &RedfishValue); > > if (EFI_ERROR (Status)) { > > DEBUG ((DEBUG_ERROR, "%a, %a.%a %s failed: %r\n", __func__, Schema, > Version, ConfigureLang, Status)); > > - } else { > > - if (RedfishValue.Type !=3D RedfishValueTypeIntegerArray) { > > - DEBUG ((DEBUG_ERROR, "%a, %a.%a %s value is not string array type\= n", > __func__, Schema, Version, ConfigureLang)); > > - return EFI_DEVICE_ERROR; > > - } > > + return Status; > > + } > > + > > + if (RedfishValue.Type !=3D RedfishValueTypeIntegerArray) { > > + DEBUG ((DEBUG_ERROR, "%a, %a.%a %s value is not string array type\n"= , > __func__, Schema, Version, ConfigureLang)); > > + return EFI_DEVICE_ERROR; > > + } > > > > + // > > + // If there is no change in array, do nothing > > + // > > + if (!CompareRedfishNumericArrayValues (ArrayHead, > RedfishValue.Value.IntegerArray, RedfishValue.ArrayCount)) { > > // > > - // If there is no change in array, do nothing > > + // Apply settings from redfish > > // > > - if (!CompareRedfishNumericArrayValues (ArrayHead, > RedfishValue.Value.IntegerArray, RedfishValue.ArrayCount)) { > > - // > > - // Apply settings from redfish > > - // > > - DEBUG ((DEBUG_MANAGEABILITY, "%a, %a.%a apply %s for array\n", > __func__, Schema, Version, ConfigureLang)); > > - FreeArrayTypeRedfishValue (&RedfishValue); > > + DEBUG ((DEBUG_MANAGEABILITY, "%a, %a.%a apply %s for array\n", > __func__, Schema, Version, ConfigureLang)); > > + FreeArrayTypeRedfishValue (&RedfishValue); > > > > - // > > - // Convert array from RedfishCS_int64_Array to EDKII_REDFISH_VALUE > > - // > > - RedfishValue.ArrayCount =3D 0; > > - Buffer =3D ArrayHead; > > - while (Buffer !=3D NULL) { > > - RedfishValue.ArrayCount +=3D 1; > > - Buffer =3D Buffer->Next; > > - } > > + // > > + // Convert array from RedfishCS_int64_Array to EDKII_REDFISH_VALUE > > + // > > + RedfishValue.ArrayCount =3D 0; > > + Buffer =3D ArrayHead; > > + while (Buffer !=3D NULL) { > > + RedfishValue.ArrayCount +=3D 1; > > + Buffer =3D Buffer->Next; > > + } > > > > - // > > - // Allocate pool for new values > > - // > > - RedfishValue.Value.IntegerArray =3D AllocatePool (RedfishValue.Arr= ayCount > * sizeof (INT64)); > > - if (RedfishValue.Value.IntegerArray =3D=3D NULL) { > > - ASSERT (FALSE); > > - return EFI_OUT_OF_RESOURCES; > > - } > > + // > > + // Allocate pool for new values > > + // > > + RedfishValue.Value.IntegerArray =3D AllocatePool (RedfishValue.Array= Count * > sizeof (INT64)); > > + if (RedfishValue.Value.IntegerArray =3D=3D NULL) { > > + ASSERT (FALSE); > > + return EFI_OUT_OF_RESOURCES; > > + } > > > > - Buffer =3D ArrayHead; > > - Index =3D 0; > > - while (Buffer !=3D NULL) { > > - RedfishValue.Value.IntegerArray[Index] =3D (INT64)*Buffer->Array= Value; > > - Buffer =3D Buffer->Next; > > - Index++; > > - } > > + Buffer =3D ArrayHead; > > + Index =3D 0; > > + while (Buffer !=3D NULL) { > > + RedfishValue.Value.IntegerArray[Index] =3D (INT64)*Buffer->ArrayVa= lue; > > + Buffer =3D Buffer->Next; > > + Index++; > > + } > > > > - ASSERT (Index <=3D RedfishValue.ArrayCount); > > + ASSERT (Index <=3D RedfishValue.ArrayCount); > > > > - Status =3D RedfishPlatformConfigSetValue (Schema, Version, Configu= reLang, > RedfishValue); > > - if (!EFI_ERROR (Status)) { > > - // > > - // Configuration changed. Enable system reboot flag. > > - // > > - REDFISH_ENABLE_SYSTEM_REBOOT (); > > - } else { > > - DEBUG ((DEBUG_ERROR, "%a, apply %s array failed: %r\n", __func__= , > ConfigureLang, Status)); > > - } > > + Status =3D RedfishPlatformConfigSetValue (Schema, Version, Configure= Lang, > RedfishValue); > > + if (!EFI_ERROR (Status)) { > > + // > > + // Configuration changed. Enable system reboot flag. > > + // > > + REDFISH_ENABLE_SYSTEM_REBOOT (); > > } else { > > - DEBUG ((DEBUG_ERROR, "%a, %a.%a %s array value has no change\n", > __func__, Schema, Version, ConfigureLang)); > > + DEBUG ((DEBUG_ERROR, "%a, apply %s array failed: %r\n", __func__, > ConfigureLang, Status)); > > } > > + } else { > > + DEBUG ((DEBUG_ERROR, "%a, %a.%a %s array value has no change\n", > __func__, Schema, Version, ConfigureLang)); > > } > > > > return Status; > > @@ -964,63 +966,64 @@ ApplyFeatureSettingsBooleanArrayType ( > Status =3D RedfishPlatformConfigGetValue (Schema, Version, ConfigureLa= ng, > &RedfishValue); > > if (EFI_ERROR (Status)) { > > DEBUG ((DEBUG_ERROR, "%a, %a.%a %s failed: %r\n", __func__, Schema, > Version, ConfigureLang, Status)); > > - } else { > > - if (RedfishValue.Type !=3D RedfishValueTypeBooleanArray) { > > - DEBUG ((DEBUG_ERROR, "%a, %a.%a %s value is not string array type\= n", > __func__, Schema, Version, ConfigureLang)); > > - return EFI_DEVICE_ERROR; > > - } > > + return Status; > > + } > > + > > + if (RedfishValue.Type !=3D RedfishValueTypeBooleanArray) { > > + DEBUG ((DEBUG_ERROR, "%a, %a.%a %s value is not string array type\n"= , > __func__, Schema, Version, ConfigureLang)); > > + return EFI_DEVICE_ERROR; > > + } > > > > + // > > + // If there is no change in array, do nothing > > + // > > + if (!CompareRedfishBooleanArrayValues (ArrayHead, > RedfishValue.Value.BooleanArray, RedfishValue.ArrayCount)) { > > // > > - // If there is no change in array, do nothing > > + // Apply settings from redfish > > // > > - if (!CompareRedfishBooleanArrayValues (ArrayHead, > RedfishValue.Value.BooleanArray, RedfishValue.ArrayCount)) { > > - // > > - // Apply settings from redfish > > - // > > - DEBUG ((DEBUG_MANAGEABILITY, "%a, %a.%a apply %s for array\n", > __func__, Schema, Version, ConfigureLang)); > > - FreeArrayTypeRedfishValue (&RedfishValue); > > + DEBUG ((DEBUG_MANAGEABILITY, "%a, %a.%a apply %s for array\n", > __func__, Schema, Version, ConfigureLang)); > > + FreeArrayTypeRedfishValue (&RedfishValue); > > > > - // > > - // Convert array from RedfishCS_int64_Array to EDKII_REDFISH_VALUE > > - // > > - RedfishValue.ArrayCount =3D 0; > > - Buffer =3D ArrayHead; > > - while (Buffer !=3D NULL) { > > - RedfishValue.ArrayCount +=3D 1; > > - Buffer =3D Buffer->Next; > > - } > > + // > > + // Convert array from RedfishCS_int64_Array to EDKII_REDFISH_VALUE > > + // > > + RedfishValue.ArrayCount =3D 0; > > + Buffer =3D ArrayHead; > > + while (Buffer !=3D NULL) { > > + RedfishValue.ArrayCount +=3D 1; > > + Buffer =3D Buffer->Next; > > + } > > > > - // > > - // Allocate pool for new values > > - // > > - RedfishValue.Value.BooleanArray =3D AllocatePool (RedfishValue.Arr= ayCount > * sizeof (BOOLEAN)); > > - if (RedfishValue.Value.BooleanArray =3D=3D NULL) { > > - ASSERT (FALSE); > > - return EFI_OUT_OF_RESOURCES; > > - } > > + // > > + // Allocate pool for new values > > + // > > + RedfishValue.Value.BooleanArray =3D AllocatePool (RedfishValue.Array= Count > * sizeof (BOOLEAN)); > > + if (RedfishValue.Value.BooleanArray =3D=3D NULL) { > > + ASSERT (FALSE); > > + return EFI_OUT_OF_RESOURCES; > > + } > > > > - Buffer =3D ArrayHead; > > - Index =3D 0; > > - while (Buffer !=3D NULL) { > > - RedfishValue.Value.BooleanArray[Index] =3D (BOOLEAN)*Buffer- > >ArrayValue; > > - Buffer =3D Buffer->Next; > > - Index++; > > - } > > + Buffer =3D ArrayHead; > > + Index =3D 0; > > + while (Buffer !=3D NULL) { > > + RedfishValue.Value.BooleanArray[Index] =3D (BOOLEAN)*Buffer- > >ArrayValue; > > + Buffer =3D Buffer->Next; > > + Index++; > > + } > > > > - ASSERT (Index <=3D RedfishValue.ArrayCount); > > + ASSERT (Index <=3D RedfishValue.ArrayCount); > > > > - Status =3D RedfishPlatformConfigSetValue (Schema, Version, Configu= reLang, > RedfishValue); > > - if (!EFI_ERROR (Status)) { > > - // > > - // Configuration changed. Enable system reboot flag. > > - // > > - REDFISH_ENABLE_SYSTEM_REBOOT (); > > - } else { > > - DEBUG ((DEBUG_ERROR, "%a, apply %s array failed: %r\n", __func__= , > ConfigureLang, Status)); > > - } > > + Status =3D RedfishPlatformConfigSetValue (Schema, Version, Configure= Lang, > RedfishValue); > > + if (!EFI_ERROR (Status)) { > > + // > > + // Configuration changed. Enable system reboot flag. > > + // > > + REDFISH_ENABLE_SYSTEM_REBOOT (); > > } else { > > - DEBUG ((DEBUG_ERROR, "%a, %a.%a %s array value has no change\n", > __func__, Schema, Version, ConfigureLang)); > > + DEBUG ((DEBUG_ERROR, "%a, apply %s array failed: %r\n", __func__, > ConfigureLang, Status)); > > } > > + } else { > > + DEBUG ((DEBUG_ERROR, "%a, %a.%a %s array value has no change\n", > __func__, Schema, Version, ConfigureLang)); > > } > > > > return Status; > > -- > 2.32.0 (Apple Git-132) -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#109250): https://edk2.groups.io/g/devel/message/109250 Mute This Topic: https://groups.io/mt/101667464/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-