[edk2-devel] [PATCH] RedfishPkg/RedfishPlatformConfigDxe: fix value type issue.

Chang, Abner via groups.io abner.chang=amd.com at groups.io
Mon May 29 08:10:27 UTC 2023


[AMD Official Use Only - General]

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

> -----Original Message-----
> From: Nickle Wang <nicklew at nvidia.com>
> Sent: Monday, May 29, 2023 2:24 PM
> To: devel at edk2.groups.io
> Cc: Chang, Abner <Abner.Chang at amd.com>; Igor Kulchytskyy
> <igork at ami.com>
> Subject: [PATCH] RedfishPkg/RedfishPlatformConfigDxe: fix value type issue.
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> Fix incorrect value type issue for checked-box op-code.
> When the variable for checked-box is defined as UINT8 in
> varstore structure, IFR compiler assign its value type to
> EFI_IFR_TYPE_NUM_SIZE_8 instead of EFI_IFR_TYPE_BOOLEAN.
> However, the value type for checked-box is boolean value.
> Redfish service may return error because of incorrect value
> type passed to BIOS attribute registry.
>
> Signed-off-by: Nickle Wang <nicklew at nvidia.com>
> Cc: Abner Chang <abner.chang at amd.com>
> Cc: Igor Kulchytskyy <igork at ami.com>
> ---
>  .../RedfishPlatformConfigDxe.c                         | 10 ++++++++++
>  1 file changed, 10 insertions(+)
>
> diff --git a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c
> b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c
> index 1172d1094b06..462f269f6a3f 100644
> --- a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c
> +++ b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c
> @@ -1221,6 +1221,16 @@ HiiValueToRedfishValue (
>        RedfishValue->Type = RedfishValueTypeString;
>        break;
>      case EFI_IFR_CHECKBOX_OP:
> +      //
> +      // There is case where HII driver defines UINT8 for checked-box opcode
> storage.
> +      // IFR compiler will assign EFI_IFR_TYPE_NUM_SIZE_8 to its value type
> instead of
> +      // EFI_IFR_TYPE_BOOLEAN. We do a patch here and use boolean value
> type for this
> +      // case.
> +      //
> +      if (Value->Type != EFI_IFR_TYPE_BOOLEAN) {
> +        Value->Type = EFI_IFR_TYPE_BOOLEAN;
> +      }
> +
>      case EFI_IFR_NUMERIC_OP:
>        Status = HiiValueToRedfishNumeric (Value, RedfishValue);
>        if (EFI_ERROR (Status)) {
> --
> 2.17.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#105361): https://edk2.groups.io/g/devel/message/105361
Mute This Topic: https://groups.io/mt/99195197/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-




More information about the edk2-devel-archive mailing list