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 EE90F941040 for ; Mon, 2 Oct 2023 03:09:42 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=S5jiGxvJLPDfrVmukd2aM+6KmaZk6QSEClgP+Y4BFSY=; 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=1696216181; v=1; b=JUwbzekCL6O9CVE9RiJTsw+vw+FilOKn/E+EQ9Miu5bn56v4TvLwU5SGKVZOYGzIhbOo302R 3M7TAwdxIB2LB1v9XmxkbUZeY2853yf765DfGjRuOtuF/Id2gS94YTSm4kMNql9WvS3PftmrijM nCWIzyrL/vMV1wF1jV4Fc9tE= X-Received: by 127.0.0.2 with SMTP id CNI6YY7687511xhcUXTbg8vQ; Sun, 01 Oct 2023 20:09:41 -0700 X-Received: from NAM02-BN1-obe.outbound.protection.outlook.com (NAM02-BN1-obe.outbound.protection.outlook.com [40.107.212.86]) by mx.groups.io with SMTP id smtpd.web11.74171.1696216180341857321 for ; Sun, 01 Oct 2023 20:09:40 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dIXx7IXVxiHtMbkYLSt3EYdHsbVaP2SK4kNjllqm1XfWTFNT/TbYSS07Xk2ZmChIuhC6kVxTzMTObkIQcK7pjp3mgXqasmOm86/T0NidDuZN0Zpz5azZ63lJP68+XQqoe3hUG2BktjQwigTVByGnA5/wobT61PsjwZwJAWlXhikT+hNM9+G2gCX7Czn6j55Q3bAP4k24mVSLbeU4Lbfw2/tZCy2e+RZu/yVrvluOCyFTee1BUKy6Flx0mK9L15Q33H+MukLui0nQT9gp3XISkkzCKS3exqdJRftp6NfOcG6mwaJB44FzyNQTOx/cZfHs8g72eNrjOmaOeNKoJrskJw== 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=/cd4wbEsvAz2ihe0gHd0AvkwlYxO/ukZ+tDikL/x3Iw=; b=Eau9d8JmJ8HbXOREO4MsCK9V0TuINCV7J1097ES+TFrtOW+xEPiv7re6FlOXRwH4vxMpWIATFpHbU/cXubUyuHN1BK2tFAxFXq/OjFP+VEM3GxJcEPgHlqKs0l8IdnWi/5QBfxk26ISB9+zunS0MdHxTiZZbNP+PxJX/VY75sVY5lc91VIO/Qs3+sSzZze1mWOztbJWPonD1ZkUR/MrnQ68S4eIl2Avz6mgxzLI7B63tMnj4tYo8ClUEZ86BJbfwY9B0WNGKL9FyeVSNDJK7SPm0ghOKtnKrhRmbrU3MSXPj8khUk5gUMKVIMtFxvgbk7kOFNfvK02xg49XV1O4ZLQ== 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 PH7PR12MB6667.namprd12.prod.outlook.com (2603:10b6:510:1a9::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.26; Mon, 2 Oct 2023 03:09:37 +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:09:37 +0000 From: "Chang, Abner via groups.io" To: Mike Maslenkin , "devel@edk2.groups.io" , "nicklew@nvidia.com" CC: "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/9o1yxLbA10gxwgAAC8LA= Date: Mon, 2 Oct 2023 03:09:37 +0000 Message-ID: References: <20230929215915.46616-1-mike.maslenkin@gmail.com> <20230929215915.46616-6-mike.maslenkin@gmail.com> In-Reply-To: Accept-Language: en-US, zh-CN X-Mentions: nicklew@nvidia.com 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_|PH7PR12MB6667:EE_ x-ms-office365-filtering-correlation-id: 87ab70ed-303a-4c9b-8f7d-08dbc2f502e3 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: ywRNX5/fyTmIFuirLnFD2lkyL8IFBX2MP6skuoRyCRsxj+z3vehSnNcRh8xBVXzN/B/YsZM6jl65+dc37uM0um2OS14/ps9tTP5jy+AptY1kJsyHrBm/hLGH+nw7Fz+Vuf5Q9DDXD1JSCPIRfV3sUMtyB/5E5mxyoi0gzY/iypaCN3u49KnkEhF5z4n4ojbZoixd2RVul5Gqjyoqu+onOStXqHWbapYFoHSbee2ATQbPxf7zr2EH3BbSoS6aHikBXQ2I7GsD1gYeb5tYLEnxM/hESeJtmsqGg3TBynjp0kNkVyUC0fj3IR87oBOoT5UNiEVP7nyYDLgCKNvOOdETEII4TS6tkd+SmnzGTHXzjwVjj2lBy2VpqyREpB0kZsFWQcy9xcTkkaRKWf7B0LzMFLyENeb1lI3NRS0ONsblB1v4Oa2M9VZu75KeOC5zd0GSjO9GCLkF2CROAjkdSbbjg2nI8nBF5XNOzT6hZXDzfUHNAazAxi8U4dVNWPV/I/HwedH+ls30BjQ5KKxwGV83JXrR+iOrRwPpu4TfglBS9RiGn4upP7w2Pr/CHKz4nUXUCvHaTAwcnO22q5HuuX4CI49xZ6qg80zLmxxks6ap9jEZlS9diwjEM6LUCPM3fhqp x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?ozWLWuTf9erywYT1XzUCieZhIy0r7p10Z4DXaEnRYWqLJ/FiPiPL3aregXcI?= =?us-ascii?Q?bI8fRz8Rk2daievBstNLD+wyVqoXqu/opu55QmP7dfJIgcKcgC3V34jt/280?= =?us-ascii?Q?H23UICq+Thi7oWnqBw09wfTdb8Bj3w+NSJ8yAHdxj6b/mw6Blsegf1Nej8FG?= =?us-ascii?Q?VUw3e1Rimht7kDg4HfIxs9Pazq+zvvLslj2sw4G1CZJTj2FMWEYR0d0LKYti?= =?us-ascii?Q?+74B5a+3INVj76w+X13FjeboLs4xCk+omuit5CIT4duxeYdWDC0kM/mfAdZY?= =?us-ascii?Q?FGhrHnGFJ/8ZcMMxLmCFmrP3zMk/fA296BmpbSwECXZ9nJGG0oD3xzS3SDh2?= =?us-ascii?Q?5Y01gOovi9bimMnUCR+3JtZchQJxN+ScTyrfiUOIURMFrjCDL2McwCk7ltba?= =?us-ascii?Q?MvmjRlbZ/RFRo6g2w7YCQucnKVBIUVG1SKINPNHBMccm93HiZhmIyffQNy42?= =?us-ascii?Q?jRwqYVG5mGJ/rEhocHXZ0jJiU5okQwBhTObzuDQIEY4EwwLx5dfSGGS0QGF5?= =?us-ascii?Q?XjGHoNcUHLqulu1Qd1FFQRK1Y7nG0OCfDpGB+PWZefp5vg8nJk9LvhEauZ/+?= =?us-ascii?Q?ZRXNZCDYvlTnpYgmNTwAPlNXWlTjW3f7yZNEi6t5iVxgKhUIjwx7Mh15u6Od?= =?us-ascii?Q?K1baCQ0gBbD8haZ4EXT5IbJ312/r0nk3eCTbQhO7Z1aVaQMk7DB3KuViHG5H?= =?us-ascii?Q?17zotNclRNL3XER39xTaTsBoxl3pus5SxsBqlqpt70EMwMJnuh5/wr+JcbpP?= =?us-ascii?Q?rTUDMphabLACPUG4PlbNx7ifXU6qu1Jo2WbimimZ1Aj7OaOPOBeew7uVNT08?= =?us-ascii?Q?frSW93w/G/JhN1aPUTl8MOKJU9R0fEA+Z3x1UzxjXyLfG8L3UhOA2dL3iY4b?= =?us-ascii?Q?s+uKtgG9sjtLt3g0Osx52WFqrJz1gG7NaIN2ULFkCm+Zk59bDkK8Q901tuZ7?= =?us-ascii?Q?3qGkYcKu2vNMfU3kRgM6aedgdpjsuiFmzBIwkDdK3t5YfZ0Y2GJZjusH/d7F?= =?us-ascii?Q?V++WPX/aGHk36WKFncBByD6dQQRXb3N2dDbaqA6qnn2WmK1f8TTAru9UzUSh?= =?us-ascii?Q?59ZCcFSI7kf6zBePgola4djxNawsjq7swAbjcEUzQyWmLw97gZosDrgndYDY?= =?us-ascii?Q?AoqJ7IkfI/Ggn7OrTwu4D8f4nXHsvE/5BxMtP+Zpi+ieFTal4BVNvgZZDgbu?= =?us-ascii?Q?8gzCpWaLalu+Herqbp5uTPsw0vt9Uv3bPU6SX3DJbMayBfNjgGsLMYmtKtOL?= =?us-ascii?Q?Z+JZH7BiMOxTmgPVyodPGlIK132+nzNfQoGhADvKG5JXjeOcRTtwlQkUDPwU?= =?us-ascii?Q?lplIV6tXBGbAvrsCc1Zgcil0Ol5NlS+aeppY7iOFOi+2oYcmfSIV276V1Ugv?= =?us-ascii?Q?IpoFYFwKXKO/9QiGIIGWbaZkad6HIsCvqfdo4mv0+qwOEJd9FtIEjqzTnY3V?= =?us-ascii?Q?HxeuKKe9lw6cjCw24Xu2aL+TzoZdHPnGeceQPO1tPYrd5DVtV8U1tyquHdIM?= =?us-ascii?Q?vq5e3a526S+r8qhALHSTFzJ5mIiutQWWEJLyPMp24l3Swax6Zi75MyCHMeIo?= =?us-ascii?Q?y8q9MvEbN+P8qdj5LyCcfl4HQL2KWZvjJPDBRovq?= 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: 87ab70ed-303a-4c9b-8f7d-08dbc2f502e3 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Oct 2023 03:09:37.4036 (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: icMVkNrQJsrIlwAalcAmpyFPb2eEG647G2n9/d/kP2wZKVtRSlKBA3sx0iasdEFA5/s5de4RzSptOfEgzv4/2g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB6667 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: dCsQUz3FwezVPyqlfsnJvyvJx7686176AA= 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=JUwbzekC; 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] Never mind, I see you had created a PR for this. However, we need @nicklew@= nvidia.com to check if the code logic is kept the same with this change. Thank you for helping on this package, Mike. Abner > -----Original Message----- > From: Chang, Abner > Sent: Monday, October 2, 2023 11:01 AM > To: Mike Maslenkin ; devel@edk2.groups.io > Cc: nicklew@nvidia.com; igork@ami.com > Subject: RE: [PATCH 5/9] RedfishClientPkg: reduce identation level by add= ing > early return > > Hi Mike, > I can't apply the entire patch set from either outlook or Group.io. The f= ormat > of patch on both are looked weird. I can still review the short ones, but= the > change of 5/9 is a bit long one. Could you please check the patch format = 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 addin= g > early > > return > > > > Caution: This message originated from an External Source. Use proper > caution > > 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, Configure= Lang, > > &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_VALU= E > > > > - // > > > > - 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.Ar= rayCount > > *sizeof (CHAR8 *)); > > > > - if (RedfishValue.Value.StringArray =3D=3D NULL) { > > > > + // > > > > + // Allocate pool for new values > > > > + // > > > > + RedfishValue.Value.StringArray =3D AllocatePool (RedfishValue.Arra= yCount > > *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 (Asci= iStrSize > > (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 (As= ciiStrSize > > (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, > ConfigureLang, > > 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, > ConfigureLang, > > 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, Configure= Lang, > > &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_VAL= UE > > > > - // > > > > - 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.ArrayCount > > * 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.Arr= ayCount > * > > 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->Arr= ayValue; > > > > - Buffer =3D Buffer->Next; > > > > - Index++; > > > > - } > > > > + Buffer =3D ArrayHead; > > > > + Index =3D 0; > > > > + while (Buffer !=3D NULL) { > > > > + RedfishValue.Value.IntegerArray[Index] =3D (INT64)*Buffer->Array= Value; > > > > + Buffer =3D Buffer->Next; > > > > + Index++; > > > > + } > > > > > > > > - ASSERT (Index <=3D RedfishValue.ArrayCount); > > > > + ASSERT (Index <=3D RedfishValue.ArrayCount); > > > > > > > > - Status =3D RedfishPlatformConfigSetValue (Schema, Version, > ConfigureLang, > > 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, > ConfigureLang, > > 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, Configure= Lang, > > &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_VAL= UE > > > > - // > > > > - 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.ArrayCount > > * 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.ArrayCount > > * 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, > ConfigureLang, > > 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, > ConfigureLang, > > 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 (#109251): https://edk2.groups.io/g/devel/message/109251 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-