public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Igor Kulchytskyy" <igork@ami.com>
To: Nickle Wang <nicklew@nvidia.com>,
	"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: Abner Chang <abner.chang@amd.com>
Subject: Re: [PATCH] RedfishPkg/RedfishPlatformConfigDxe: fix value type issue.
Date: Tue, 30 May 2023 14:28:41 +0000	[thread overview]
Message-ID: <BLAPR10MB5185439628FB8B05C7F75512A84B9@BLAPR10MB5185.namprd10.prod.outlook.com> (raw)
In-Reply-To: <20230529062401.1263-1-nicklew@nvidia.com>

Reviewed-by: Igor Kulchytskyy <igork@ami.com>

-----Original Message-----
From: Nickle Wang <nicklew@nvidia.com>
Sent: Monday, May 29, 2023 2:24 AM
To: devel@edk2.groups.io
Cc: Abner Chang <abner.chang@amd.com>; Igor Kulchytskyy <igork@ami.com>
Subject: [EXTERNAL] [PATCH] RedfishPkg/RedfishPlatformConfigDxe: fix value type issue.


**CAUTION: The e-mail below is from an external source. Please exercise caution before opening attachments, clicking links, or following guidance.**

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

-The information contained in this message may be confidential and proprietary to American Megatrends (AMI). This communication is intended to be read only by the individual or entity to whom it is addressed or by their designee. If the reader of this message is not the intended recipient, you are on notice that any distribution of this message, in any form, is strictly prohibited. Please promptly notify the sender by reply e-mail or by telephone at 770-246-8600, and then delete or destroy all copies of the transmission.

      parent reply	other threads:[~2023-05-30 14:28 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
2023-05-30 14:28 ` Igor Kulchytskyy [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=BLAPR10MB5185439628FB8B05C7F75512A84B9@BLAPR10MB5185.namprd10.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