summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Library
diff options
context:
space:
mode:
authorRebecca Cran <rebecca@bsdio.com>2023-04-06 13:50:06 -0600
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2023-04-10 14:19:57 +0000
commit7b82da70edf7dda2c6f4e853f100df620bd5c0f3 (patch)
tree25d8d93d558f8cb02342fd2364202d9e48f29deb /MdeModulePkg/Library
parent8ba392687b6f7fcb6e333756edd090003c57402e (diff)
downloadedk2-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/Library')
-rw-r--r--MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleReportLib.c2
-rw-r--r--MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c2
-rw-r--r--MdeModulePkg/Library/ResetUtilityLib/ResetUtility.c2
-rw-r--r--MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c2
-rw-r--r--MdeModulePkg/Library/UefiBootManagerLib/BmDriverHealth.c2
-rw-r--r--MdeModulePkg/Library/VarCheckPolicyLib/VarCheckPolicyLib.c22
-rw-r--r--MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLib.c6
7 files changed, 19 insertions, 19 deletions
diff --git a/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleReportLib.c b/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleReportLib.c
index efc6b4ce26..a1523428cd 100644
--- a/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleReportLib.c
+++ b/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleReportLib.c
@@ -502,7 +502,7 @@ InitCapsuleVariable (
// Locate the VariablePolicy protocol
Status = gBS->LocateProtocol (&gEdkiiVariablePolicyProtocolGuid, NULL, (VOID **)&VariablePolicy);
if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_ERROR, "DxeCapsuleReportLib %a - Could not locate VariablePolicy protocol! %r\n", __FUNCTION__, Status));
+ DEBUG ((DEBUG_ERROR, "DxeCapsuleReportLib %a - Could not locate VariablePolicy protocol! %r\n", __func__, Status));
ASSERT_EFI_ERROR (Status);
}
diff --git a/MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c b/MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c
index 8c7b58b2f9..a6af2e8485 100644
--- a/MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c
+++ b/MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c
@@ -579,7 +579,7 @@ S3BootScriptLibDeinitialize (
return RETURN_SUCCESS;
}
- DEBUG ((DEBUG_INFO, "%a() in %a module\n", __FUNCTION__, gEfiCallerBaseName));
+ DEBUG ((DEBUG_INFO, "%a() in %a module\n", __func__, gEfiCallerBaseName));
if (mEventDxeSmmReadyToLock != NULL) {
//
diff --git a/MdeModulePkg/Library/ResetUtilityLib/ResetUtility.c b/MdeModulePkg/Library/ResetUtilityLib/ResetUtility.c
index 50131a431f..4ca8425705 100644
--- a/MdeModulePkg/Library/ResetUtilityLib/ResetUtility.c
+++ b/MdeModulePkg/Library/ResetUtilityLib/ResetUtility.c
@@ -132,7 +132,7 @@ GetResetPlatformSpecificGuid (
//
if ((ResetDataStringSize < DataSize) && ((DataSize - ResetDataStringSize) >= sizeof (GUID))) {
ResetSubtypeGuid = (GUID *)((UINT8 *)ResetData + ResetDataStringSize);
- DEBUG ((DEBUG_VERBOSE, "%a - Detected reset subtype %g...\n", __FUNCTION__, ResetSubtypeGuid));
+ DEBUG ((DEBUG_VERBOSE, "%a - Detected reset subtype %g...\n", __func__, ResetSubtypeGuid));
return ResetSubtypeGuid;
}
diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
index bde22fa659..c3763c4483 100644
--- a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
+++ b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
@@ -1448,7 +1448,7 @@ BmExpandLoadFile (
"%a:%a: failed to allocate reserved pages: "
"BufferSize=%Lu LoadFile=\"%s\" FilePath=\"%s\"\n",
gEfiCallerBaseName,
- __FUNCTION__,
+ __func__,
(UINT64)BufferSize,
LoadFileText,
FileText
diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmDriverHealth.c b/MdeModulePkg/Library/UefiBootManagerLib/BmDriverHealth.c
index 46a2fa2016..46a8b780e3 100644
--- a/MdeModulePkg/Library/UefiBootManagerLib/BmDriverHealth.c
+++ b/MdeModulePkg/Library/UefiBootManagerLib/BmDriverHealth.c
@@ -581,7 +581,7 @@ BmRepairAllControllers (
DEBUG ((
DEBUG_ERROR,
"[%a:%d] Repair failed after %d retries.\n",
- __FUNCTION__,
+ __func__,
DEBUG_LINE_NUMBER,
ReconnectRepairCount
));
diff --git a/MdeModulePkg/Library/VarCheckPolicyLib/VarCheckPolicyLib.c b/MdeModulePkg/Library/VarCheckPolicyLib/VarCheckPolicyLib.c
index da90f4fc6a..5de46133bb 100644
--- a/MdeModulePkg/Library/VarCheckPolicyLib/VarCheckPolicyLib.c
+++ b/MdeModulePkg/Library/VarCheckPolicyLib/VarCheckPolicyLib.c
@@ -95,7 +95,7 @@ VarCheckPolicyLibMmiHandler (
//
// If either of the pointers are NULL, we can't proceed.
if ((CommBuffer == NULL) || (CommBufferSize == NULL)) {
- DEBUG ((DEBUG_INFO, "%a - Invalid comm buffer pointers!\n", __FUNCTION__));
+ DEBUG ((DEBUG_INFO, "%a - Invalid comm buffer pointers!\n", __func__));
return EFI_INVALID_PARAMETER;
}
@@ -105,14 +105,14 @@ VarCheckPolicyLibMmiHandler (
if ((InternalCommBufferSize > VAR_CHECK_POLICY_MM_COMM_BUFFER_SIZE) ||
!VarCheckPolicyIsBufferOutsideValid ((UINTN)CommBuffer, (UINT64)InternalCommBufferSize))
{
- DEBUG ((DEBUG_ERROR, "%a - Invalid CommBuffer supplied! 0x%016lX[0x%016lX]\n", __FUNCTION__, CommBuffer, InternalCommBufferSize));
+ DEBUG ((DEBUG_ERROR, "%a - Invalid CommBuffer supplied! 0x%016lX[0x%016lX]\n", __func__, CommBuffer, InternalCommBufferSize));
return EFI_INVALID_PARAMETER;
}
// If the size does not meet a minimum threshold, we cannot proceed.
ExpectedSize = sizeof (VAR_CHECK_POLICY_COMM_HEADER);
if (InternalCommBufferSize < ExpectedSize) {
- DEBUG ((DEBUG_INFO, "%a - Bad comm buffer size! %d < %d\n", __FUNCTION__, InternalCommBufferSize, ExpectedSize));
+ DEBUG ((DEBUG_INFO, "%a - Bad comm buffer size! %d < %d\n", __func__, InternalCommBufferSize, ExpectedSize));
return EFI_INVALID_PARAMETER;
}
@@ -128,7 +128,7 @@ VarCheckPolicyLibMmiHandler (
if ((InternalPolicyCommmHeader->Signature != VAR_CHECK_POLICY_COMM_SIG) ||
(InternalPolicyCommmHeader->Revision != VAR_CHECK_POLICY_COMM_REVISION))
{
- DEBUG ((DEBUG_INFO, "%a - Signature or revision are incorrect!\n", __FUNCTION__));
+ DEBUG ((DEBUG_INFO, "%a - Signature or revision are incorrect!\n", __func__));
// We have verified the buffer is not null and have enough size to hold Result field.
PolicyCommmHeader->Result = EFI_INVALID_PARAMETER;
return EFI_SUCCESS;
@@ -157,7 +157,7 @@ VarCheckPolicyLibMmiHandler (
// This add should be safe because these are fixed sizes so far.
ExpectedSize += sizeof (VAR_CHECK_POLICY_COMM_IS_ENABLED_PARAMS);
if (InternalCommBufferSize < ExpectedSize) {
- DEBUG ((DEBUG_INFO, "%a - Bad comm buffer size! %d < %d\n", __FUNCTION__, InternalCommBufferSize, ExpectedSize));
+ DEBUG ((DEBUG_INFO, "%a - Bad comm buffer size! %d < %d\n", __func__, InternalCommBufferSize, ExpectedSize));
PolicyCommmHeader->Result = EFI_INVALID_PARAMETER;
break;
}
@@ -173,7 +173,7 @@ VarCheckPolicyLibMmiHandler (
// This add should be safe because these are fixed sizes so far.
ExpectedSize += sizeof (VARIABLE_POLICY_ENTRY);
if (InternalCommBufferSize < ExpectedSize) {
- DEBUG ((DEBUG_INFO, "%a - Bad comm buffer size! %d < %d\n", __FUNCTION__, InternalCommBufferSize, ExpectedSize));
+ DEBUG ((DEBUG_INFO, "%a - Bad comm buffer size! %d < %d\n", __func__, InternalCommBufferSize, ExpectedSize));
PolicyCommmHeader->Result = EFI_INVALID_PARAMETER;
break;
}
@@ -186,7 +186,7 @@ VarCheckPolicyLibMmiHandler (
EFI_ERROR (SafeUintnAdd (sizeof (VAR_CHECK_POLICY_COMM_HEADER), PolicyEntry->Size, &ExpectedSize)) ||
(InternalCommBufferSize < ExpectedSize))
{
- DEBUG ((DEBUG_INFO, "%a - Bad policy entry contents!\n", __FUNCTION__));
+ DEBUG ((DEBUG_INFO, "%a - Bad policy entry contents!\n", __func__));
PolicyCommmHeader->Result = EFI_INVALID_PARAMETER;
break;
}
@@ -199,7 +199,7 @@ VarCheckPolicyLibMmiHandler (
// This add should be safe because these are fixed sizes so far.
ExpectedSize += sizeof (VAR_CHECK_POLICY_COMM_DUMP_PARAMS) + VAR_CHECK_POLICY_MM_DUMP_BUFFER_SIZE;
if (InternalCommBufferSize < ExpectedSize) {
- DEBUG ((DEBUG_INFO, "%a - Bad comm buffer size! %d < %d\n", __FUNCTION__, InternalCommBufferSize, ExpectedSize));
+ DEBUG ((DEBUG_INFO, "%a - Bad comm buffer size! %d < %d\n", __func__, InternalCommBufferSize, ExpectedSize));
PolicyCommmHeader->Result = EFI_INVALID_PARAMETER;
break;
}
@@ -298,7 +298,7 @@ VarCheckPolicyLibMmiHandler (
default:
// Mark unknown requested command as EFI_UNSUPPORTED.
- DEBUG ((DEBUG_INFO, "%a - Invalid command requested! %d\n", __FUNCTION__, PolicyCommmHeader->Command));
+ DEBUG ((DEBUG_INFO, "%a - Invalid command requested! %d\n", __func__, PolicyCommmHeader->Command));
PolicyCommmHeader->Result = EFI_UNSUPPORTED;
break;
}
@@ -306,7 +306,7 @@ VarCheckPolicyLibMmiHandler (
DEBUG ((
DEBUG_VERBOSE,
"%a - Command %d returning %r.\n",
- __FUNCTION__,
+ __func__,
PolicyCommmHeader->Command,
PolicyCommmHeader->Result
));
@@ -349,7 +349,7 @@ VarCheckPolicyLibCommonConstructor (
}
// Otherwise, there's not much we can do.
else {
- DEBUG ((DEBUG_ERROR, "%a - Cannot Initialize VariablePolicyLib! %r\n", __FUNCTION__, Status));
+ DEBUG ((DEBUG_ERROR, "%a - Cannot Initialize VariablePolicyLib! %r\n", __func__, Status));
ASSERT_EFI_ERROR (Status);
}
diff --git a/MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLib.c b/MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLib.c
index 82dae67ef5..214f76ab96 100644
--- a/MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLib.c
+++ b/MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLib.c
@@ -521,7 +521,7 @@ ValidateSetVariable (
DEBUG ((
DEBUG_VERBOSE,
"%a - Bad Size. 0x%X <> 0x%X-0x%X\n",
- __FUNCTION__,
+ __func__,
DataSize,
ActivePolicy->MinSize,
ActivePolicy->MaxSize
@@ -537,7 +537,7 @@ ValidateSetVariable (
DEBUG ((
DEBUG_VERBOSE,
"%a - Bad Attributes. 0x%X <> 0x%X:0x%X\n",
- __FUNCTION__,
+ __func__,
Attributes,
ActivePolicy->AttributesMustHave,
ActivePolicy->AttributesCantHave
@@ -598,7 +598,7 @@ ValidateSetVariable (
}
Exit:
- DEBUG ((DEBUG_VERBOSE, "%a - Variable (%g:%s) returning %r.\n", __FUNCTION__, VendorGuid, VariableName, ReturnStatus));
+ DEBUG ((DEBUG_VERBOSE, "%a - Variable (%g:%s) returning %r.\n", __func__, VendorGuid, VariableName, ReturnStatus));
return ReturnStatus;
}