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 427927803CF for ; Sat, 23 Mar 2024 12:01:11 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=oiXKVJ9+drWaLFkCcZWK4sGBlw9fYC4Z5EvkIKyEXrc=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20240206; t=1711195269; v=1; b=j9nrfnWLVWMiYUFhbYPDH36iNAg9fVSDn01/E78u3Yv54tzBuvn+BR8Zje2k9v4wB79K6zTp bTBBfE/hIhxzLCvjd1kJxlQYo4f+QGpquSDTEu+604WoAcG6hDlMEeCkcANKBllt/6XCPI8DvzA PwFjC1Mw8XeEmypBEwRzEq4JPT+E+yDc7ap/lkqhBUTmnL9D1DgKev309vZmyxQShLn28fTAAiT ScETuBb4nTDo26OLw1KetU3+1FOGJnxWZzIwGJpbGP0H5V4scAcfrJCMqIX7Qo/bzm1Cy4MqF6S Y69kpcxOZ9KRMTcgjXh3qXcRQXAOhMLeDjsH0YQXCqe4w== X-Received: by 127.0.0.2 with SMTP id OcAAYY7687511xzDzXEn2wvH; Sat, 23 Mar 2024 05:01:09 -0700 X-Received: from mail-lf1-f43.google.com (mail-lf1-f43.google.com [209.85.167.43]) by mx.groups.io with SMTP id smtpd.web11.7417.1711195269062418703 for ; Sat, 23 Mar 2024 05:01:09 -0700 X-Received: by mail-lf1-f43.google.com with SMTP id 2adb3069b0e04-513d3746950so3673561e87.1 for ; Sat, 23 Mar 2024 05:01:08 -0700 (PDT) X-Gm-Message-State: tAF1qqNBMOsU6Vbl2jgqx6DGx7686176AA= X-Google-Smtp-Source: AGHT+IFKtWhdUoaY6T07S7gfAvvP+vzjd/RszlatkfuhofaMuf3x+fl9xF7gxyvN5aq6h8OzkCtDEA== X-Received: by 2002:a19:e01a:0:b0:513:bc95:50c3 with SMTP id x26-20020a19e01a000000b00513bc9550c3mr1342381lfg.12.1711195266831; Sat, 23 Mar 2024 05:01:06 -0700 (PDT) X-Received: from localhost.localdomain ([79.164.221.98]) by smtp.gmail.com with ESMTPSA id u11-20020a05651220cb00b005131cf043f8sm266801lfr.155.2024.03.23.05.01.06 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 23 Mar 2024 05:01:06 -0700 (PDT) From: "Mike Maslenkin" To: devel@edk2.groups.io Cc: Mike Maslenkin , Abner Chang , Igor Kulchytskyy , Nickle Wang Subject: [edk2-devel] [edk2-redfish-client][RFC PATCH 1/3] RedfishClientPkg: fix nodes count in GetRedpathNodeByIndex() Date: Sat, 23 Mar 2024 15:00:48 +0300 Message-Id: <20240323120050.53834-2-mike.maslenkin@gmail.com> In-Reply-To: <20240323120050.53834-1-mike.maslenkin@gmail.com> References: <20240323120050.53834-1-mike.maslenkin@gmail.com> MIME-Version: 1.0 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 Resent-Date: Sat, 23 Mar 2024 05:01:09 -0700 Reply-To: devel@edk2.groups.io,mike.maslenkin@gmail.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=j9nrfnWL; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=gmail.com (policy=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 This patch fixes work of GetRedpathNodeByIndex() function with non zero Index argument. NumberNodes value was not changed after the new node found. This means that before this patch modified function worked only in case of Index =3D 0. Debug output for the initial case: @Redfish.Settings found:/redfish/v1/Systems/system/Bios/Settings GetNumberOfRedpathNodes:6 GetRedpathNodeByIndex[0]:/redfish/v1/Systems/system/Bios/Settings GetRedpathNodeByIndex[1]: GetRedpathNodeByIndex[2]: GetRedpathNodeByIndex[3]: GetRedpathNodeByIndex[4]: GetRedpathNodeByIndex[5]: After this patch the output is as following: @Redfish.Settings found:/redfish/v1/Systems/system/Bios/Settings GetNumberOfRedpathNodes:6 GetRedpathNodeByIndex[0]:/redfish/v1/Systems/system/Bios/Settings GetRedpathNodeByIndex[1]:v1/Systems/system/Bios/Settings GetRedpathNodeByIndex[2]:Systems/system/Bios/Settings GetRedpathNodeByIndex[3]:system/Bios/Settings GetRedpathNodeByIndex[4]:Bios/Settings GetRedpathNodeByIndex[5]: Note: it is supposed that caller will set terminating '\0' explicitly at the next position pointed by returned EndOfNodePtr value. Cc: Abner Chang Cc: Igor Kulchytskyy Cc: Nickle Wang Signed-off-by: Mike Maslenkin --- .../Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c | 1 + 1 file changed, 1 insertion(+) diff --git a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatu= reUtilityLib.c b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishF= eatureUtilityLib.c index cc2b37b79605..3231ef883379 100644 --- a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtili= tyLib.c +++ b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtili= tyLib.c @@ -1320,6 +1320,7 @@ GetRedpathNodeByIndex ( return NodeStart;=0D } else {=0D NodeStart =3D NodeString + StringIndex + 1;=0D + NumberNodes++;=0D }=0D }=0D =0D --=20 2.32.0 (Apple Git-132) -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#117066): https://edk2.groups.io/g/devel/message/117066 Mute This Topic: https://groups.io/mt/105101991/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-