From: "Rebecca Cran" <rebecca@nuviainc.com>
To: devel@edk2.groups.io
Cc: Rebecca Cran <rebecca@nuviainc.com>,
Leif Lindholm <leif@nuviainc.com>,
Ard Biesheuvel <ardb+tianocore@kernel.org>
Subject: [PATCH v3 3/3] ArmPkg: Update OemGetChassisType function to return MISC_CHASSIS_TYPE
Date: Mon, 22 Feb 2021 21:53:53 -0700 [thread overview]
Message-ID: <20210223045353.31315-4-rebecca@nuviainc.com> (raw)
In-Reply-To: <20210223045353.31315-1-rebecca@nuviainc.com>
Update OemGetChassisType in OemMiscLib to return MISC_CHASSIS_TYPE
instead of EFI_STATUS, which matches other OemMiscLib functions.
Signed-off-by: Rebecca Cran <rebecca@nuviainc.com>
---
ArmPkg/Include/Library/OemMiscLib.h | 8 +++---
ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c | 11 +++-----
ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type03/MiscChassisManufacturerFunction.c | 28 +-------------------
3 files changed, 8 insertions(+), 39 deletions(-)
diff --git a/ArmPkg/Include/Library/OemMiscLib.h b/ArmPkg/Include/Library/OemMiscLib.h
index d1ac81f73d9f..6dcc76a214df 100644
--- a/ArmPkg/Include/Library/OemMiscLib.h
+++ b/ArmPkg/Include/Library/OemMiscLib.h
@@ -128,14 +128,12 @@ OemGetMaxProcessors (
/** Gets the type of chassis for the system.
- @param ChassisType The type of the chassis.
-
- @retval EFI_SUCCESS The chassis type was fetched successfully.
+ @retval The type of the chassis.
**/
-EFI_STATUS
+MISC_CHASSIS_TYPE
EFIAPI
OemGetChassisType (
- OUT UINT8 *ChassisType
+ VOID
);
/** Returns whether the specified processor is present or not.
diff --git a/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c b/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c
index 5153c9d7809c..21f106f1e060 100644
--- a/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c
+++ b/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c
@@ -95,19 +95,16 @@ OemGetMaxProcessors (
/** Gets the type of chassis for the system.
- @param ChassisType The type of the chassis.
-
- @retval EFI_SUCCESS The chassis type was fetched successfully.
+ @retval The type of the chassis.
**/
-EFI_STATUS
+MISC_CHASSIS_TYPE
EFIAPI
OemGetChassisType (
- UINT8 *ChassisType
+ VOID
)
{
ASSERT (FALSE);
- *ChassisType = MiscChassisTypeUnknown;
- return EFI_SUCCESS;
+ return MiscChassisTypeUnknown;
}
/** Returns whether the specified processor is present or not.
diff --git a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type03/MiscChassisManufacturerFunction.c b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type03/MiscChassisManufacturerFunction.c
index e6adbceba2d5..fc4dba319aad 100644
--- a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type03/MiscChassisManufacturerFunction.c
+++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type03/MiscChassisManufacturerFunction.c
@@ -23,27 +23,6 @@
#include "SmbiosMisc.h"
-/**
- * Returns the chassis type in SMBIOS format.
- *
- * @return Chassis type
-**/
-UINT8
-GetChassisType (
- VOID
- )
-{
- EFI_STATUS Status;
- UINT8 ChassisType;
-
- Status = OemGetChassisType (&ChassisType);
- if (EFI_ERROR (Status)) {
- return 0;
- }
-
- return ChassisType;
-}
-
/**
This function makes boot time changes to the contents of the
MiscChassisManufacturer (Type 3) record.
@@ -80,8 +59,6 @@ SMBIOS_MISC_TABLE_FUNCTION(MiscChassisManufacturer)
CONTAINED_ELEMENT ContainedElements;
UINT8 ExtendLength;
- UINT8 ChassisType;
-
ExtendLength = 0;
//
@@ -165,10 +142,7 @@ SMBIOS_MISC_TABLE_FUNCTION(MiscChassisManufacturer)
SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE3) + ExtendLength + 1;
- ChassisType = GetChassisType ();
- if (ChassisType != 0) {
- SmbiosRecord->Type = ChassisType;
- }
+ SmbiosRecord->Type = OemGetChassisType ();
//ContainedElements
ASSERT (ContainedElementCount < 2);
--
2.26.2
next prev parent reply other threads:[~2021-02-23 4:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-23 4:53 [PATCH v3 0/3] ArmPkg: Fix several issues in OemMiscLib Rebecca Cran
2021-02-23 4:53 ` [PATCH v3 1/3] ArmPkg: Fix ordering of return type and EFIAPI specifier " Rebecca Cran
2021-02-23 4:53 ` [PATCH v3 2/3] ArmPkg: Rename some functions and parameters " Rebecca Cran
2021-02-23 4:53 ` Rebecca Cran [this message]
2021-02-23 12:38 ` [PATCH v3 0/3] ArmPkg: Fix several issues " Leif Lindholm
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=20210223045353.31315-4-rebecca@nuviainc.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