diff options
author | Rebecca Cran <rebecca@bsdio.com> | 2023-04-06 13:50:06 -0600 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2023-04-10 14:19:57 +0000 |
commit | 7b82da70edf7dda2c6f4e853f100df620bd5c0f3 (patch) | |
tree | 25d8d93d558f8cb02342fd2364202d9e48f29deb /MdeModulePkg/Universal | |
parent | 8ba392687b6f7fcb6e333756edd090003c57402e (diff) | |
download | edk2-7b82da70edf7dda2c6f4e853f100df620bd5c0f3.tar.gz edk2-7b82da70edf7dda2c6f4e853f100df620bd5c0f3.tar.bz2 edk2-7b82da70edf7dda2c6f4e853f100df620bd5c0f3.zip |
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>
Diffstat (limited to 'MdeModulePkg/Universal')
14 files changed, 40 insertions, 40 deletions
diff --git a/MdeModulePkg/Universal/CapsulePei/UefiCapsule.c b/MdeModulePkg/Universal/CapsulePei/UefiCapsule.c index cdeffa9113..8e26a7d795 100644 --- a/MdeModulePkg/Universal/CapsulePei/UefiCapsule.c +++ b/MdeModulePkg/Universal/CapsulePei/UefiCapsule.c @@ -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;
}
diff --git a/MdeModulePkg/Universal/CapsulePei/X64/X64Entry.c b/MdeModulePkg/Universal/CapsulePei/X64/X64Entry.c index 05941f9f8d..4085f371ab 100644 --- a/MdeModulePkg/Universal/CapsulePei/X64/X64Entry.c +++ b/MdeModulePkg/Universal/CapsulePei/X64/X64Entry.c @@ -277,7 +277,7 @@ _ModuleEntryPoint ( DEBUG ((
DEBUG_INFO,
"%a() Stack Base: 0x%lx, Stack Size: 0x%lx\n",
- __FUNCTION__,
+ __func__,
EntrypointContext->StackBufferBase,
EntrypointContext->StackBufferLength
));
diff --git a/MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c b/MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c index 098e4fec66..6e10defe59 100644 --- a/MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c +++ b/MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c @@ -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
));
diff --git a/MdeModulePkg/Universal/Disk/UdfDxe/File.c b/MdeModulePkg/Universal/Disk/UdfDxe/File.c index 6cd197046f..ca2f3e0766 100644 --- a/MdeModulePkg/Universal/Disk/UdfDxe/File.c +++ b/MdeModulePkg/Universal/Disk/UdfDxe/File.c @@ -262,7 +262,7 @@ UdfOpen ( DEBUG ((
DEBUG_ERROR,
"%a: GetFileSize() fails with status - %r.\n",
- __FUNCTION__,
+ __func__,
Status
));
goto Error_Get_File_Size;
diff --git a/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c b/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c index 2998c3369c..86020de6e0 100644 --- a/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c +++ b/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c @@ -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;
}
diff --git a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWrite.c b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWrite.c index 53f9aefb2d..10a67767eb 100644 --- a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWrite.c +++ b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWrite.c @@ -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;
}
diff --git a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FtwMisc.c b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FtwMisc.c index f1335870e7..508184f7a0 100644 --- a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FtwMisc.c +++ b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FtwMisc.c @@ -1320,7 +1320,7 @@ InitFtwProtocol ( DEBUG ((
DEBUG_INFO,
"Ftw: Restart working block update in %a() - %r\n",
- __FUNCTION__,
+ __func__,
Status
));
FtwAbort (&FtwDevice->FtwInstance);
diff --git a/MdeModulePkg/Universal/PCD/Dxe/Service.c b/MdeModulePkg/Universal/PCD/Dxe/Service.c index 5ade8d988b..1ae06a639c 100644 --- a/MdeModulePkg/Universal/PCD/Dxe/Service.c +++ b/MdeModulePkg/Universal/PCD/Dxe/Service.c @@ -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;
diff --git a/MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.c b/MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.c index dd077bb0cf..1a86e69d3c 100644 --- a/MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.c +++ b/MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.c @@ -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) {
//
diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/TcgMorLockDxe.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/TcgMorLockDxe.c index 88984c31ab..114d0693fe 100644 --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/TcgMorLockDxe.c +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/TcgMorLockDxe.c @@ -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;
diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/TcgMorLockSmm.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/TcgMorLockSmm.c index 296afd2ec4..da1105ff07 100644 --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/TcgMorLockSmm.c +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/TcgMorLockSmm.c @@ -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);
}
diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c index 3eb7d935b4..7a1331255b 100644 --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c @@ -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
));
diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableLockRequestToLock.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableLockRequestToLock.c index d849ee9ce2..f6bb7284f0 100644 --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableLockRequestToLock.c +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableLockRequestToLock.c @@ -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) {
diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariablePolicySmmDxe.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariablePolicySmmDxe.c index b2094fbcd6..6151a2ba0b 100644 --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariablePolicySmmDxe.c +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariablePolicySmmDxe.c @@ -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;
|