[edk2-devel] [PATCH v3 3/3] ArmPkg: Update OemGetChassisType function to return MISC_CHASSIS_TYPE
Rebecca Cran
rebecca at nuviainc.com
Tue Feb 23 04:53:53 UTC 2021
Update OemGetChassisType in OemMiscLib to return MISC_CHASSIS_TYPE
instead of EFI_STATUS, which matches other OemMiscLib functions.
Signed-off-by: Rebecca Cran <rebecca at 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
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#72029): https://edk2.groups.io/g/devel/message/72029
Mute This Topic: https://groups.io/mt/80844871/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