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 7EA6BAC06DC for ; Wed, 11 Oct 2023 01:53:35 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=cWmImU0IbkausF9eXTR8clYdpu4NvOGtD3UUXpApa6c=; 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=1696989214; v=1; b=Pidkfgp3lcoz4Q5A++BZwtu4K+OXhqgp2jvpr8z8ooHXAxTnK5YaUdHYQqgrx3zyYJj/1yme MVbIsrpjRD441t8LuF7Q8buK8Ek+bZhF7aQZ0NLxpyHtsUhZSyFeT2HZnM23Y9ItBn9kxtuyNWl 99W4opvQASiQvMCwOUU0I6TE= X-Received: by 127.0.0.2 with SMTP id j7eFYY7687511x1BDKu8YA3u; Tue, 10 Oct 2023 18:53:34 -0700 X-Received: from NAM02-DM3-obe.outbound.protection.outlook.com (NAM02-DM3-obe.outbound.protection.outlook.com [40.107.95.69]) by mx.groups.io with SMTP id smtpd.web11.7856.1696989213415413384 for ; Tue, 10 Oct 2023 18:53:33 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=elt8OFZUcVt5KysraGp4o6iXMpswm9L9+29FP900HdD/5TcdYC8zL5Xn3AXjZVrC3EJKg0lm+gzwy0Cy9Fp5TXdtwO6stT/zK40PTb2x5Gfw3Ii6hLJMi/MAG/+EOMNq6NO2AV8sfnbM2qnZBGCwDbbiiXuM+N0SgRJ97xAdxWPvJ4PMuvxmc/lR1uPkqYICuzGn252W4zLi6ZTVtwW3sOBhou2H5QLGA/9twVtvf0Z6Ya6qBNQ8yixuu9gHcHeA/yeTmetYyyvJjE9Ufpk/2zcJGRc5+3gy5u8iLVCFyL83v8pe3yD96mnVJLgV/iCCFYMZ29OQE1q10QdBch15LQ== 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=rmxIobYhQ1FX7xuOsEDxL3tcXSF6gDzGl7Yg39sHwPc=; b=C2Zdi9eoaSqJG91gSxwI5lC+ImuEg4kuPPG3S6jQwSieOImnALRpE2tKsCmtxu1EMLF3yrR6IqfkqumyeK+f+6SD8VSpVE43X/ed7CfgMHnNhtrUV5Pl9+XSDNo9y3usrRIoxagChT71VgiuVHkoaHVZGDV3RiL0+JDDJHlMocGtYFI9GfHmJuB8eUDdQlikB/CTbBmHVC+xBYaxqKNdKbAMcdnJ8Ad+5vX9XOd/GyoIWIIwqVegRjwrd8xWFlpTa3MnxEiGdodtbVM2riYEE0SPFP03HgA+33pKe+MKqIgZ6KwvCaMjbEh37eCESktRIL/rwFLKIwpCMttBJSbBEQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none X-Received: from MW4PR12MB7031.namprd12.prod.outlook.com (2603:10b6:303:1ef::6) by BL1PR12MB5238.namprd12.prod.outlook.com (2603:10b6:208:31e::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.38; Wed, 11 Oct 2023 01:53:30 +0000 X-Received: from MW4PR12MB7031.namprd12.prod.outlook.com ([fe80::f345:babc:2bc5:bfae]) by MW4PR12MB7031.namprd12.prod.outlook.com ([fe80::f345:babc:2bc5:bfae%4]) with mapi id 15.20.6863.032; Wed, 11 Oct 2023 01:53:30 +0000 From: "Nickle Wang via groups.io" To: "Chang, Abner" , Mike Maslenkin , "devel@edk2.groups.io" 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: AQHZ8yA3noiyr5ptHUOWf9YacRGtYLA10vgAgAACh4CADg83AA== Date: Wed, 11 Oct 2023 01:53:29 +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 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: MW4PR12MB7031:EE_|BL1PR12MB5238:EE_ x-ms-office365-filtering-correlation-id: d42721a4-0d14-4aa9-7540-08dbc9fcde37 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: X36i93ArkaOljBaqu7HDkZlLGLlZ5GlN2gU1QyER8w9mwEDMCBNDAKp3VBkk6oRzu78I/Wgw/MOkDCZUYj5Abzd463EOD8yx/a7VnGPi+SLE16X0rpPxObWTU8T0OjqGpelMguiYNLGLjXWBTYjtoKadpUGWso7+2+b4cEXgRny6cwDv+vAb0ktvxTy2JTOant/WTP+JUGmVcxZ69fizVcR7dMmFhCCUulnoN5HkYl7n+vmRj3W/cTQt+CYvoLdpX7jTvHjpv0QdT00jGqX4gdhDnjIuzAZ8eEepGuOiFO6mHU3xAz2KES5AZAnac4BdgRjeqoXNKyUO+9vrFwLI5jtGbsEapMa4rCsruGlfPF4N6YnAs9Q65MPBEiBeNtAjUg4W2XP8B+guwpqmOxK1EtPHWJxu9xXbEhcDMo2aRrtfDwYs+2MWH+32SmZbMa4cL6i/NQxxJhttP4SYVwvCv9mT+XNfAlPu+QBaB5xnSj5yBP7Pzmpa9wJqaOPJT9X0ttB8r1myCTR6+oljegZ9T/q/aq5nPVQsepzSN6o4JukwIbhay1lCSDSGROGyoRHAIopHqxhhUi38O41c071vGisCG96IgQ/AJfpiYBJi/7zPRqV9sfoMuOKP/cjmkZKW x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?6wjAhIw4CnD0q1+W1tSmndoZQ/99orapf4SlkT48TIu1xvFhweh2k8b4n+SI?= =?us-ascii?Q?BvhbNcrw9ELwtpbXnBrxscfKbsAuEcs718CcthsbSeU/YTWJACJ2Sv0w46b7?= =?us-ascii?Q?d0zbHtVjykOniUOlY0nrrzomYMkhSzfi0Kv01SsbDtVoyvgKJVZlsaiFSqg0?= =?us-ascii?Q?p61v+eYbu/Aqacn1LOdlblzYxXq/AqY0e1jicdkzYfjuyS/67iqy6SD4idZZ?= =?us-ascii?Q?D2j4wk3EUEhFBK2iOzdzuRmbTPFZJ26RRuDfh34MizhTkUYgklCeWp5BXcxz?= =?us-ascii?Q?ah6xrcBcAscfwDyVjPFoIPlXCvD5n52dzpDGTzCXSPEjBwkIgXQdBW5HZOfy?= =?us-ascii?Q?u0fbZAxdOwtS6xKEDqKtq9r5F4l8LVFibbtfdd864yYu2sCZs0F3CE7YOd6R?= =?us-ascii?Q?PCn1NOJLE/G7uVHhsuFUO3b5ZfbmzOS3aRzOw46rPzLFK4d4A1vMrNF+lNDr?= =?us-ascii?Q?NQB8utZOX7mMobsJZpHgN46pqhifXinb5gHU+lqces/rtokHz5jWH5bIW0Xg?= =?us-ascii?Q?JEfDIL2PwHeEMUNF9SQ87+Y38TQREuGpUJUVN654avLtnF1RTfqwFLI4aG44?= =?us-ascii?Q?r3XVZNyxLEsc/1Erk34DeDzQrYOSmZDXq1v8dgZO7/Fn4gh4fwnYxMDGr11o?= =?us-ascii?Q?rfN54ctlQ5Swo/Ggal1X7mb+limpWa0PN2hBoNCSYjOflaiorZZ7WIH7g3Md?= =?us-ascii?Q?6zKsUKW0JFTUK1SXAOo9uUqQrZ5xn/4HKUD/KPum9RmFAKDl8T4ox7epwv2+?= =?us-ascii?Q?+aTKYKGpIJMS8xPSoUEbT1mNmZ70bhcjUsOhh6iEK6bg1jLABOMbqVdjY4mE?= =?us-ascii?Q?49WT00UlGhE/gSsqNIm2oTloQNIf2lxGeOcTiPWA34C0++XJ+sfnFstFNlfH?= =?us-ascii?Q?IAfJzqDTYyvPdDZ8NiFxSCWdt73cZ0xJgQjUEaoDiipyPlk3d4c/SZ64GGl1?= =?us-ascii?Q?fhmSPM41WM/BiX94XYATbKZtS1n2l00OiyAz5PkkJtgN9ET+b7CDJoRP9vQJ?= =?us-ascii?Q?Ky11SO7M6flGLV4CipEczvvI8OJNtXf5sNKPStTdTISPzEpLbJM2xB0vHq/4?= =?us-ascii?Q?8Lf36aUda0NWDywuprugA8aMsPiRRZ3ltON4OWmv4A+bQ5/Zafgb+j95Bzq3?= =?us-ascii?Q?MB2ClzrqolBxU4cKsjI0bajf0XKtpsz1+NmrsgAtnEOhAYkonVAeuXEe6gZT?= =?us-ascii?Q?hHz9fYQli9IqOuiMZFDPiujijcnAO+9cN4gbqHoegnVFWc/iLUTCAn3X2lMJ?= =?us-ascii?Q?KvCpBr8ro7XwYoBlf7wNHrck6NRHwR5kEN/2QG6S9q3cToUI8MLCZKyHU3vk?= =?us-ascii?Q?xR1hzTqcqsKTTZC83CJDlv06bzlWRFFPD0q/WKGgZU+WYT1O6sr0kT443O7j?= =?us-ascii?Q?SD4JJUyBviKydjx12IyqeyUZgw0JcOX/uJ2XwgfkOqCX8vFD2dIQ3Smdwzv3?= =?us-ascii?Q?YNU0N14u8I3AFjEjl3k91DdGgnHeN0OFp4Z0HHXlXmLHeliCXrRVhyz/MV3f?= =?us-ascii?Q?S/NDpTyC03OojmLRom8UbQDJokpZv/KWamI915C4izoC8MJPqGOzDemF5usu?= =?us-ascii?Q?LUsVIQRFYP1NYr+dq6bNhWG2cNxAPnKDFHMifc1nxgDz91vJRYRleuhjiWW7?= =?us-ascii?Q?eHGbJJvBFCyXVVazwqSQuf2MRr0yyfWVRDcfjxyo9Mmr?= MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW4PR12MB7031.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: d42721a4-0d14-4aa9-7540-08dbc9fcde37 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Oct 2023 01:53:29.9643 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: GRnapEqHuBGaBo8jfRaNNKOKC8g2SQqNiFHgdtFIo4pnGBu5a+rxObOdOyXxD0bUK0ey0Zvki+o6I3hsmUhCrg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5238 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,nicklew@nvidia.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: hbZU1ZiWD2zfa1bV4C4QT5iwx7686176AA= 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=Pidkfgp3; 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 Sorry for the delay review. I go through the changes, and it looks good to me. Reviewed-by: Nickle Wang Regards, Nickle > -----Original Message----- > From: Chang, Abner > Sent: Monday, October 2, 2023 11:10 AM > To: Mike Maslenkin ; devel@edk2.groups.io; Nick= le > Wang > Cc: igork@ami.com > Subject: RE: [PATCH 5/9] RedfishClientPkg: reduce identation level by add= ing early > return >=20 > External email: Use caution opening links or attachments >=20 >=20 > [AMD Official Use Only - General] >=20 > 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. >=20 > Thank you for helping on this package, Mike. > Abner >=20 > > -----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 > > adding early return > > > > Hi Mike, > > I can't apply the entire patch set from either outlook or Group.io. > > The format 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 > > > adding > > 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/RedfishFeatureUtili= tyLib. > > > c > > > > > b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtili= tyLib. > > > c > > > index 8fa1dc2c3535..0941f33fd73a 100644 > > > --- > > > > > a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtili= tyLib. > > > c > > > +++ > > > > > b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtili= tyLib. > > > c > > > @@ -763,68 +763,69 @@ ApplyFeatureSettingsStringArrayType ( > > > Status =3D RedfishPlatformConfigGetValue (Schema, Version, > > > ConfigureLang, &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_VA= LUE > > > > > > - // > > > > > > - 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.= ArrayCount > > > *sizeof (CHAR8 *)); > > > > > > - if (RedfishValue.Value.StringArray =3D=3D NULL) { > > > > > > + // > > > > > > + // Allocate pool for new values > > > > > > + // > > > > > > + RedfishValue.Value.StringArray =3D AllocatePool > > > + (RedfishValue.ArrayCount > > > *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 > > > + (AsciiStrSize > > > (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 (= AsciiStrSize > > > (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", __fu= nc__, > > > 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, > > > ConfigureLang, &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_V= ALUE > > > > > > - // > > > > > > - 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.ArrayCount > > * > > > 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->A= rrayValue; > > > > > > - Buffer =3D Buffer->Next; > > > > > > - Index++; > > > > > > - } > > > > > > + Buffer =3D ArrayHead; > > > > > > + Index =3D 0; > > > > > > + while (Buffer !=3D NULL) { > > > > > > + RedfishValue.Value.IntegerArray[Index] =3D > > > + (INT64)*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", __fu= nc__, > > > 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, > > > ConfigureLang, &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_V= ALUE > > > > > > - // > > > > > > - 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", __fu= nc__, > > > 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 (#109506): https://edk2.groups.io/g/devel/message/109506 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-