From: "Chang, Abner" <abner.chang@amd.com>
To: Nickle Wang <nicklew@nvidia.com>,
"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: Igor Kulchytskyy <igork@ami.com>
Subject: Re: [PATCH] RedfishPkg/RedfishPlatformConfigDxe: fix value type issue.
Date: Mon, 29 May 2023 08:10:27 +0000 [thread overview]
Message-ID: <MN2PR12MB396649A2804F9B1335791CA3EA4A9@MN2PR12MB3966.namprd12.prod.outlook.com> (raw)
In-Reply-To: <20230529062401.1263-1-nicklew@nvidia.com>
[AMD Official Use Only - General]
Reviewed-by: Abner Chang <abner.chang@amd.com>
> -----Original Message-----
> From: Nickle Wang <nicklew@nvidia.com>
> Sent: Monday, May 29, 2023 2:24 PM
> To: devel@edk2.groups.io
> Cc: Chang, Abner <Abner.Chang@amd.com>; Igor Kulchytskyy
> <igork@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@nvidia.com>
> Cc: Abner Chang <abner.chang@amd.com>
> Cc: Igor Kulchytskyy <igork@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
next prev parent reply other threads:[~2023-05-29 8:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-29 6:24 [PATCH] RedfishPkg/RedfishPlatformConfigDxe: fix value type issue Nickle Wang
2023-05-29 8:10 ` Chang, Abner [this message]
2023-05-30 14:28 ` Igor Kulchytskyy
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=MN2PR12MB396649A2804F9B1335791CA3EA4A9@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