MdeModulePkg: Update code to be more C11 compliant by using __func__
__FUNCTION__ is a pre-standard extension that gcc and Visual C++ among others support, while __func__ was standardized in C99. Since it's more standard, replace __FUNCTION__ with __func__ throughout MdeModulePkg. Signed-off-by: Rebecca Cran <rebecca@bsdio.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
This commit is contained in:
committed by
mergify[bot]
parent
8ba392687b
commit
7b82da70ed
@@ -344,7 +344,7 @@ Thunk32To64 (
|
||||
DEBUG ((
|
||||
DEBUG_INFO,
|
||||
"%a() Stack Base: 0x%lx, Stack Size: 0x%lx\n",
|
||||
__FUNCTION__,
|
||||
__func__,
|
||||
Context->StackBufferBase,
|
||||
Context->StackBufferLength
|
||||
));
|
||||
@@ -917,7 +917,7 @@ GetScatterGatherHeadEntries (
|
||||
CapsuleDataPtr64 = 0;
|
||||
|
||||
if ((ListLength == NULL) || (HeadList == NULL)) {
|
||||
DEBUG ((DEBUG_ERROR, "%a Invalid parameters. Inputs can't be NULL\n", __FUNCTION__));
|
||||
DEBUG ((DEBUG_ERROR, "%a Invalid parameters. Inputs can't be NULL\n", __func__));
|
||||
ASSERT (ListLength != NULL);
|
||||
ASSERT (HeadList != NULL);
|
||||
return EFI_INVALID_PARAMETER;
|
||||
@@ -1022,7 +1022,7 @@ GetScatterGatherHeadEntries (
|
||||
}
|
||||
|
||||
if (ValidIndex == 0) {
|
||||
DEBUG ((DEBUG_ERROR, "%a didn't find any SG lists in variables\n", __FUNCTION__));
|
||||
DEBUG ((DEBUG_ERROR, "%a didn't find any SG lists in variables\n", __func__));
|
||||
return EFI_NOT_FOUND;
|
||||
}
|
||||
|
||||
@@ -1101,7 +1101,7 @@ CapsuleCoalesce (
|
||||
//
|
||||
Status = GetScatterGatherHeadEntries (&ListLength, &VariableArrayAddress);
|
||||
if (EFI_ERROR (Status) || (VariableArrayAddress == NULL)) {
|
||||
DEBUG ((DEBUG_ERROR, "%a failed to get Scatter Gather List Head Entries. Status = %r\n", __FUNCTION__, Status));
|
||||
DEBUG ((DEBUG_ERROR, "%a failed to get Scatter Gather List Head Entries. Status = %r\n", __func__, Status));
|
||||
goto Done;
|
||||
}
|
||||
|
||||
|
@@ -277,7 +277,7 @@ _ModuleEntryPoint (
|
||||
DEBUG ((
|
||||
DEBUG_INFO,
|
||||
"%a() Stack Base: 0x%lx, Stack Size: 0x%lx\n",
|
||||
__FUNCTION__,
|
||||
__func__,
|
||||
EntrypointContext->StackBufferBase,
|
||||
EntrypointContext->StackBufferLength
|
||||
));
|
||||
|
@@ -114,7 +114,7 @@ FindAnchorVolumeDescriptorPointer (
|
||||
DEBUG ((
|
||||
DEBUG_ERROR,
|
||||
"%a: Media block size 0x%x unable to hold an AVDP.\n",
|
||||
__FUNCTION__,
|
||||
__func__,
|
||||
BlockSize
|
||||
));
|
||||
return EFI_UNSUPPORTED;
|
||||
@@ -140,7 +140,7 @@ FindAnchorVolumeDescriptorPointer (
|
||||
// Check if read block is a valid AVDP descriptor
|
||||
//
|
||||
if (DescriptorTag->TagIdentifier == UdfAnchorVolumeDescriptorPointer) {
|
||||
DEBUG ((DEBUG_INFO, "%a: found AVDP at block %d\n", __FUNCTION__, 256));
|
||||
DEBUG ((DEBUG_INFO, "%a: found AVDP at block %d\n", __func__, 256));
|
||||
AvdpsCount++;
|
||||
}
|
||||
|
||||
@@ -167,7 +167,7 @@ FindAnchorVolumeDescriptorPointer (
|
||||
DEBUG ((
|
||||
DEBUG_INFO,
|
||||
"%a: found AVDP at block %Ld\n",
|
||||
__FUNCTION__,
|
||||
__func__,
|
||||
EndLBA - 256
|
||||
));
|
||||
return EFI_SUCCESS;
|
||||
@@ -251,13 +251,13 @@ FindAnchorVolumeDescriptorPointer (
|
||||
DEBUG ((
|
||||
DEBUG_WARN,
|
||||
"%a: found AVDP at block %Ld\n",
|
||||
__FUNCTION__,
|
||||
__func__,
|
||||
LastAvdpBlockNum
|
||||
));
|
||||
DEBUG ((
|
||||
DEBUG_WARN,
|
||||
"%a: correcting last block from %Ld to %Ld\n",
|
||||
__FUNCTION__,
|
||||
__func__,
|
||||
EndLBA,
|
||||
LastAvdpBlockNum
|
||||
));
|
||||
|
@@ -262,7 +262,7 @@ UdfOpen (
|
||||
DEBUG ((
|
||||
DEBUG_ERROR,
|
||||
"%a: GetFileSize() fails with status - %r.\n",
|
||||
__FUNCTION__,
|
||||
__func__,
|
||||
Status
|
||||
));
|
||||
goto Error_Get_File_Size;
|
||||
|
@@ -298,7 +298,7 @@ GetLongAdLsn (
|
||||
DEBUG ((
|
||||
DEBUG_ERROR,
|
||||
"%a: Fail to get the Partition Descriptor from the given Long Allocation Descriptor.\n",
|
||||
__FUNCTION__
|
||||
__func__
|
||||
));
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
@@ -731,7 +731,7 @@ FtwRestart (
|
||||
return EFI_ABORTED;
|
||||
}
|
||||
|
||||
DEBUG ((DEBUG_INFO, "%a(): success\n", __FUNCTION__));
|
||||
DEBUG ((DEBUG_INFO, "%a(): success\n", __func__));
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -787,7 +787,7 @@ FtwAbort (
|
||||
|
||||
FtwDevice->FtwLastWriteHeader->Complete = FTW_VALID_STATE;
|
||||
|
||||
DEBUG ((DEBUG_INFO, "%a(): success\n", __FUNCTION__));
|
||||
DEBUG ((DEBUG_INFO, "%a(): success\n", __func__));
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -901,7 +901,7 @@ FtwGetLastWrite (
|
||||
Status = EFI_SUCCESS;
|
||||
}
|
||||
|
||||
DEBUG ((DEBUG_INFO, "%a(): success\n", __FUNCTION__));
|
||||
DEBUG ((DEBUG_INFO, "%a(): success\n", __func__));
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
@@ -1320,7 +1320,7 @@ InitFtwProtocol (
|
||||
DEBUG ((
|
||||
DEBUG_INFO,
|
||||
"Ftw: Restart working block update in %a() - %r\n",
|
||||
__FUNCTION__,
|
||||
__func__,
|
||||
Status
|
||||
));
|
||||
FtwAbort (&FtwDevice->FtwInstance);
|
||||
|
@@ -1632,7 +1632,7 @@ GetExPcdTokenNumber (
|
||||
}
|
||||
}
|
||||
|
||||
DEBUG ((DEBUG_ERROR, "%a: Failed to find PCD with GUID: %g and token number: %d\n", __FUNCTION__, Guid, ExTokenNumber));
|
||||
DEBUG ((DEBUG_ERROR, "%a: Failed to find PCD with GUID: %g and token number: %d\n", __func__, Guid, ExTokenNumber));
|
||||
ASSERT (FALSE);
|
||||
|
||||
return 0;
|
||||
|
@@ -1157,7 +1157,7 @@ SmbiosCreateTable (
|
||||
DEBUG ((
|
||||
DEBUG_INFO,
|
||||
"%a() re-allocate SMBIOS 32-bit table\n",
|
||||
__FUNCTION__
|
||||
__func__
|
||||
));
|
||||
if (EntryPointStructure->TableAddress != 0) {
|
||||
//
|
||||
@@ -1329,7 +1329,7 @@ SmbiosCreate64BitTable (
|
||||
DEBUG ((
|
||||
DEBUG_INFO,
|
||||
"%a() re-allocate SMBIOS 64-bit table\n",
|
||||
__FUNCTION__
|
||||
__func__
|
||||
));
|
||||
if (Smbios30EntryPointStructure->TableAddress != 0) {
|
||||
//
|
||||
|
@@ -116,7 +116,7 @@ MorLockInitAtEndOfDxe (
|
||||
// First, we obviously need to locate the VariablePolicy protocol.
|
||||
Status = gBS->LocateProtocol (&gEdkiiVariablePolicyProtocolGuid, NULL, (VOID **)&VariablePolicy);
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((DEBUG_ERROR, "%a - Could not locate VariablePolicy protocol! %r\n", __FUNCTION__, Status));
|
||||
DEBUG ((DEBUG_ERROR, "%a - Could not locate VariablePolicy protocol! %r\n", __func__, Status));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -132,7 +132,7 @@ MorLockInitAtEndOfDxe (
|
||||
VARIABLE_POLICY_TYPE_LOCK_NOW
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((DEBUG_ERROR, "%a - Could not lock variable %s! %r\n", __FUNCTION__, MEMORY_OVERWRITE_REQUEST_CONTROL_LOCK_NAME, Status));
|
||||
DEBUG ((DEBUG_ERROR, "%a - Could not lock variable %s! %r\n", __func__, MEMORY_OVERWRITE_REQUEST_CONTROL_LOCK_NAME, Status));
|
||||
}
|
||||
|
||||
Status = RegisterBasicVariablePolicy (
|
||||
@@ -146,7 +146,7 @@ MorLockInitAtEndOfDxe (
|
||||
VARIABLE_POLICY_TYPE_LOCK_NOW
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((DEBUG_ERROR, "%a - Could not lock variable %s! %r\n", __FUNCTION__, MEMORY_OVERWRITE_REQUEST_VARIABLE_NAME, Status));
|
||||
DEBUG ((DEBUG_ERROR, "%a - Could not lock variable %s! %r\n", __func__, MEMORY_OVERWRITE_REQUEST_VARIABLE_NAME, Status));
|
||||
}
|
||||
|
||||
return;
|
||||
|
@@ -485,7 +485,7 @@ MorLockInitAtEndOfDxe (
|
||||
DEBUG ((
|
||||
DEBUG_WARN,
|
||||
"%a: deleting unexpected / unsupported variable %g:%s\n",
|
||||
__FUNCTION__,
|
||||
__func__,
|
||||
&gEfiMemoryOverwriteControlDataGuid,
|
||||
MEMORY_OVERWRITE_REQUEST_VARIABLE_NAME
|
||||
));
|
||||
@@ -521,7 +521,7 @@ MorLockInitAtEndOfDxe (
|
||||
}
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((DEBUG_ERROR, "%a - Failed to lock variable %s! %r\n", __FUNCTION__, MEMORY_OVERWRITE_REQUEST_VARIABLE_NAME, Status));
|
||||
DEBUG ((DEBUG_ERROR, "%a - Failed to lock variable %s! %r\n", __func__, MEMORY_OVERWRITE_REQUEST_VARIABLE_NAME, Status));
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
}
|
||||
|
||||
@@ -559,7 +559,7 @@ MorLockInitAtEndOfDxe (
|
||||
}
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((DEBUG_ERROR, "%a - Failed to lock variable %s! %r\n", __FUNCTION__, MEMORY_OVERWRITE_REQUEST_CONTROL_LOCK_NAME, Status));
|
||||
DEBUG ((DEBUG_ERROR, "%a - Failed to lock variable %s! %r\n", __func__, MEMORY_OVERWRITE_REQUEST_CONTROL_LOCK_NAME, Status));
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
}
|
||||
|
||||
|
@@ -2770,7 +2770,7 @@ VariableServiceSetVariable (
|
||||
DEBUG ((
|
||||
DEBUG_ERROR,
|
||||
"%a: Failed to set variable '%s' with Guid %g\n",
|
||||
__FUNCTION__,
|
||||
__func__,
|
||||
VariableName,
|
||||
VendorGuid
|
||||
));
|
||||
@@ -2792,7 +2792,7 @@ VariableServiceSetVariable (
|
||||
DEBUG ((
|
||||
DEBUG_ERROR,
|
||||
"%a: Failed to set variable '%s' with Guid %g\n",
|
||||
__FUNCTION__,
|
||||
__func__,
|
||||
VariableName,
|
||||
VendorGuid
|
||||
));
|
||||
@@ -2814,7 +2814,7 @@ VariableServiceSetVariable (
|
||||
DEBUG ((
|
||||
DEBUG_ERROR,
|
||||
"%a: Failed to set variable '%s' with Guid %g\n",
|
||||
__FUNCTION__,
|
||||
__func__,
|
||||
VariableName,
|
||||
VendorGuid
|
||||
));
|
||||
|
@@ -48,7 +48,7 @@ VariableLockRequestToLock (
|
||||
EFI_STATUS Status;
|
||||
VARIABLE_POLICY_ENTRY *NewPolicy;
|
||||
|
||||
DEBUG ((DEBUG_WARN, "!!! DEPRECATED INTERFACE !!! %a() will go away soon!\n", __FUNCTION__));
|
||||
DEBUG ((DEBUG_WARN, "!!! DEPRECATED INTERFACE !!! %a() will go away soon!\n", __func__));
|
||||
DEBUG ((DEBUG_WARN, "!!! DEPRECATED INTERFACE !!! Please move to use Variable Policy!\n"));
|
||||
DEBUG ((DEBUG_WARN, "!!! DEPRECATED INTERFACE !!! Variable: %g %s\n", VendorGuid, VariableName));
|
||||
|
||||
@@ -85,7 +85,7 @@ VariableLockRequestToLock (
|
||||
}
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((DEBUG_ERROR, "%a - Failed to lock variable %s! %r\n", __FUNCTION__, VariableName, Status));
|
||||
DEBUG ((DEBUG_ERROR, "%a - Failed to lock variable %s! %r\n", __func__, VariableName, Status));
|
||||
}
|
||||
|
||||
if (NewPolicy != NULL) {
|
||||
|
@@ -95,7 +95,7 @@ ProtocolDisableVariablePolicy (
|
||||
PolicyHeader->Command = VAR_CHECK_POLICY_COMMAND_DISABLE;
|
||||
|
||||
Status = InternalMmCommunicate (CommHeader, &BufferSize);
|
||||
DEBUG ((DEBUG_VERBOSE, "%a - MmCommunication returned %r.\n", __FUNCTION__, Status));
|
||||
DEBUG ((DEBUG_VERBOSE, "%a - MmCommunication returned %r.\n", __func__, Status));
|
||||
|
||||
ReleaseLockOnlyAtBootTime (&mMmCommunicationLock);
|
||||
|
||||
@@ -144,7 +144,7 @@ ProtocolIsVariablePolicyEnabled (
|
||||
PolicyHeader->Command = VAR_CHECK_POLICY_COMMAND_IS_ENABLED;
|
||||
|
||||
Status = InternalMmCommunicate (CommHeader, &BufferSize);
|
||||
DEBUG ((DEBUG_VERBOSE, "%a - MmCommunication returned %r.\n", __FUNCTION__, Status));
|
||||
DEBUG ((DEBUG_VERBOSE, "%a - MmCommunication returned %r.\n", __func__, Status));
|
||||
|
||||
if (!EFI_ERROR (Status)) {
|
||||
Status = PolicyHeader->Result;
|
||||
@@ -197,7 +197,7 @@ ProtocolRegisterVariablePolicy (
|
||||
DEBUG ((
|
||||
DEBUG_ERROR,
|
||||
"%a - Policy too large for buffer! %r, %d > %d \n",
|
||||
__FUNCTION__,
|
||||
__func__,
|
||||
Status,
|
||||
RequiredSize,
|
||||
mMmCommunicationBufferSize
|
||||
@@ -222,7 +222,7 @@ ProtocolRegisterVariablePolicy (
|
||||
CopyMem (PolicyBuffer, NewPolicy, NewPolicy->Size);
|
||||
|
||||
Status = InternalMmCommunicate (CommHeader, &BufferSize);
|
||||
DEBUG ((DEBUG_VERBOSE, "%a - MmCommunication returned %r.\n", __FUNCTION__, Status));
|
||||
DEBUG ((DEBUG_VERBOSE, "%a - MmCommunication returned %r.\n", __func__, Status));
|
||||
|
||||
ReleaseLockOnlyAtBootTime (&mMmCommunicationLock);
|
||||
|
||||
@@ -278,7 +278,7 @@ DumpVariablePolicyHelper (
|
||||
CommandParams->PageRequested = PageRequested;
|
||||
|
||||
Status = InternalMmCommunicate (CommHeader, &BufferSize);
|
||||
DEBUG ((DEBUG_VERBOSE, "%a - MmCommunication returned %r.\n", __FUNCTION__, Status));
|
||||
DEBUG ((DEBUG_VERBOSE, "%a - MmCommunication returned %r.\n", __func__, Status));
|
||||
|
||||
if (!EFI_ERROR (Status)) {
|
||||
Status = PolicyHeader->Result;
|
||||
@@ -403,7 +403,7 @@ ProtocolLockVariablePolicy (
|
||||
PolicyHeader->Command = VAR_CHECK_POLICY_COMMAND_LOCK;
|
||||
|
||||
Status = InternalMmCommunicate (CommHeader, &BufferSize);
|
||||
DEBUG ((DEBUG_VERBOSE, "%a - MmCommunication returned %r.\n", __FUNCTION__, Status));
|
||||
DEBUG ((DEBUG_VERBOSE, "%a - MmCommunication returned %r.\n", __func__, Status));
|
||||
|
||||
ReleaseLockOnlyAtBootTime (&mMmCommunicationLock);
|
||||
|
||||
@@ -500,7 +500,7 @@ VariablePolicySmmDxeMain (
|
||||
// Locate the shared comm buffer to use for sending MM commands.
|
||||
Status = InitMmCommonCommBuffer (&mMmCommunicationBufferSize, &mMmCommunicationBuffer);
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((DEBUG_ERROR, "%a - Failed to locate a viable MM comm buffer! %r\n", __FUNCTION__, Status));
|
||||
DEBUG ((DEBUG_ERROR, "%a - Failed to locate a viable MM comm buffer! %r\n", __func__, Status));
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
return Status;
|
||||
}
|
||||
@@ -508,7 +508,7 @@ VariablePolicySmmDxeMain (
|
||||
// Locate the MmCommunication protocol.
|
||||
Status = gBS->LocateProtocol (&gEfiMmCommunication2ProtocolGuid, NULL, (VOID **)&mMmCommunication);
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((DEBUG_ERROR, "%a - Failed to locate MmCommunication protocol! %r\n", __FUNCTION__, Status));
|
||||
DEBUG ((DEBUG_ERROR, "%a - Failed to locate MmCommunication protocol! %r\n", __func__, Status));
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
return Status;
|
||||
}
|
||||
@@ -529,7 +529,7 @@ VariablePolicySmmDxeMain (
|
||||
NULL
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((DEBUG_ERROR, "%a - Failed to install protocol! %r\n", __FUNCTION__, Status));
|
||||
DEBUG ((DEBUG_ERROR, "%a - Failed to install protocol! %r\n", __func__, Status));
|
||||
goto Exit;
|
||||
} else {
|
||||
ProtocolInstalled = TRUE;
|
||||
@@ -551,7 +551,7 @@ VariablePolicySmmDxeMain (
|
||||
&VirtualAddressChangeEvent
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((DEBUG_ERROR, "%a - Failed to create VirtualAddressChange event! %r\n", __FUNCTION__, Status));
|
||||
DEBUG ((DEBUG_ERROR, "%a - Failed to create VirtualAddressChange event! %r\n", __func__, Status));
|
||||
goto Exit;
|
||||
} else {
|
||||
VirtualAddressChangeRegistered = TRUE;
|
||||
|
Reference in New Issue
Block a user