public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Chang, Abner" <abner.chang@amd.com>
To: Simon Wang <simowang@nvidia.com>,
	"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: Nickle Wang <nicklew@nvidia.com>,
	Igor Kulchytskyy <igork@ami.com>,
	Nick Ramirez <nramirez@nvidia.com>
Subject: Re: [edk2-staging][PATCH] edk2-staging/RedfishClientPkg: Reduce the header file dependency.
Date: Mon, 20 Mar 2023 01:05:32 +0000	[thread overview]
Message-ID: <MN2PR12MB3966C7BB664D08DCB620CDFEEA809@MN2PR12MB3966.namprd12.prod.outlook.com> (raw)
In-Reply-To: <9a7a3b838b17c07df4c0789e106da055623dfdba.1678791905.git.simowang@nvidia.com>

[AMD Official Use Only - General]

Reviewed-by: Abner Chang <abner.chang@amd.com>

> -----Original Message-----
> From: Simon Wang <simowang@nvidia.com>
> Sent: Tuesday, March 14, 2023 7:39 PM
> To: devel@edk2.groups.io
> Cc: Nickle Wang <nicklew@nvidia.com>; Chang, Abner
> <Abner.Chang@amd.com>; Igor Kulchytskyy <igork@ami.com>; Nick
> Ramirez <nramirez@nvidia.com>
> Subject: [edk2-staging][PATCH] edk2-staging/RedfishClientPkg: Reduce the
> header file dependency.
> 
> Caution: This message originated from an External Source. Use proper
> caution when opening attachments, clicking links, or responding.
> 
> 
> Move REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG and
> REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG_LIST from
> RedfishFeatureUtilityLib.h to EdkIIRedfishInterchangeData.h. Also, remove
> unnecessary jansson.h in RedfishDataTypeDef.h.
> 
> Signed-off-by: Simon Wang <simowang@nvidia.com>
> Cc: Nickle Wang <nicklew@nvidia.com>
> Cc: Abner Chang <abner.chang@amd.com>
> Cc: Igor Kulchytskyy <igork@ami.com>
> Cc: Nick Ramirez <nramirez@nvidia.com>
> ---
>  .../ConverterLib/include/RedfishDataTypeDef.h | 40 +++++++++----------
>  .../Library/RedfishFeatureUtilityLib.h        | 17 +-------
>  .../Protocol/EdkIIRedfishInterchangeData.h    | 33 ++++++++++-----
>  3 files changed, 45 insertions(+), 45 deletions(-)
> 
> diff --git a/RedfishClientPkg/ConverterLib/include/RedfishDataTypeDef.h
> b/RedfishClientPkg/ConverterLib/include/RedfishDataTypeDef.h
> index 23d13a854c..c759428ab6 100644
> --- a/RedfishClientPkg/ConverterLib/include/RedfishDataTypeDef.h
> +++ b/RedfishClientPkg/ConverterLib/include/RedfishDataTypeDef.h
> @@ -1,6 +1,7 @@
>  /** @file
> 
>    (C) Copyright 2018-2021 Hewlett Packard Enterprise Development LP<BR>
> +  Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
> 
>    SPDX-License-Identifier: BSD-2-Clause-Patent
> 
> @@ -8,29 +9,28 @@
>    Copyright 2019-2021 Distributed Management Task Force, Inc. All rights
> reserved.
>    License: BSD 3-Clause License. For full text see link:
> https://github.com/DMTF/Redfish-JSON-C-Struct-
> Converter/blob/master/LICENSE.md
>  **/
> +
>  #ifndef REDFISH_CS_DATA_TYPE_H_
>  #define REDFISH_CS_DATA_TYPE_H_
> 
> -#include <jansson.h>
> -
> -typedef char               RedfishCS_char;
> -typedef int                RedfishCS_bool;
> -typedef signed char        RedfishCS_int8;
> -typedef unsigned char      RedfishCS_uint8;
> -typedef int                RedfishCS_int16;
> -typedef int                RedfishCS_int;
> -typedef unsigned int       RedfishCS_uint16;
> -typedef long int           RedfishCS_int32;
> -typedef unsigned long int  RedfishCS_uint32;
> -typedef long long          RedfishCS_int64;
> -typedef unsigned long long RedfishCS_uint64;
> -typedef void               RedfishCS_void;
> -
> -#define RedfishCS_boolean_false 0
> -#define RedfishCS_boolean_true  1
> +typedef char                RedfishCS_char;
> +typedef int                 RedfishCS_bool;
> +typedef signed char         RedfishCS_int8;
> +typedef unsigned char       RedfishCS_uint8;
> +typedef int                 RedfishCS_int16;
> +typedef int                 RedfishCS_int;
> +typedef unsigned int        RedfishCS_uint16;
> +typedef long int            RedfishCS_int32;
> +typedef unsigned long int   RedfishCS_uint32;
> +typedef long long           RedfishCS_int64;
> +typedef unsigned long long  RedfishCS_uint64;
> +typedef void                RedfishCS_void;
> +
> +#define RedfishCS_boolean_false  0
> +#define RedfishCS_boolean_true   1
> 
>  typedef RedfishCS_int64 RedfishCS_status;
> -#define RedfishCS_status_success               0
> +#define RedfishCS_status_success              0
>  #define RedfishCS_status_unsupported          -1
>  #define RedfishCS_status_invalid_parameter    -2
>  #define RedfishCS_status_insufficient_memory  -3 @@ -39,8 +39,8 @@
> typedef RedfishCS_int64 RedfishCS_status;
> 
>  typedef struct _RedfishCS_Link RedfishCS_Link;  struct _RedfishCS_Link {
> -  RedfishCS_Link *BackLink;
> -  RedfishCS_Link *ForwardLink;
> +  RedfishCS_Link    *BackLink;
> +  RedfishCS_Link    *ForwardLink;
>  };
> 
>  #endif
> diff --git a/RedfishClientPkg/Include/Library/RedfishFeatureUtilityLib.h
> b/RedfishClientPkg/Include/Library/RedfishFeatureUtilityLib.h
> index 1429643272..e2f728b26a 100644
> --- a/RedfishClientPkg/Include/Library/RedfishFeatureUtilityLib.h
> +++ b/RedfishClientPkg/Include/Library/RedfishFeatureUtilityLib.h
> @@ -13,26 +13,11 @@
> 
>  #include <Library/RedfishLib.h>
>  #include <Protocol/EdkIIRedfishPlatformConfig.h>
> +#include <Protocol/EdkIIRedfishInterchangeData.h>
>  #include <RedfishJsonStructure/RedfishCsCommon.h>
> 
>  #define REDFISH_ENABLE_SYSTEM_REBOOT()
> PcdSetBoolS(PcdRedfishSystemRebootRequired, TRUE)
> 
> -//
> -// Definition of REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG
> -//
> -typedef struct {
> -  UINTN         Index;
> -  EFI_STRING    ConfigureLang;
> -} REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG;
> -
> -//
> -// Definition of REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG_LIST
> -//
> -typedef struct {
> -  UINTN                                     Count;
> -  REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG    *List;
> -} REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG_LIST;
> -
>  /**
> 
>    Read redfish resource by given resource URI.
> diff --git
> a/RedfishClientPkg/Include/Protocol/EdkIIRedfishInterchangeData.h
> b/RedfishClientPkg/Include/Protocol/EdkIIRedfishInterchangeData.h
> index e8d0462fb7..89708eb8f1 100644
> --- a/RedfishClientPkg/Include/Protocol/EdkIIRedfishInterchangeData.h
> +++ b/RedfishClientPkg/Include/Protocol/EdkIIRedfishInterchangeData.h
> @@ -2,6 +2,7 @@
>    This file defines the
> EDKII_REDFISH_FEATURE_INTERCHANGE_DATA_PROTOCOL interface.
> 
>    (C) Copyright 2022 Hewlett Packard Enterprise Development LP<BR>
> +  Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
> 
>    SPDX-License-Identifier: BSD-2-Clause-Patent
> 
> @@ -10,7 +11,21 @@
>  #ifndef EDKII_REDFISH_FEATURE_INTERCHANGE_DATA_H_
>  #define EDKII_REDFISH_FEATURE_INTERCHANGE_DATA_H_
> 
> -#include <Library/RedfishFeatureUtilityLib.h>
> +//
> +// Definition of REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG
> +//
> +typedef struct {
> +  UINTN         Index;
> +  EFI_STRING    ConfigureLang;
> +} REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG;
> +
> +//
> +// Definition of REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG_LIST
> +//
> +typedef struct {
> +  UINTN                                     Count;
> +  REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG    *List;
> +} REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG_LIST;
> 
>  typedef struct _EDKII_REDFISH_FEATURE_INTERCHANGE_DATA_PROTOCOL
> EDKII_REDFISH_FEATURE_INTERCHANGE_DATA_PROTOCOL;
> 
> @@ -27,15 +42,15 @@ typedef enum {
>  } RESOURCE_INFORMATION_EXCHANGE_TYPE;
> 
>  typedef struct {
> -  RESOURCE_INFORMATION_EXCHANGE_TYPE Type;
> -  EFI_STRING     ParentUri;          ///< The parent URI (in configure language)
> of the resource to process.
> -  EFI_STRING     PropertyName;       ///< The property name of the resource
> to process.
> -  EFI_STRING     FullUri;            ///< The full URI (in configure language) of the
> resource to process.
> +  RESOURCE_INFORMATION_EXCHANGE_TYPE    Type;
> +  EFI_STRING                            ParentUri;    ///< The parent URI (in configure
> language) of the resource to process.
> +  EFI_STRING                            PropertyName; ///< The property name of the
> resource to process.
> +  EFI_STRING                            FullUri;      ///< The full URI (in configure language)
> of the resource to process.
>  } RESOURCE_INFORMATION_SEND;
> 
>  typedef struct {
> -  RESOURCE_INFORMATION_EXCHANGE_TYPE Type;
> -  REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG_LIST
> ConfigureLanguageList;
> +  RESOURCE_INFORMATION_EXCHANGE_TYPE             Type;
> +  REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG_LIST
> ConfigureLanguageList;
>  } RESOURCE_INFORMATION_RETURNED;
> 
>  typedef struct {
> @@ -44,9 +59,9 @@ typedef struct {
>  } RESOURCE_INFORMATION_EXCHANGE;
> 
>  struct _EDKII_REDFISH_FEATURE_INTERCHANGE_DATA_PROTOCOL {
> -  RESOURCE_INFORMATION_EXCHANGE *ResourceInformationExchage;
> +  RESOURCE_INFORMATION_EXCHANGE    *ResourceInformationExchage;
>  };
> 
> -extern EFI_GUID gEdkIIRedfishFeatureInterchangeDataProtocolGuid;
> +extern EFI_GUID  gEdkIIRedfishFeatureInterchangeDataProtocolGuid;
> 
>  #endif
> --
> 2.39.2

      reply	other threads:[~2023-03-20  1:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-14 11:39 [edk2-staging][PATCH] edk2-staging/RedfishClientPkg: Reduce the header file dependency Simon Wang
2023-03-20  1:05 ` Chang, Abner [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=MN2PR12MB3966C7BB664D08DCB620CDFEEA809@MN2PR12MB3966.namprd12.prod.outlook.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox