Reviewed-by: Nickle Wang <nick...@nvidia.com>

Regards,
Nickle

> -----Original Message-----
> From: Mike Maslenkin <mike.maslen...@gmail.com>
> Sent: Saturday, March 23, 2024 8:01 PM
> To: devel@edk2.groups.io
> Cc: Mike Maslenkin <mike.maslen...@gmail.com>; Abner Chang
> <abner.ch...@amd.com>; Igor Kulchytskyy <ig...@ami.com>; Nickle Wang
> <nick...@nvidia.com>
> Subject: [edk2-redfish-client][RFC PATCH 1/3] RedfishClientPkg: fix nodes 
> count
> in GetRedpathNodeByIndex()
> 
> External email: Use caution opening links or attachments
> 
> 
> 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 = 
> 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]:<null string>
>  GetRedpathNodeByIndex[2]:<null string>
>  GetRedpathNodeByIndex[3]:<null string>
>  GetRedpathNodeByIndex[4]:<null string>
>  GetRedpathNodeByIndex[5]:<null string>
> 
> 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]:<null string>
> 
> Note: it is supposed that caller will set terminating '\0' explicitly at the 
> next
> position pointed by returned EndOfNodePtr value.
> 
> Cc: Abner Chang <abner.ch...@amd.com>
> Cc: Igor Kulchytskyy <ig...@ami.com>
> Cc: Nickle Wang <nick...@nvidia.com>
> Signed-off-by: Mike Maslenkin <mike.maslen...@gmail.com>
> ---
>  .../Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c  | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git
> a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c
> b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c
> index cc2b37b79605..3231ef883379 100644
> ---
> a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c
> +++ b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUt
> +++ ilityLib.c
> @@ -1320,6 +1320,7 @@ GetRedpathNodeByIndex (
>          return NodeStart;
> 
>        } else {
> 
>          NodeStart = NodeString + StringIndex + 1;
> 
> +        NumberNodes++;
> 
>        }
> 
>      }
> 
> 
> 
> --
> 2.32.0 (Apple Git-132)



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#117114): https://edk2.groups.io/g/devel/message/117114
Mute This Topic: https://groups.io/mt/105101991/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to