mirror of
https://github.com/tianocore/edk2
synced 2026-08-27 00:23:19 -04:00
RedfishPkg/RedfishPlatformConfig: Fix CLANGPDB build failure
CLANGPDB build fails because the intrinsic _memcpy is used by the compiler for the value structure passed via a function. Change the code to use the value reference. This fixes the issue: #11882 Signed-off-by: Abner Chang <abner.chang@amd.com>
This commit is contained in:
parent
6f536c0226
commit
60bfa52f65
4 changed files with 24 additions and 18 deletions
|
|
@ -40,7 +40,7 @@ RedfishPlatformConfigGetValue (
|
|||
@param[in] Schema The Redfish schema to query.
|
||||
@param[in] Version The Redfish version to query.
|
||||
@param[in] ConfigureLang The target value which match this configure Language.
|
||||
@param[in] Value The value to set.
|
||||
@param[in] Value Pointer to the Redfish value to set.
|
||||
|
||||
@retval EFI_SUCCESS Value is returned successfully.
|
||||
@retval EFI_NOT_READY Redfish Platform Config protocol is not ready.
|
||||
|
|
@ -52,7 +52,7 @@ RedfishPlatformConfigSetValue (
|
|||
IN CHAR8 *Schema,
|
||||
IN CHAR8 *Version,
|
||||
IN EFI_STRING ConfigureLang,
|
||||
IN EDKII_REDFISH_VALUE Value
|
||||
IN EDKII_REDFISH_VALUE *Value
|
||||
);
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -15,8 +15,10 @@ typedef struct _EDKII_REDFISH_PLATFORM_CONFIG_PROTOCOL EDKII_REDFISH_PLATFORM_CO
|
|||
|
||||
//
|
||||
// Redfish Platform Config Protocol interface version.
|
||||
// On Version 1.1, we change EDKII_REDFISH_PLATFORM_CONFIG_SET_VALUE protocol interface
|
||||
// to use value reference instead of value structure of the parameter "Value".
|
||||
//
|
||||
#define REDFISH_PLATFORM_CONFIG_VERSION 0x00010000
|
||||
#define REDFISH_PLATFORM_CONFIG_VERSION 0x00010001
|
||||
|
||||
///
|
||||
/// Definition of EDKII_REDFISH_TYPE_VALUE
|
||||
|
|
@ -163,7 +165,7 @@ EFI_STATUS
|
|||
@param[in] Schema The Redfish schema to query.
|
||||
@param[in] Version The Redfish version to query.
|
||||
@param[in] ConfigureLang The target value which match this configure Language.
|
||||
@param[in] Value The value to set.
|
||||
@param[in] RedfishValue Pointer to the Redfish value to set.
|
||||
|
||||
@retval EFI_SUCCESS Value is returned successfully.
|
||||
@retval Others Some error happened.
|
||||
|
|
@ -176,7 +178,7 @@ EFI_STATUS
|
|||
IN CHAR8 *Schema,
|
||||
IN CHAR8 *Version,
|
||||
IN EFI_STRING ConfigureLang,
|
||||
IN EDKII_REDFISH_VALUE Value
|
||||
IN EDKII_REDFISH_VALUE *Value
|
||||
);
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ RedfishPlatformConfigGetDefaultValue (
|
|||
@param[in] Schema The Redfish schema to query.
|
||||
@param[in] Version The Redfish version to query.
|
||||
@param[in] ConfigureLang The target value which match this configure Language.
|
||||
@param[in] Value The value to set.
|
||||
@param[in] Value Pointer to the Redfish value to set.
|
||||
|
||||
@retval EFI_SUCCESS Value is returned successfully.
|
||||
@retval EFI_NOT_READY Redfish Platform Config protocol is not ready.
|
||||
|
|
@ -134,13 +134,17 @@ RedfishPlatformConfigSetValue (
|
|||
IN CHAR8 *Schema,
|
||||
IN CHAR8 *Version,
|
||||
IN EFI_STRING ConfigureLang,
|
||||
IN EDKII_REDFISH_VALUE Value
|
||||
IN EDKII_REDFISH_VALUE *Value
|
||||
)
|
||||
{
|
||||
if (mRedfishPlatformConfigLibPrivate.Protocol == NULL) {
|
||||
return EFI_NOT_READY;
|
||||
}
|
||||
|
||||
if (Value == NULL) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
return mRedfishPlatformConfigLibPrivate.Protocol->SetValue (
|
||||
mRedfishPlatformConfigLibPrivate.Protocol,
|
||||
Schema,
|
||||
|
|
|
|||
|
|
@ -1953,7 +1953,7 @@ RedfishPlatformConfigSetStatementCommon (
|
|||
@param[in] Schema The Redfish schema to query.
|
||||
@param[in] Version The Redfish version to query.
|
||||
@param[in] ConfigureLang The target value which match this configure Language.
|
||||
@param[in] Value The value to set.
|
||||
@param[in] Value Pointer to the Redfish value to set.
|
||||
|
||||
@retval EFI_SUCCESS Value is returned successfully.
|
||||
@retval Others Some error happened.
|
||||
|
|
@ -1966,7 +1966,7 @@ RedfishPlatformConfigProtocolSetValue (
|
|||
IN CHAR8 *Schema,
|
||||
IN CHAR8 *Version,
|
||||
IN EFI_STRING ConfigureLang,
|
||||
IN EDKII_REDFISH_VALUE Value
|
||||
IN EDKII_REDFISH_VALUE *Value
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
|
|
@ -1978,7 +1978,7 @@ RedfishPlatformConfigProtocolSetValue (
|
|||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
if ((Value.Type == RedfishValueTypeUnknown) || (Value.Type >= RedfishValueTypeMax)) {
|
||||
if ((Value == NULL) || (Value->Type == RedfishValueTypeUnknown) || (Value->Type >= RedfishValueTypeMax)) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
|
|
@ -1992,10 +1992,10 @@ RedfishPlatformConfigProtocolSetValue (
|
|||
|
||||
ZeroMem (&NewValue, sizeof (HII_STATEMENT_VALUE));
|
||||
|
||||
switch (Value.Type) {
|
||||
switch (Value->Type) {
|
||||
case RedfishValueTypeInteger:
|
||||
case RedfishValueTypeBoolean:
|
||||
Status = RedfishNumericToHiiValue (&Value, &NewValue);
|
||||
Status = RedfishNumericToHiiValue (Value, &NewValue);
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((DEBUG_ERROR, "%a: failed to convert Redfish value to Hii value: %r\n", __func__, Status));
|
||||
goto RELEASE_RESOURCE;
|
||||
|
|
@ -2003,14 +2003,14 @@ RedfishPlatformConfigProtocolSetValue (
|
|||
|
||||
break;
|
||||
case RedfishValueTypeString:
|
||||
if (Value.Value.Buffer == NULL) {
|
||||
if (Value->Value.Buffer == NULL) {
|
||||
Status = EFI_INVALID_PARAMETER;
|
||||
goto RELEASE_RESOURCE;
|
||||
}
|
||||
|
||||
NewValue.Type = EFI_IFR_TYPE_STRING;
|
||||
NewValue.BufferLen = (UINT16)(AsciiStrSize (Value.Value.Buffer) * sizeof (CHAR16));
|
||||
NewValue.Buffer = (UINT8 *)StrToUnicodeStr (Value.Value.Buffer);
|
||||
NewValue.BufferLen = (UINT16)(AsciiStrSize (Value->Value.Buffer) * sizeof (CHAR16));
|
||||
NewValue.Buffer = (UINT8 *)StrToUnicodeStr (Value->Value.Buffer);
|
||||
if (NewValue.Buffer == NULL) {
|
||||
Status = EFI_OUT_OF_RESOURCES;
|
||||
goto RELEASE_RESOURCE;
|
||||
|
|
@ -2019,8 +2019,8 @@ RedfishPlatformConfigProtocolSetValue (
|
|||
break;
|
||||
case RedfishValueTypeStringArray:
|
||||
NewValue.Type = EFI_IFR_TYPE_STRING;
|
||||
NewValue.BufferLen = (UINT16)Value.ArrayCount;
|
||||
NewValue.Buffer = (UINT8 *)Value.Value.StringArray;
|
||||
NewValue.BufferLen = (UINT16)Value->ArrayCount;
|
||||
NewValue.Buffer = (UINT8 *)Value->Value.StringArray;
|
||||
break;
|
||||
default:
|
||||
ASSERT (FALSE);
|
||||
|
|
@ -2038,7 +2038,7 @@ RELEASE_RESOURCE:
|
|||
FreePool (FullSchema);
|
||||
}
|
||||
|
||||
if ((Value.Type == RedfishValueTypeString) && (NewValue.Buffer != NULL)) {
|
||||
if ((Value->Type == RedfishValueTypeString) && (NewValue.Buffer != NULL)) {
|
||||
FreePool (NewValue.Buffer);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue