From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from fb.mail.gandi.net (spool8.mail.gandi.net [217.70.178.217]) by nmboxes7-ms7.sd4.0x35.net (Postfix) with ESMTPS id 426CC61930 for ; Tue, 16 Jan 2024 06:53:25 +0000 (UTC) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by fb.mail.gandi.net (Postfix) with ESMTPS id 87FC860376 for ; Tue, 16 Jan 2024 06:53:24 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=Huv/pGvLq+xQUgXrzzcdZLLcEhHUf+J8n8e3sa/3Rs4=; 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=1705388003; v=1; b=jSQihBFkEcnOvu+xeXYhP4ppQjSMV8xm9Lg8B+3Q94T0/YtdvZtwuK+rZE8SB+eb4O2AAl6R Muu5wd9EWy4py7+BrF5oj3uXqvju/FNH9A9ALb0BeWIf+0uXoIapR6haa/UkWDR9GlzdQKnwfZO iFbD2biOb8/wvJOKUUZKUefE= X-Received: by 127.0.0.2 with SMTP id DuWUYY7687511xVpDpaye4tq; Mon, 15 Jan 2024 22:53:23 -0800 X-Received: from NAM11-CO1-obe.outbound.protection.outlook.com (NAM11-CO1-obe.outbound.protection.outlook.com [40.107.220.58]) by mx.groups.io with SMTP id smtpd.web11.39405.1705243602759549678 for ; Sun, 14 Jan 2024 06:46:42 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SZBwBUg/ZZSvtbXkUZJP2R74D0sKmsoudeGAqgvjtEnUpe1AmnwS6oLvg6HGbMNiDSO5qY6kyr1amxjcz2HWW7V9tTnX5Ljm2IjwsUNQzW6rlaLz4QasZmo+kwu65ytWGnMRqY+RG8DMpTMPDYH3LhigbB6y55YiuCUJcNyUJtaiuKbs8CSyEfs0K6zp9/12usqlA8waahlA1jqV5zNWba36TRhQLn9WpQhINFjYMDjBDycElrkfBgF9Oe3TMrtz01WFcz62ZJZFMi1xRFWzZP1BL7b76ZgkgbapoYOYc7zxwKoFdGjjz+tIe9MzrlQNmWJ1EdaS+XNH+3tIJ1gihA== 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=zJSs3PqlvOTsbxH192Jl0mJaNsfyNwzOIyK9Kzrf5XY=; b=FPEWoK0pOEV0BbK0wdZ8zXY65r7IoVz9SwVMizhYhM6HI3qTXfZrY0JGKuJK9+Ql4rYPR/bxMmDqQhqx4vaQ7XuqqCV4hOLzUVHy7oseJh+cFSjpMZNTGw3g0+o8RCss1WhkEseGMBhq0bot4mNfggrjg+Nc37pX4vnZVZZfJeM7r1uaabVKFHGtEU6Joal//lLuAK0raIVZMcCSCD1BaTrhwLgmRX11ljTEDJC2LQkKTsCrKUAldMUmls6gbzJhYwWbAWqSkh/cklYfCm3i5zkC9WyaVlEspQ1u/0blLBCIGaUqcSJjLXlkAwNEDL12uCwTiVbanFnTXLHYSHW4ww== 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 CH3PR12MB9393.namprd12.prod.outlook.com (2603:10b6:610:1c5::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.18; Sun, 14 Jan 2024 14:46:39 +0000 X-Received: from MW4PR12MB7031.namprd12.prod.outlook.com ([fe80::a78e:602e:415c:4cb4]) by MW4PR12MB7031.namprd12.prod.outlook.com ([fe80::a78e:602e:415c:4cb4%3]) with mapi id 15.20.7181.020; Sun, 14 Jan 2024 14:46:39 +0000 From: "Nickle Wang via groups.io" To: "Chang, Abner" , "devel@edk2.groups.io" CC: Igor Kulchytskyy , Nick Ramirez Subject: Re: [edk2-devel] [PATCH] RedfishPkg/RedfishCrtLib: handle floating point number in JSON Thread-Topic: [PATCH] RedfishPkg/RedfishCrtLib: handle floating point number in JSON Thread-Index: AQHaRUQVDk94gXr9IU6mI0YeuNHO5LDXzFFQgAGZ2eA= Date: Sun, 14 Jan 2024 14:46:39 +0000 Message-ID: References: <20240112104228.670-1-nicklew@nvidia.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=8ab409b5-56b0-4b72-973d-4f6a543d62a6;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=2024-01-13T14:18:48Z;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MW4PR12MB7031:EE_|CH3PR12MB9393:EE_ x-ms-office365-filtering-correlation-id: 67d88c7a-9393-4caf-083e-08dc150f9dce x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: MocwZX+xlEnR0Y/hd2BWyYfwShFUiRk6fdqhzTJcM/8vw3IscIYwl72Zpx3U4EJxD9mQrORTyYrRmKTmhf7JbF3yBp2U/3zh9xanzU9uP+lWpZa5kR0dIkZEVyQ8BQWlgKtUoKXQWYz6XYI101MGgOdeQ8ZA2uQd20a0/otROC1iPqxouhi7W8Aemqgyvsj1BcWNlCDNzwNdMQz0oqtv2DAZdUolwA4HqdYyEdsoA2GSDMuO8VTGyGAu85WMkU3b6c+gX/mt5kyQJ4IWoptS8jGjNwCPQzol1vQWleAffnWx3bN1+vvIRMyTs77GBdajcxDJA4y3xv8Nz+kMkK+Nph6U7l8r+AxfRc8626+FHJ+XmCBHPr/0g+LmN63gy2lWeniMn4W/EE3ObbJ7WmLiyaTC5V1rGb5CzoC47d/EAj3ABt9IsZrP1BOnzcSz7QQJ/rHui7WOprcG9gQoFjrrac/brfDqOJnyAV68YqjNcTohq8A9UC2i2yL+HfYqM+jc/xgunYWT2zZUw8vkmFN7FQW94ns+2t14s4Qu2dRa5gkppoIJIWRX/651brUjmfR7HBkzeQXyBi1TPB2PxH4IlW4L+w7EUyTSr5anT8jfyxwvD8R1i/P6pNhOl4Gvh7EyzcJYKX3gtr/md6HoJyI5bg== x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?WJiJ8pCKzm/syanm1RCfdLgnXMuxYLV3dShi7L8IwhRazeCGLA1HHaySqU5C?= =?us-ascii?Q?iRGNaIrgL6Xl5ggxNVI1vCMlgrxznYBc2Xlvd98cswvqPxGn0OO/PykEYilO?= =?us-ascii?Q?Ofn+T2WWBVeFD0mEJgASe23XT0d4RgETPssTRYqjmynUlwsgsLm54C5KPL39?= =?us-ascii?Q?w380OvuHgCVpMfKShZyASoyNyQJjvzsGqciLmCXjtiD6fI+B0TeH+wPxgh2Z?= =?us-ascii?Q?kJWsTGkCH2YPsapNbix3wYfGABlyFemvIvDGIcdkF8Fv9Te+NkY1B7qq13q/?= =?us-ascii?Q?azs7SvDGquEN7y3dDJ1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CVnIfffF?= =?us-ascii?Q?Q+Qbv3SzsM6jQHBnQ9My3ICXt0WVeQeXJbAQ1ZeqXjdHsII8W8OKKELYotgw?= =?us-ascii?Q?fbONAbDsdcVF57lMYuHEmd2sQl5AXNq/v/ix1Y9FoxwqfAQyu+zfuWNJezD5?= =?us-ascii?Q?fBvK17iLx4rGoWxqCY+m77GhX1CG9DNwhNP+9ZmwiUL/p7chp0NIqdHlHeKy?= =?us-ascii?Q?PzFwD7iQlm+I4+icacGXAsRNaRcdrUUdvT+fCzkiKIVRysiB2sVXkd2o4onT?= =?us-ascii?Q?ksZ0/nm6e8VQFTza9El/akdlWQZQ0zFyrK6nxlGdI9lGWkW5KSKILBpQyr+5?= =?us-ascii?Q?Z6KRQwXDA83xXG8MncLdnBTSURvvJg4Fz7FYs0E2afCAAAPu/JKBQxITwnC1?= =?us-ascii?Q?cEWUul8g3u2NMVOQT4o=3D?= 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: 67d88c7a-9393-4caf-083e-08dc150f9dce X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Jan 2024 14:46:39.5626 (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: utKQg1MF+brnN/L7sQ2YSSVsezho7okk9slNA5ukmkhN7BHFJ1wFcVle2Khj8X49KxGacgpmkRM0O+CnRQFUyw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB9393 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: zYBTyiEtmKDU7d6RIuElaVWEx7686176AA= Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: fb.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=jSQihBFk; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}"); dmarc=none; spf=pass (fb.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io Thanks Abner. I found an issue in this patch and resolved it in version 2 h= ere: https://edk2.groups.io/g/devel/message/113780 Could you please help me to review it again? Regards, Nickle > -----Original Message----- > From: Chang, Abner > Sent: Saturday, January 13, 2024 10:19 PM > To: Nickle Wang ; devel@edk2.groups.io > Cc: Igor Kulchytskyy ; Nick Ramirez > Subject: RE: [PATCH] RedfishPkg/RedfishCrtLib: handle floating point numb= er in > JSON >=20 > External email: Use caution opening links or attachments >=20 >=20 > [AMD Official Use Only - General] >=20 > Reviewed-by: Abner Chang >=20 > > -----Original Message----- > > From: Nickle Wang > > Sent: Friday, January 12, 2024 6:42 PM > > To: devel@edk2.groups.io > > Cc: Chang, Abner ; Igor Kulchytskyy > > ; Nick Ramirez > > Subject: [PATCH] RedfishPkg/RedfishCrtLib: handle floating point > > number in JSON > > > > Caution: This message originated from an External Source. Use proper > > caution when opening attachments, clicking links, or responding. > > > > > > When the value type is defined as number in Redfish schema, floating > > point number is allowed. RedfishCrtLib raises assert without handling > > this case now. Follow the way in EDK2 to call AsciiStrDecimalToUintnS > > and handle the floating point number. > > > > Signed-off-by: Nickle Wang > > Cc: Abner Chang > > Cc: Igor Kulchytskyy > > Cc: Nick Ramirez > > --- > > .../PrivateLibrary/RedfishCrtLib/RedfishCrtLib.c | 15 > > ++++++++++----- > > 1 file changed, 10 insertions(+), 5 deletions(-) > > > > diff --git a/RedfishPkg/PrivateLibrary/RedfishCrtLib/RedfishCrtLib.c > > b/RedfishPkg/PrivateLibrary/RedfishCrtLib/RedfishCrtLib.c > > index 57a997f351..e88d874224 100644 > > --- a/RedfishPkg/PrivateLibrary/RedfishCrtLib/RedfishCrtLib.c > > +++ b/RedfishPkg/PrivateLibrary/RedfishCrtLib/RedfishCrtLib.c > > @@ -4,6 +4,7 @@ > > > > Copyright (c) 2019, Intel Corporation. All rights reserved.
> > (C) Copyright 2020 Hewlett Packard Enterprise Development LP
> > + Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights > > reserved. > > > > SPDX-License-Identifier: BSD-2-Clause-Patent > > > > @@ -519,7 +520,7 @@ strtoull ( > > } > > > > /** > > - edk2 Jansson port does not support doubles, simply return 0. > > + edk2 Jansson port does not support doubles, simply return integer pa= rt. > > > > These conversion functions convert the initial portion of the string > > pointed to by nptr to double, float, and long double > > representation, @@ -540,7 +541,7 @@ strtoull ( > > the return value), and ERANGE is stored in errno. If the correct va= lue > > would cause underflow, zero is returned and ERANGE is stored in errn= o. > > > > - @return Return 0. > > + @return Integer part of decimal number. > > **/ > > double > > strtod ( > > @@ -548,9 +549,13 @@ strtod ( > > char **__restrict endptr > > ) > > { > > - DEBUG ((DEBUG_ERROR, "We don't supprot double type on edk2 yet!")); > > - ASSERT (FALSE); > > - return (double)0; > > + UINTN Data; > > + > > + Data =3D 0; > > + > > + AsciiStrDecimalToUintnS (nptr, endptr, &Data); DEBUG ((DEBUG_WARN, > > + "%a: We don't support double type on edk2 yet. > > Only integer part is returned\n", __func__)); > > + return (double)Data; > > } > > > > static UINT8 BitMask[] =3D { > > -- > > 2.34.1 -=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 (#113781): https://edk2.groups.io/g/devel/message/113781 Mute This Topic: https://groups.io/mt/103680418/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-