From f2cc962cd28fe75fb4edf230d69e99c346fe9c8a Mon Sep 17 00:00:00 2001 From: Rebecca Cran Date: Thu, 6 Apr 2023 13:45:15 -0600 Subject: ArmPkg: 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 ArmPkg. Signed-off-by: Rebecca Cran Reviewed-by: Michael D Kinney Reviewed-by: Ard Biesheuvel --- ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c | 4 +-- .../ArmPsciResetSystemLib/ArmPsciResetSystemLib.c | 2 +- .../Library/LinuxBootBootManagerLib/LinuxBootBm.c | 2 +- ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c | 32 +++++++++++----------- 4 files changed, 20 insertions(+), 20 deletions(-) (limited to 'ArmPkg/Library') diff --git a/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c b/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c index 7acfd2e..7ed758f 100644 --- a/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c +++ b/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c @@ -139,7 +139,7 @@ ReplaceTableEntry ( (((RegionStart ^ (UINTN)Entry) & ~BlockMask) == 0)) { DisableMmu = TRUE; - DEBUG ((DEBUG_WARN, "%a: splitting block entry with MMU disabled\n", __FUNCTION__)); + DEBUG ((DEBUG_WARN, "%a: splitting block entry with MMU disabled\n", __func__)); } mReplaceLiveEntryFunc (Entry, Value, RegionStart, DisableMmu); @@ -233,7 +233,7 @@ UpdateRegionMappingRecursive ( DEBUG (( DEBUG_VERBOSE, "%a(%d): %llx - %llx set %lx clr %lx\n", - __FUNCTION__, + __func__, Level, RegionStart, RegionEnd, diff --git a/ArmPkg/Library/ArmPsciResetSystemLib/ArmPsciResetSystemLib.c b/ArmPkg/Library/ArmPsciResetSystemLib/ArmPsciResetSystemLib.c index 7bcd348..02b0c27 100644 --- a/ArmPkg/Library/ArmPsciResetSystemLib/ArmPsciResetSystemLib.c +++ b/ArmPkg/Library/ArmPsciResetSystemLib/ArmPsciResetSystemLib.c @@ -65,7 +65,7 @@ LibResetSystem ( ArmCallSmc (&ArmSmcArgs); // We should never be here - DEBUG ((DEBUG_ERROR, "%a: PSCI Reset failed\n", __FUNCTION__)); + DEBUG ((DEBUG_ERROR, "%a: PSCI Reset failed\n", __func__)); CpuDeadLoop (); return EFI_UNSUPPORTED; } diff --git a/ArmPkg/Library/LinuxBootBootManagerLib/LinuxBootBm.c b/ArmPkg/Library/LinuxBootBootManagerLib/LinuxBootBm.c index 5a44af5..75998ea 100644 --- a/ArmPkg/Library/LinuxBootBootManagerLib/LinuxBootBm.c +++ b/ArmPkg/Library/LinuxBootBootManagerLib/LinuxBootBm.c @@ -151,7 +151,7 @@ PlatformBootManagerAfterConsole ( LOAD_OPTION_ACTIVE ); } else { - DEBUG ((DEBUG_ERROR, "%a: PcdLinuxBootFileGuid was not set!\n", __FUNCTION__)); + DEBUG ((DEBUG_ERROR, "%a: PcdLinuxBootFileGuid was not set!\n", __func__)); } } diff --git a/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c b/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c index 2fb1a4a..08998ff 100644 --- a/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c +++ b/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c @@ -195,7 +195,7 @@ FilterAndProcess ( DEBUG (( DEBUG_VERBOSE, "%a: %g: %r\n", - __FUNCTION__, + __func__, ProtocolGuid, Status )); @@ -266,7 +266,7 @@ IsPciDisplay ( &Pci ); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a: %s: %r\n", __FUNCTION__, ReportText, Status)); + DEBUG ((DEBUG_ERROR, "%a: %s: %r\n", __func__, ReportText, Status)); return FALSE; } @@ -330,7 +330,7 @@ Connect ( DEBUG (( EFI_ERROR (Status) ? DEBUG_ERROR : DEBUG_VERBOSE, "%a: %s: %r\n", - __FUNCTION__, + __func__, ReportText, Status )); @@ -356,7 +356,7 @@ AddOutput ( DEBUG (( DEBUG_ERROR, "%a: %s: handle %p: device path not found\n", - __FUNCTION__, + __func__, ReportText, Handle )); @@ -368,7 +368,7 @@ AddOutput ( DEBUG (( DEBUG_ERROR, "%a: %s: adding to ConOut: %r\n", - __FUNCTION__, + __func__, ReportText, Status )); @@ -380,7 +380,7 @@ AddOutput ( DEBUG (( DEBUG_ERROR, "%a: %s: adding to ErrOut: %r\n", - __FUNCTION__, + __func__, ReportText, Status )); @@ -390,7 +390,7 @@ AddOutput ( DEBUG (( DEBUG_VERBOSE, "%a: %s: added to ConOut and ErrOut\n", - __FUNCTION__, + __func__, ReportText )); } @@ -547,7 +547,7 @@ GetPlatformOptions ( DEBUG (( DEBUG_ERROR, "%a: failed to register \"%s\": %r\n", - __FUNCTION__, + __func__, BootOptions[Index].Description, Status )); @@ -575,7 +575,7 @@ GetPlatformOptions ( DEBUG (( DEBUG_ERROR, "%a: failed to register hotkey for \"%s\": %r\n", - __FUNCTION__, + __func__, BootOptions[Index].Description, Status )); @@ -757,7 +757,7 @@ HandleCapsules ( BOOLEAN NeedReset; EFI_STATUS Status; - DEBUG ((DEBUG_INFO, "%a: processing capsules ...\n", __FUNCTION__)); + DEBUG ((DEBUG_INFO, "%a: processing capsules ...\n", __func__)); Status = gBS->LocateProtocol ( &gEsrtManagementProtocolGuid, @@ -785,7 +785,7 @@ HandleCapsules ( DEBUG (( DEBUG_ERROR, "%a: failed to process capsule %p - %r\n", - __FUNCTION__, + __func__, CapsuleHeader, Status )); @@ -800,7 +800,7 @@ HandleCapsules ( DEBUG (( DEBUG_WARN, "%a: capsule update successful, resetting ...\n", - __FUNCTION__ + __func__ )); gRT->ResetSystem (EfiResetCold, EFI_SUCCESS, 0, NULL); @@ -868,7 +868,7 @@ BootDiscoveryPolicyHandler ( DEBUG (( DEBUG_INFO, "%a - Unexpected DiscoveryPolicy (0x%x). Run Minimal Discovery Policy\n", - __FUNCTION__, + __func__, DiscoveryPolicy )); return EFI_SUCCESS; @@ -884,14 +884,14 @@ BootDiscoveryPolicyHandler ( DEBUG_INFO, "%a - Failed to locate gEfiBootManagerPolicyProtocolGuid." "Driver connect will be skipped.\n", - __FUNCTION__ + __func__ )); return Status; } Status = BMPolicy->ConnectDeviceClass (BMPolicy, Class); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a - ConnectDeviceClass returns - %r\n", __FUNCTION__, Status)); + DEBUG ((DEBUG_ERROR, "%a - ConnectDeviceClass returns - %r\n", __func__, Status)); return Status; } @@ -1096,7 +1096,7 @@ PlatformBootManagerUnableToBoot ( DEBUG (( DEBUG_WARN, "%a: rebooting after refreshing all boot options\n", - __FUNCTION__ + __func__ )); gRT->ResetSystem (EfiResetCold, EFI_SUCCESS, 0, NULL); } -- cgit v1.1