public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH 00/18] Replace pre-standard macro __FUNCTION__ with C99 __func__ throughout edk2
@ 2023-04-06 22:23 Rebecca Cran
  2023-04-06 22:23 ` [PATCH 01/18] ArmPkg: Update code to be more C11 compliant by using __func__ Rebecca Cran
                   ` (20 more replies)
  0 siblings, 21 replies; 34+ messages in thread
From: Rebecca Cran @ 2023-04-06 22:23 UTC (permalink / raw)
  To: devel, Liming Gao, Michael D Kinney, Guomin Jiang, Wei6 Xu,
	Guo Dong, Ray Ni, Sean Rhodes, James Lu, Gua Guo, Andrew Fish,
	Hao A Wu, Maciej Rabeda, Siyuan Fu, Jiewen Yao, Jian J Wang,
	Xiaoyu Lu, Ard Biesheuvel, Sami Mujawar, Supreeth Venkatesh,
	Michael Kubacki, Nate DeSimone, Sean Brogan
  Cc: Rebecca Cran, Leif Lindholm, Abner Chang, Nickle Wang,
	Igor Kulchytskyy, Daniel Schaefer, Min Xu, Jordan Justen,
	Gerd Hoffmann, Peter Grehan, Erdem Aktas, James Bottomley,
	Tom Lendacky, Michael Roth, Sunil V L, Andrei Warkentin

Following on from commit b17a3a133b18fb41493fba7d86e9b5804ea6a8cf which
updated MdePkg to be more C11 compliant by replacing the pre-standard
__FUNCTION__ with __func__ which was introduced in C99, this patch
series updates the remaining packages in edk2.

The changes were generated by using "Replace in Files" in VS Code.

GitHub branch: https://github.com/bcran/edk2/tree/c99func
GitHub PR:     https://github.com/tianocore/edk2/pull/4247

Rebecca Cran (18):
  ArmPkg: Update code to be more C11 compliant by using __func__
  ArmVirtPkg: Update code to be more C11 compliant by using __func__
  UefiCpuPkg: Update code to be more C11 compliant by using __func__
  OvmfPkg: Update code to be more C11 compliant by using __func__
  MdeModulePkg: Update code to be more C11 compliant by using __func__
  SecurityPkg: Update code to be more C11 compliant by using __func__
  EmbeddedPkg: Update code to be more C11 compliant by using __func__
  RedfishPkg: Update code to be more C11 compliant by using __func__
  ArmPlatformPkg: Update code to be more C11 compliant by using __func__
  UnitTestFrameworkPkg: Update to be more C11 compliant by using
    __func__
  PrmPkg: Update code to be more C11 compliant by using __func__
  StandaloneMmPkg: Update code to be more C11 compliant by using
    __func__
  CryptoPkg: Update code to be more C11 compliant by using __func__
  NetworkPkg: Update code to be more C11 compliant by using __func__
  SourceLevelDebugPkg: Update code to be more C11 compliant by using
    __func__
  EmulatorPkg: Update code to be more C11 compliant by using __func__
  UefiPayloadPkg: Update code to be more C11 compliant by using __func__
  FmpDevicePkg: Update code to be more C11 compliant by using __func__

 ArmPkg/Drivers/ArmGic/ArmGicCommonDxe.c                                                                      |  4 +-
 ArmPkg/Drivers/CpuDxe/MemoryAttribute.c                                                                      | 10 +--
 ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c                                                             |  4 +-
 ArmPkg/Library/ArmPsciResetSystemLib/ArmPsciResetSystemLib.c                                                 |  2 +-
 ArmPkg/Library/LinuxBootBootManagerLib/LinuxBootBm.c                                                         |  2 +-
 ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c                                                           | 32 +++++-----
 ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c                                             |  2 +-
 ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c                                        |  2 +-
 ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c                                |  2 +-
 ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c                             |  2 +-
 ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type03/MiscChassisManufacturerFunction.c                               |  2 +-
 ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type13/MiscNumberOfInstallableLanguagesFunction.c                      |  2 +-
 ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type32/MiscBootInformationFunction.c                                   |  2 +-
 ArmPlatformPkg/Drivers/SP805WatchdogDxe/SP805Watchdog.c                                                      |  4 +-
 ArmVirtPkg/CloudHvAcpiPlatformDxe/CloudHvAcpi.c                                                              |  4 +-
 ArmVirtPkg/Library/ArmVirtGicArchLib/ArmVirtGicArchLib.c                                                     |  2 +-
 ArmVirtPkg/Library/ArmVirtPL031FdtClientLib/ArmVirtPL031FdtClientLib.c                                       |  4 +-
 ArmVirtPkg/Library/ArmVirtPsciResetSystemLib/ArmVirtPsciResetSystemLib.c                                     |  6 +-
 ArmVirtPkg/Library/ArmVirtPsciResetSystemPeiLib/ArmVirtPsciResetSystemPeiLib.c                               |  6 +-
 ArmVirtPkg/Library/CloudHvVirtMemInfoLib/CloudHvVirtMemInfoLib.c                                             | 10 +--
 ArmVirtPkg/Library/KvmtoolRtcFdtClientLib/KvmtoolRtcFdtClientLib.c                                           |  4 +-
 ArmVirtPkg/Library/KvmtoolVirtMemInfoLib/KvmtoolVirtMemInfoLib.c                                             |  2 +-
 ArmVirtPkg/Library/NorFlashKvmtoolLib/NorFlashKvmtool.c                                                      |  4 +-
 ArmVirtPkg/Library/NorFlashQemuLib/NorFlashQemuLib.c                                                         |  2 +-
 ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c                                                       | 20 +++---
 ArmVirtPkg/Library/PlatformBootManagerLib/QemuKernel.c                                                       |  2 +-
 ArmVirtPkg/Library/PlatformPeiLib/PlatformPeiLib.c                                                           |  6 +-
 ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoLib.c                                                   |  4 +-
 ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoPeiLibConstructor.c                                     |  4 +-
 ArmVirtPkg/XenAcpiPlatformDxe/XenAcpiPlatformDxe.c                                                           |  4 +-
 ArmVirtPkg/XenioFdtDxe/XenioFdtDxe.c                                                                         |  4 +-
 CryptoPkg/Library/TlsLib/TlsConfig.c                                                                         |  8 +--
 CryptoPkg/Library/TlsLib/TlsProcess.c                                                                        |  4 +-
 EmbeddedPkg/Drivers/ConsolePrefDxe/ConsolePrefDxe.c                                                          | 18 +++---
 EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.c                                                            | 10 +--
 EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.c                                                              | 22 +++----
 EmbeddedPkg/Library/NonCoherentDmaLib/NonCoherentDmaLib.c                                                    |  2 +-
 EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClock.c                                                          |  2 +-
 EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c                                                             | 20 +++---
 EmulatorPkg/Library/RedfishPlatformHostInterfaceLib/RedfishPlatformHostInterfaceLib.c                        |  2 +-
 EmulatorPkg/Win/Host/WinPacketFilter.c                                                                       |  2 +-
 FmpDevicePkg/FmpDxe/VariableSupport.c                                                                        |  2 +-
 MdeModulePkg/Bus/Ata/AhciPei/AhciMode.c                                                                      | 38 ++++++------
 MdeModulePkg/Bus/Ata/AhciPei/AhciPei.c                                                                       | 18 +++---
 MdeModulePkg/Bus/Ata/AhciPei/AhciPeiBlockIo.c                                                                |  2 +-
 MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c                                                                          |  2 +-
 MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.c                                                                     |  4 +-
 MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceIo.c                                |  2 +-
 MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressBlockIo.c                                                       |  8 +--
 MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPei.c                                                           | 36 +++++------
 MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPeiBlockIo.c                                                    |  6 +-
 MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPeiHci.c                                                        | 34 +++++------
 MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPeiPassThru.c                                                   | 24 ++++----
 MdeModulePkg/Bus/Pci/PciBusDxe/PciCommand.c                                                                  |  2 +-
 MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridge.c                                                        | 14 ++---
 MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c                                                           |  6 +-
 MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c                                                             | 12 ++--
 MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c                                                                          |  2 +-
 MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c                                                                     |  4 +-
 MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c                                                                 |  6 +-
 MdeModulePkg/Core/Dxe/Dispatcher/Dispatcher.c                                                                |  2 +-
 MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c                                                                      |  2 +-
 MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c                                                                |  6 +-
 MdeModulePkg/Core/Dxe/SectionExtraction/CoreSectionExtraction.c                                              |  2 +-
 MdeModulePkg/Core/DxeIplPeim/Ia32/DxeLoadFunc.c                                                              |  4 +-
 MdeModulePkg/Core/DxeIplPeim/RiscV64/DxeLoadFunc.c                                                           |  4 +-
 MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c                                                                |  2 +-
 MdeModulePkg/Core/Pei/FwVol/FwVol.c                                                                          |  2 +-
 MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleReportLib.c                                                  |  2 +-
 MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c                                                   |  2 +-
 MdeModulePkg/Library/ResetUtilityLib/ResetUtility.c                                                          |  2 +-
 MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c                                                             |  2 +-
 MdeModulePkg/Library/UefiBootManagerLib/BmDriverHealth.c                                                     |  2 +-
 MdeModulePkg/Library/VarCheckPolicyLib/VarCheckPolicyLib.c                                                   | 22 +++----
 MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLib.c                                                   |  6 +-
 MdeModulePkg/Universal/CapsulePei/UefiCapsule.c                                                              |  8 +--
 MdeModulePkg/Universal/CapsulePei/X64/X64Entry.c                                                             |  2 +-
 MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c                                                               | 10 +--
 MdeModulePkg/Universal/Disk/UdfDxe/File.c                                                                    |  2 +-
 MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c                                                    |  2 +-
 MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWrite.c                                            |  6 +-
 MdeModulePkg/Universal/FaultTolerantWriteDxe/FtwMisc.c                                                       |  2 +-
 MdeModulePkg/Universal/PCD/Dxe/Service.c                                                                     |  2 +-
 MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.c                                                                 |  4 +-
 MdeModulePkg/Universal/Variable/RuntimeDxe/TcgMorLockDxe.c                                                   |  6 +-
 MdeModulePkg/Universal/Variable/RuntimeDxe/TcgMorLockSmm.c                                                   |  6 +-
 MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c                                                        |  6 +-
 MdeModulePkg/Universal/Variable/RuntimeDxe/VariableLockRequestToLock.c                                       |  4 +-
 MdeModulePkg/Universal/Variable/RuntimeDxe/VariablePolicySmmDxe.c                                            | 20 +++---
 NetworkPkg/HttpDxe/HttpsSupport.c                                                                            | 16 ++---
 NetworkPkg/IScsiDxe/IScsiMisc.c                                                                              |  4 +-
 OvmfPkg/AcpiPlatformDxe/BootScript.c                                                                         |  4 +-
 OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c                                                                        |  4 +-
 OvmfPkg/AcpiPlatformDxe/EntryPoint.c                                                                         |  8 +--
 OvmfPkg/AcpiPlatformDxe/PciDecoding.c                                                                        | 10 +--
 OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c                                                                      | 64 ++++++++++----------
 OvmfPkg/AmdSev/BlobVerifierLibSevHashes/BlobVerifierSevHashes.c                                              | 18 +++---
 OvmfPkg/AmdSevDxe/AmdSevDxe.c                                                                                |  2 +-
 OvmfPkg/Bhyve/AcpiPlatformDxe/EntryPoint.c                                                                   |  8 +--
 OvmfPkg/Bhyve/AcpiPlatformDxe/PciDecoding.c                                                                  | 10 +--
 OvmfPkg/Bhyve/BhyveRfbDxe/VbeShim.c                                                                          |  6 +-
 OvmfPkg/Bhyve/PlatformPei/ClearCache.c                                                                       |  6 +-
 OvmfPkg/Bhyve/PlatformPei/MemDetect.c                                                                        | 12 ++--
 OvmfPkg/Bhyve/PlatformPei/Platform.c                                                                         | 10 +--
 OvmfPkg/CpuHotplugSmm/CpuHotplug.c                                                                           | 40 ++++++------
 OvmfPkg/CpuHotplugSmm/QemuCpuhp.c                                                                            | 32 +++++-----
 OvmfPkg/CpuHotplugSmm/Smbase.c                                                                               | 10 +--
 OvmfPkg/CpuS3DataDxe/CpuS3Data.c                                                                             |  2 +-
 OvmfPkg/Csm/CsmSupportLib/LegacyInterrupt.c                                                                  |  2 +-
 OvmfPkg/Csm/CsmSupportLib/LegacyRegion.c                                                                     |  2 +-
 OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.c                                                                |  2 +-
 OvmfPkg/Fdt/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c                                                        | 28 ++++-----
 OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.c                                                      |  4 +-
 OvmfPkg/Fdt/HighMemDxe/HighMemDxe.c                                                                          | 10 +--
 OvmfPkg/Fdt/VirtioFdtDxe/VirtioFdtDxe.c                                                                      | 10 +--
 OvmfPkg/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.c                                       |  2 +-
 OvmfPkg/IoMmuDxe/CcIoMmu.c                                                                                   | 18 +++---
 OvmfPkg/IoMmuDxe/IoMmuBuffer.c                                                                               |  8 +--
 OvmfPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.c                                                              |  2 +-
 OvmfPkg/Library/AcpiTimerLib/BaseRomAcpiTimerLib.c                                                           |  4 +-
 OvmfPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.c                                                               |  2 +-
 OvmfPkg/Library/BaseMemEncryptSevLib/X64/PeiDxeVirtualMemory.c                                               | 22 +++----
 OvmfPkg/Library/BaseMemEncryptSevLib/X64/SnpPageStateChangeInternal.c                                        |  4 +-
 OvmfPkg/Library/BaseMemEncryptTdxLib/MemoryEncryption.c                                                      | 26 ++++----
 OvmfPkg/Library/BasePciCapLib/BasePciCapLib.c                                                                |  4 +-
 OvmfPkg/Library/CcExitLib/CcExitVeHandler.c                                                                  | 18 +++---
 OvmfPkg/Library/GenericQemuLoadImageLib/GenericQemuLoadImageLib.c                                            |  6 +-
 OvmfPkg/Library/HardwareInfoLib/HardwareInfoDxe.c                                                            |  2 +-
 OvmfPkg/Library/LockBoxLib/LockBoxLib.c                                                                      | 10 +--
 OvmfPkg/Library/PciHostBridgeUtilityLib/PciHostBridgeUtilityLib.c                                            | 22 +++----
 OvmfPkg/Library/PeilessStartupLib/X64/VirtualMemory.c                                                        |  2 +-
 OvmfPkg/Library/PlatformBmPrintScLib/StatusCodeHandler.c                                                     | 12 ++--
 OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c                                                         | 12 ++--
 OvmfPkg/Library/PlatformBootManagerLib/QemuKernel.c                                                          |  2 +-
 OvmfPkg/Library/PlatformBootManagerLibBhyve/BdsPlatform.c                                                    | 10 +--
 OvmfPkg/Library/PlatformBootManagerLibGrub/BdsPlatform.c                                                     | 10 +--
 OvmfPkg/Library/PlatformBootManagerLibGrub/QemuKernel.c                                                      |  2 +-
 OvmfPkg/Library/PlatformInitLib/MemDetect.c                                                                  | 28 ++++-----
 OvmfPkg/Library/PlatformInitLib/Platform.c                                                                   | 20 +++---
 OvmfPkg/Library/QemuBootOrderLib/ExtraRootBusMap.c                                                           |  2 +-
 OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.c                                                          | 42 ++++++-------
 OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgDxe.c                                                                  | 18 +++---
 OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMmio.c                                                              |  2 +-
 OvmfPkg/Library/QemuFwCfgS3Lib/QemuFwCfgS3Dxe.c                                                              | 34 +++++------
 OvmfPkg/Library/ResetSystemLib/DxeResetSystemLibMicrovm.c                                                    |  8 +--
 OvmfPkg/Library/ResetSystemLib/ResetSystemLibMicrovm.c                                                       |  8 +--
 OvmfPkg/Library/SerializeVariablesLib/SerializeVariablesLib.c                                                |  4 +-
 OvmfPkg/Library/SmbiosVersionLib/DetectSmbiosVersionLib.c                                                    |  4 +-
 OvmfPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c                                                        |  4 +-
 OvmfPkg/Library/TlsAuthConfigLib/TlsAuthConfigLib.c                                                          | 24 ++++----
 OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDevice.c                                                       |  4 +-
 OvmfPkg/Library/X86QemuLoadImageLib/X86QemuLoadImageLib.c                                                    |  8 +--
 OvmfPkg/Library/XenIoMmioLib/XenIoMmioLib.c                                                                  |  4 +-
 OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.c                                      |  2 +-
 OvmfPkg/LsiScsiDxe/LsiScsi.c                                                                                 |  4 +-
 OvmfPkg/MptScsiDxe/MptScsi.c                                                                                 | 10 +--
 OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.c                                                                   |  6 +-
 OvmfPkg/PlatformDxe/Platform.c                                                                               | 14 ++---
 OvmfPkg/PlatformPei/ClearCache.c                                                                             |  6 +-
 OvmfPkg/PlatformPei/FeatureControl.c                                                                         |  6 +-
 OvmfPkg/PlatformPei/MemDetect.c                                                                              | 12 ++--
 OvmfPkg/PlatformPei/MemTypeInfo.c                                                                            | 10 +--
 OvmfPkg/PlatformPei/Platform.c                                                                               | 18 +++---
 OvmfPkg/PvScsiDxe/PvScsi.c                                                                                   |  4 +-
 OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c                                                        | 12 ++--
 OvmfPkg/QemuRamfbDxe/QemuRamfb.c                                                                             |  2 +-
 OvmfPkg/QemuVideoDxe/Gop.c                                                                                   |  2 +-
 OvmfPkg/QemuVideoDxe/Initialize.c                                                                            | 14 ++---
 OvmfPkg/QemuVideoDxe/VbeShim.c                                                                               | 12 ++--
 OvmfPkg/RiscVVirt/Library/PlatformBootManagerLib/PlatformBm.c                                                | 20 +++---
 OvmfPkg/RiscVVirt/Library/PlatformBootManagerLib/QemuKernel.c                                                |  2 +-
 OvmfPkg/RiscVVirt/Library/PrePiHobListPointerLib/PrePiHobListPointer.c                                       |  4 +-
 OvmfPkg/RiscVVirt/Sec/Memory.c                                                                               | 10 +--
 OvmfPkg/RiscVVirt/Sec/Platform.c                                                                             | 12 ++--
 OvmfPkg/RiscVVirt/Sec/SecMain.c                                                                              |  2 +-
 OvmfPkg/Sec/SecMain.c                                                                                        |  2 +-
 OvmfPkg/SmmAccess/SmmAccessPei.c                                                                             |  6 +-
 OvmfPkg/SmmControl2Dxe/SmiFeatures.c                                                                         | 22 +++----
 OvmfPkg/SmmControl2Dxe/SmmControl2Dxe.c                                                                      | 18 +++---
 OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPeim.c                                                                      |  8 +--
 OvmfPkg/Tcg/TpmMmioSevDecryptPei/TpmMmioSevDecryptPeim.c                                                     |  6 +-
 OvmfPkg/TdxDxe/TdxAcpiTable.c                                                                                |  2 +-
 OvmfPkg/VirtNorFlashDxe/VirtNorFlashDxe.c                                                                    |  4 +-
 OvmfPkg/VirtNorFlashDxe/VirtNorFlashFvb.c                                                                    | 22 +++----
 OvmfPkg/VirtioBlkDxe/VirtioBlk.c                                                                             |  8 +--
 OvmfPkg/VirtioFsDxe/FuseFlush.c                                                                              |  2 +-
 OvmfPkg/VirtioFsDxe/FuseFsync.c                                                                              |  2 +-
 OvmfPkg/VirtioFsDxe/FuseGetAttr.c                                                                            |  2 +-
 OvmfPkg/VirtioFsDxe/FuseInit.c                                                                               |  2 +-
 OvmfPkg/VirtioFsDxe/FuseLookup.c                                                                             |  2 +-
 OvmfPkg/VirtioFsDxe/FuseMkDir.c                                                                              |  2 +-
 OvmfPkg/VirtioFsDxe/FuseOpen.c                                                                               |  2 +-
 OvmfPkg/VirtioFsDxe/FuseOpenDir.c                                                                            |  2 +-
 OvmfPkg/VirtioFsDxe/FuseOpenOrCreate.c                                                                       |  2 +-
 OvmfPkg/VirtioFsDxe/FuseRead.c                                                                               |  2 +-
 OvmfPkg/VirtioFsDxe/FuseRelease.c                                                                            |  2 +-
 OvmfPkg/VirtioFsDxe/FuseRename.c                                                                             |  2 +-
 OvmfPkg/VirtioFsDxe/FuseSetAttr.c                                                                            |  2 +-
 OvmfPkg/VirtioFsDxe/FuseStatFs.c                                                                             |  2 +-
 OvmfPkg/VirtioFsDxe/FuseUnlink.c                                                                             |  2 +-
 OvmfPkg/VirtioFsDxe/FuseWrite.c                                                                              |  2 +-
 OvmfPkg/VirtioFsDxe/Helpers.c                                                                                |  2 +-
 OvmfPkg/VirtioFsDxe/SimpleFsOpen.c                                                                           |  4 +-
 OvmfPkg/VirtioGpuDxe/Commands.c                                                                              |  6 +-
 OvmfPkg/VirtioGpuDxe/DriverBinding.c                                                                         |  8 +--
 OvmfPkg/VirtioGpuDxe/Gop.c                                                                                   |  2 +-
 OvmfPkg/VirtioNetDxe/Events.c                                                                                |  2 +-
 OvmfPkg/VirtioRngDxe/VirtioRng.c                                                                             |  2 +-
 OvmfPkg/VirtioScsiDxe/VirtioScsi.c                                                                           |  2 +-
 OvmfPkg/XenAcpiPlatformDxe/Xen.c                                                                             |  2 +-
 OvmfPkg/XenPlatformPei/ClearCache.c                                                                          |  6 +-
 OvmfPkg/XenPlatformPei/MemDetect.c                                                                           |  6 +-
 OvmfPkg/XenPlatformPei/Platform.c                                                                            |  2 +-
 OvmfPkg/XenPvBlkDxe/BlockFront.c                                                                             |  4 +-
 PrmPkg/Application/PrmInfo/PrmInfo.c                                                                         |  6 +-
 PrmPkg/Library/DxePrmContextBufferLib/DxePrmContextBufferLib.c                                               | 10 +--
 PrmPkg/Library/DxePrmContextBufferLib/UnitTest/DxePrmContextBufferLibUnitTest.c                              |  2 +-
 PrmPkg/Library/DxePrmModuleDiscoveryLib/DxePrmModuleDiscoveryLib.c                                           | 14 ++---
 PrmPkg/Library/DxePrmPeCoffLib/DxePrmPeCoffLib.c                                                             | 40 ++++++------
 PrmPkg/PrmConfigDxe/PrmConfigDxe.c                                                                           | 44 +++++++-------
 PrmPkg/PrmLoaderDxe/PrmLoaderDxe.c                                                                           | 22 +++----
 PrmPkg/PrmSsdtInstallDxe/PrmSsdtInstallDxe.c                                                                 |  4 +-
 RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfaceBmcUsbNicLib.c                     | 36 +++++------
 RedfishPkg/Library/RedfishPlatformCredentialIpmiLib/RedfishPlatformCredentialIpmiLib.c                       | 28 ++++-----
 RedfishPkg/PrivateLibrary/RedfishLib/RedfishLib.c                                                            |  2 +-
 RedfishPkg/PrivateLibrary/RedfishLib/edk2libredfish/src/service.c                                            |  4 +-
 RedfishPkg/RedfishConfigHandler/RedfishConfigHandlerCommon.c                                                 |  6 +-
 RedfishPkg/RedfishConfigHandler/RedfishConfigHandlerDriver.c                                                 | 20 +++---
 RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c                                                           | 62 +++++++++----------
 RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.c                                                 | 14 ++---
 RedfishPkg/RedfishRestExDxe/RedfishRestExImpl.c                                                              | 14 ++---
 SecurityPkg/HddPassword/HddPasswordDxe.c                                                                     | 44 +++++++-------
 SecurityPkg/HddPassword/HddPasswordPei.c                                                                     | 10 +--
 SecurityPkg/Library/AuthVariableLib/AuthService.c                                                            |  4 +-
 SecurityPkg/Library/PeiDxeTpmPlatformHierarchyLib/PeiDxeTpmPlatformHierarchyLib.c                            |  6 +-
 SecurityPkg/Library/PlatformPKProtectionLibVarPolicy/PlatformPKProtectionLibVarPolicy.c                      |  2 +-
 SecurityPkg/Library/SecureBootVariableLib/SecureBootVariableLib.c                                            | 38 ++++++------
 SecurityPkg/Library/SecureBootVariableLib/UnitTest/SecureBootVariableLibUnitTest.c                           |  4 +-
 SecurityPkg/Library/SecureBootVariableProvisionLib/SecureBootVariableProvisionLib.c                          |  2 +-
 SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c                                                               | 24 ++++----
 SecurityPkg/Tcg/Opal/OpalPassword/OpalHii.c                                                                  |  8 +--
 SecurityPkg/Tcg/Opal/OpalPassword/OpalPasswordPei.c                                                          | 10 +--
 SecurityPkg/Tcg/Tcg2Acpi/Tcg2Acpi.c                                                                          | 12 ++--
 SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c                                                                            | 10 +--
 SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c                                                                            | 22 +++----
 SecurityPkg/Tcg/TdTcg2Dxe/TdTcg2Dxe.c                                                                        |  6 +-
 SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.c                                 |  2 +-
 SecurityPkg/VariableAuthenticated/SecureBootDefaultKeysDxe/SecureBootDefaultKeysDxe.c                        | 14 ++---
 SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCommunicationLibUsb3Dxe.c                         |  4 +-
 SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCommunicationLibUsb3Pei.c                         |  2 +-
 StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/SetPermissions.c                                      | 22 +++----
 StandaloneMmPkg/Library/StandaloneMmMemLib/X86StandaloneMmMemLibInternal.c                                   |  2 +-
 StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/AArch64/StandaloneMmPeCoffExtraActionLib.c          | 16 ++---
 UefiCpuPkg/CpuDxe/CpuDxe.c                                                                                   |  8 +--
 UefiCpuPkg/CpuDxeRiscV64/CpuDxe.c                                                                            |  6 +-
 UefiCpuPkg/CpuS3DataDxe/CpuS3Data.c                                                                          |  2 +-
 UefiCpuPkg/Library/BaseRiscV64CpuExceptionHandlerLib/CpuExceptionHandlerLib.c                                |  2 +-
 UefiCpuPkg/Library/CpuExceptionHandlerLib/UnitTest/CpuExceptionHandlerTestCommon.c                           |  2 +-
 UefiCpuPkg/Library/MpInitLib/DxeMpLib.c                                                                      |  2 +-
 UefiCpuPkg/Library/MpInitLib/Microcode.c                                                                     |  8 +--
 UefiCpuPkg/Library/MpInitLib/MpLib.c                                                                         |  2 +-
 UefiCpuPkg/Library/MpInitLib/PeiMpLib.c                                                                      |  2 +-
 UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c                                                                            |  2 +-
 UefiCpuPkg/SecCore/SecMain.c                                                                                 | 10 +--
 UefiCpuPkg/Test/UnitTest/EfiMpServicesPpiProtocol/EfiMpServicesUnitTestCommom.c                              | 16 ++---
 UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c                                                            |  2 +-
 UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c                                                   |  4 +-
 UefiPayloadPkg/UefiPayloadEntry/Ia32/DxeLoadFunc.c                                                           |  2 +-
 UnitTestFrameworkPkg/Library/UnitTestBootLibUsbClass/UnitTestBootLibUsbClass.c                               | 12 ++--
 UnitTestFrameworkPkg/Library/UnitTestLib/Log.c                                                               |  2 +-
 UnitTestFrameworkPkg/Library/UnitTestLib/UnitTestLib.c                                                       |  4 +-
 UnitTestFrameworkPkg/Library/UnitTestPersistenceLibSimpleFileSystem/UnitTestPersistenceLibSimpleFileSystem.c | 26 ++++----
 UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultReportLib.c                               |  2 +-
 UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultReportLibConOut.c                         |  2 +-
 UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultReportLibDebugLib.c                       |  2 +-
 275 files changed, 1213 insertions(+), 1213 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH 01/18] ArmPkg: Update code to be more C11 compliant by using __func__
  2023-04-06 22:23 [PATCH 00/18] Replace pre-standard macro __FUNCTION__ with C99 __func__ throughout edk2 Rebecca Cran
@ 2023-04-06 22:23 ` Rebecca Cran
  2023-04-07 20:18   ` [edk2-devel] " Michael D Kinney
  2023-04-06 22:23 ` [PATCH 02/18] ArmVirtPkg: " Rebecca Cran
                   ` (19 subsequent siblings)
  20 siblings, 1 reply; 34+ messages in thread
From: Rebecca Cran @ 2023-04-06 22:23 UTC (permalink / raw)
  To: devel, Liming Gao, Michael D Kinney, Guomin Jiang, Wei6 Xu,
	Guo Dong, Ray Ni, Sean Rhodes, James Lu, Gua Guo, Andrew Fish,
	Hao A Wu, Maciej Rabeda, Siyuan Fu, Jiewen Yao, Jian J Wang,
	Xiaoyu Lu, Ard Biesheuvel, Sami Mujawar, Supreeth Venkatesh,
	Michael Kubacki, Nate DeSimone, Sean Brogan
  Cc: Rebecca Cran, Leif Lindholm, Abner Chang, Nickle Wang,
	Igor Kulchytskyy, Daniel Schaefer, Min Xu, Jordan Justen,
	Gerd Hoffmann, Peter Grehan, Erdem Aktas, James Bottomley,
	Tom Lendacky, Michael Roth, Sunil V L, Andrei Warkentin

__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.

Visual Studio versions before VS 2015 don't support __func__ and so
will fail to compile. A workaround is to define __func__ as
__FUNCTION__ :

  #define __func__ __FUNCTION__

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
---
 ArmPkg/Drivers/ArmGic/ArmGicCommonDxe.c                                                 |  4 +--
 ArmPkg/Drivers/CpuDxe/MemoryAttribute.c                                                 | 10 +++---
 ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c                                        |  4 +--
 ArmPkg/Library/ArmPsciResetSystemLib/ArmPsciResetSystemLib.c                            |  2 +-
 ArmPkg/Library/LinuxBootBootManagerLib/LinuxBootBm.c                                    |  2 +-
 ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c                                      | 32 ++++++++++----------
 ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c                        |  2 +-
 ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c                   |  2 +-
 ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c           |  2 +-
 ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c        |  2 +-
 ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type03/MiscChassisManufacturerFunction.c          |  2 +-
 ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type13/MiscNumberOfInstallableLanguagesFunction.c |  2 +-
 ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type32/MiscBootInformationFunction.c              |  2 +-
 13 files changed, 34 insertions(+), 34 deletions(-)

diff --git a/ArmPkg/Drivers/ArmGic/ArmGicCommonDxe.c b/ArmPkg/Drivers/ArmGic/ArmGicCommonDxe.c
index cd12fcda27e9..d560c42fc9f3 100644
--- a/ArmPkg/Drivers/ArmGic/ArmGicCommonDxe.c
+++ b/ArmPkg/Drivers/ArmGic/ArmGicCommonDxe.c
@@ -137,7 +137,7 @@ CpuArchEventProtocolNotify (
     DEBUG ((
       DEBUG_ERROR,
       "%a: Cpu->RegisterInterruptHandler() - %r\n",
-      __FUNCTION__,
+      __func__,
       Status
       ));
     return;
@@ -153,7 +153,7 @@ CpuArchEventProtocolNotify (
     DEBUG ((
       DEBUG_ERROR,
       "%a: Cpu->RegisterInterruptHandler() - %r\n",
-      __FUNCTION__,
+      __func__,
       Status
       ));
   }
diff --git a/ArmPkg/Drivers/CpuDxe/MemoryAttribute.c b/ArmPkg/Drivers/CpuDxe/MemoryAttribute.c
index cbc8261a68b7..61ba8fbbae4e 100644
--- a/ArmPkg/Drivers/CpuDxe/MemoryAttribute.c
+++ b/ArmPkg/Drivers/CpuDxe/MemoryAttribute.c
@@ -92,7 +92,7 @@ GetMemoryAttributes (
   DEBUG ((
     DEBUG_VERBOSE,
     "%a: BaseAddress == 0x%lx, Length == 0x%lx\n",
-    __FUNCTION__,
+    __func__,
     BaseAddress,
     Length
     ));
@@ -113,7 +113,7 @@ GetMemoryAttributes (
     DEBUG ((
       DEBUG_VERBOSE,
       "%a: RegionAddress == 0x%lx, RegionLength == 0x%lx, RegionAttributes == 0x%lx\n",
-      __FUNCTION__,
+      __func__,
       (UINT64)RegionAddress,
       (UINT64)RegionLength,
       (UINT64)RegionAttributes
@@ -130,7 +130,7 @@ GetMemoryAttributes (
   DEBUG ((
     DEBUG_VERBOSE,
     "%a: Union == %lx, Intersection == %lx\n",
-    __FUNCTION__,
+    __func__,
     (UINT64)Union,
     (UINT64)Intersection
     ));
@@ -188,7 +188,7 @@ SetMemoryAttributes (
   DEBUG ((
     DEBUG_INFO,
     "%a: BaseAddress == 0x%lx, Length == 0x%lx, Attributes == 0x%lx\n",
-    __FUNCTION__,
+    __func__,
     (UINTN)BaseAddress,
     (UINTN)Length,
     (UINTN)Attributes
@@ -272,7 +272,7 @@ ClearMemoryAttributes (
   DEBUG ((
     DEBUG_INFO,
     "%a: BaseAddress == 0x%lx, Length == 0x%lx, Attributes == 0x%lx\n",
-    __FUNCTION__,
+    __func__,
     (UINTN)BaseAddress,
     (UINTN)Length,
     (UINTN)Attributes
diff --git a/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c b/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c
index 7acfd2e89a92..7ed758fbbc69 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 7bcd34849507..02b0c27e4df3 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 5a44af5a755d..75998eabb1c6 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 2fb1a4aa4fb8..08998ffe4d17 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);
     }
diff --git a/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c b/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c
index 3b12e26abf6e..905058850056 100644
--- a/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c
+++ b/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c
@@ -741,7 +741,7 @@ AddSmbiosProcessorTypeTable (
     DEBUG ((
       DEBUG_ERROR,
       "[%a]:[%dL] Smbios Type04 Table Log Failed! %r \n",
-      __FUNCTION__,
+      __func__,
       DEBUG_LINE_NUMBER,
       Status
       ));
diff --git a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c
index c9f25b750254..38f3864b160e 100644
--- a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c
+++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c
@@ -287,7 +287,7 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscBiosVendor) {
     DEBUG ((
       DEBUG_ERROR,
       "[%a]:[%dL] Smbios Type00 Table Log Failed! %r \n",
-      __FUNCTION__,
+      __func__,
       DEBUG_LINE_NUMBER,
       Status
       ));
diff --git a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c
index 22fb5eccaa63..8867de4815a2 100644
--- a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c
+++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c
@@ -184,7 +184,7 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscSystemManufacturer) {
     DEBUG ((
       DEBUG_ERROR,
       "[%a]:[%dL] Smbios Type01 Table Log Failed! %r \n",
-      __FUNCTION__,
+      __func__,
       DEBUG_LINE_NUMBER,
       Status
       ));
diff --git a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c
index 3441e7798860..feb42e6f5dee 100644
--- a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c
+++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c
@@ -214,7 +214,7 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscBaseBoardManufacturer) {
     DEBUG ((
       DEBUG_ERROR,
       "[%a]:[%dL] Smbios Type02 Table Log Failed! %r \n",
-      __FUNCTION__,
+      __func__,
       DEBUG_LINE_NUMBER,
       Status
       ));
diff --git a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type03/MiscChassisManufacturerFunction.c b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type03/MiscChassisManufacturerFunction.c
index d161970c023e..6b3b63b0e8d5 100644
--- a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type03/MiscChassisManufacturerFunction.c
+++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type03/MiscChassisManufacturerFunction.c
@@ -179,7 +179,7 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscChassisManufacturer) {
     DEBUG ((
       DEBUG_ERROR,
       "[%a]:[%dL] Smbios Type03 Table Log Failed! %r \n",
-      __FUNCTION__,
+      __func__,
       DEBUG_LINE_NUMBER,
       Status
       ));
diff --git a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type13/MiscNumberOfInstallableLanguagesFunction.c b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type13/MiscNumberOfInstallableLanguagesFunction.c
index 386b8800e29b..951ac2a905b6 100644
--- a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type13/MiscNumberOfInstallableLanguagesFunction.c
+++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type13/MiscNumberOfInstallableLanguagesFunction.c
@@ -161,7 +161,7 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscNumberOfInstallableLanguages) {
     DEBUG ((
       DEBUG_ERROR,
       "[%a]:[%dL] Smbios Type13 Table Log Failed! %r \n",
-      __FUNCTION__,
+      __func__,
       DEBUG_LINE_NUMBER,
       Status
       ));
diff --git a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type32/MiscBootInformationFunction.c b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type32/MiscBootInformationFunction.c
index fdf6262aa7f5..fa1ea95f2bc3 100644
--- a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type32/MiscBootInformationFunction.c
+++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type32/MiscBootInformationFunction.c
@@ -69,7 +69,7 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscBootInformation) {
     DEBUG ((
       DEBUG_ERROR,
       "[%a]:[%dL] Smbios Type32 Table Log Failed! %r \n",
-      __FUNCTION__,
+      __func__,
       DEBUG_LINE_NUMBER,
       Status
       ));
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 02/18] ArmVirtPkg: Update code to be more C11 compliant by using __func__
  2023-04-06 22:23 [PATCH 00/18] Replace pre-standard macro __FUNCTION__ with C99 __func__ throughout edk2 Rebecca Cran
  2023-04-06 22:23 ` [PATCH 01/18] ArmPkg: Update code to be more C11 compliant by using __func__ Rebecca Cran
@ 2023-04-06 22:23 ` Rebecca Cran
  2023-04-06 22:23 ` [PATCH 03/18] UefiCpuPkg: " Rebecca Cran
                   ` (18 subsequent siblings)
  20 siblings, 0 replies; 34+ messages in thread
From: Rebecca Cran @ 2023-04-06 22:23 UTC (permalink / raw)
  To: devel, Liming Gao, Michael D Kinney, Guomin Jiang, Wei6 Xu,
	Guo Dong, Ray Ni, Sean Rhodes, James Lu, Gua Guo, Andrew Fish,
	Hao A Wu, Maciej Rabeda, Siyuan Fu, Jiewen Yao, Jian J Wang,
	Xiaoyu Lu, Ard Biesheuvel, Sami Mujawar, Supreeth Venkatesh,
	Michael Kubacki, Nate DeSimone, Sean Brogan
  Cc: Rebecca Cran, Leif Lindholm, Abner Chang, Nickle Wang,
	Igor Kulchytskyy, Daniel Schaefer, Min Xu, Jordan Justen,
	Gerd Hoffmann, Peter Grehan, Erdem Aktas, James Bottomley,
	Tom Lendacky, Michael Roth, Sunil V L, Andrei Warkentin

__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
ArmVirtPkg.

Visual Studio versions before VS 2015 don't support __func__ and so
will fail to compile. A workaround is to define __func__ as
__FUNCTION__ :

  #define __func__ __FUNCTION__

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
---
 ArmVirtPkg/CloudHvAcpiPlatformDxe/CloudHvAcpi.c                                |  4 ++--
 ArmVirtPkg/Library/ArmVirtGicArchLib/ArmVirtGicArchLib.c                       |  2 +-
 ArmVirtPkg/Library/ArmVirtPL031FdtClientLib/ArmVirtPL031FdtClientLib.c         |  4 ++--
 ArmVirtPkg/Library/ArmVirtPsciResetSystemLib/ArmVirtPsciResetSystemLib.c       |  6 +++---
 ArmVirtPkg/Library/ArmVirtPsciResetSystemPeiLib/ArmVirtPsciResetSystemPeiLib.c |  6 +++---
 ArmVirtPkg/Library/CloudHvVirtMemInfoLib/CloudHvVirtMemInfoLib.c               | 10 +++++-----
 ArmVirtPkg/Library/KvmtoolRtcFdtClientLib/KvmtoolRtcFdtClientLib.c             |  4 ++--
 ArmVirtPkg/Library/KvmtoolVirtMemInfoLib/KvmtoolVirtMemInfoLib.c               |  2 +-
 ArmVirtPkg/Library/NorFlashKvmtoolLib/NorFlashKvmtool.c                        |  4 ++--
 ArmVirtPkg/Library/NorFlashQemuLib/NorFlashQemuLib.c                           |  2 +-
 ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c                         | 20 ++++++++++----------
 ArmVirtPkg/Library/PlatformBootManagerLib/QemuKernel.c                         |  2 +-
 ArmVirtPkg/Library/PlatformPeiLib/PlatformPeiLib.c                             |  6 +++---
 ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoLib.c                     |  4 ++--
 ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoPeiLibConstructor.c       |  4 ++--
 ArmVirtPkg/XenAcpiPlatformDxe/XenAcpiPlatformDxe.c                             |  4 ++--
 ArmVirtPkg/XenioFdtDxe/XenioFdtDxe.c                                           |  4 ++--
 17 files changed, 44 insertions(+), 44 deletions(-)

diff --git a/ArmVirtPkg/CloudHvAcpiPlatformDxe/CloudHvAcpi.c b/ArmVirtPkg/CloudHvAcpiPlatformDxe/CloudHvAcpi.c
index 0595b0e1d384..254aa978c67a 100644
--- a/ArmVirtPkg/CloudHvAcpiPlatformDxe/CloudHvAcpi.c
+++ b/ArmVirtPkg/CloudHvAcpiPlatformDxe/CloudHvAcpi.c
@@ -106,7 +106,7 @@ InstallCloudHvAcpiTables (
   } // while
 
   if (DsdtPtr == NULL) {
-    DEBUG ((DEBUG_ERROR, "%a: no DSDT found\n", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a: no DSDT found\n", __func__));
     return EFI_NOT_FOUND;
   }
 
@@ -151,7 +151,7 @@ CloudHvAcpiPlatformEntryPoint (
     DEBUG ((
       DEBUG_ERROR,
       "%a: Fail to install Acpi table: %r\n",
-      __FUNCTION__,
+      __func__,
       Status
       ));
     CpuDeadLoop ();
diff --git a/ArmVirtPkg/Library/ArmVirtGicArchLib/ArmVirtGicArchLib.c b/ArmVirtPkg/Library/ArmVirtGicArchLib/ArmVirtGicArchLib.c
index 57bbfd20d03c..cf9434e534b5 100644
--- a/ArmVirtPkg/Library/ArmVirtGicArchLib/ArmVirtGicArchLib.c
+++ b/ArmVirtPkg/Library/ArmVirtGicArchLib/ArmVirtGicArchLib.c
@@ -150,7 +150,7 @@ ArmVirtGicArchLibConstructor (
       break;
 
     default:
-      DEBUG ((DEBUG_ERROR, "%a: No GIC revision specified!\n", __FUNCTION__));
+      DEBUG ((DEBUG_ERROR, "%a: No GIC revision specified!\n", __func__));
       return RETURN_NOT_FOUND;
   }
 
diff --git a/ArmVirtPkg/Library/ArmVirtPL031FdtClientLib/ArmVirtPL031FdtClientLib.c b/ArmVirtPkg/Library/ArmVirtPL031FdtClientLib/ArmVirtPL031FdtClientLib.c
index 45dd9f179c6a..01bcd58d30e9 100644
--- a/ArmVirtPkg/Library/ArmVirtPL031FdtClientLib/ArmVirtPL031FdtClientLib.c
+++ b/ArmVirtPkg/Library/ArmVirtPL031FdtClientLib/ArmVirtPL031FdtClientLib.c
@@ -42,7 +42,7 @@ ArmVirtPL031FdtClientLibConstructor (
     DEBUG ((
       DEBUG_WARN,
       "%a: No 'arm,pl031' compatible DT node found\n",
-      __FUNCTION__
+      __func__
       ));
     return EFI_SUCCESS;
   }
@@ -58,7 +58,7 @@ ArmVirtPL031FdtClientLibConstructor (
     DEBUG ((
       DEBUG_WARN,
       "%a: No 'reg' property found in 'arm,pl031' compatible DT node\n",
-      __FUNCTION__
+      __func__
       ));
     return EFI_SUCCESS;
   }
diff --git a/ArmVirtPkg/Library/ArmVirtPsciResetSystemLib/ArmVirtPsciResetSystemLib.c b/ArmVirtPkg/Library/ArmVirtPsciResetSystemLib/ArmVirtPsciResetSystemLib.c
index c7065b7ec5c1..1f27b7648d16 100644
--- a/ArmVirtPkg/Library/ArmVirtPsciResetSystemLib/ArmVirtPsciResetSystemLib.c
+++ b/ArmVirtPkg/Library/ArmVirtPsciResetSystemLib/ArmVirtPsciResetSystemLib.c
@@ -65,7 +65,7 @@ ArmPsciResetSystemLibConstructor (
     DEBUG ((
       DEBUG_ERROR,
       "%a: Unknown PSCI method \"%a\"\n",
-      __FUNCTION__,
+      __func__,
       Prop
       ));
     return EFI_NOT_FOUND;
@@ -105,7 +105,7 @@ ResetCold (
       break;
 
     default:
-      DEBUG ((DEBUG_ERROR, "%a: no PSCI method defined\n", __FUNCTION__));
+      DEBUG ((DEBUG_ERROR, "%a: no PSCI method defined\n", __func__));
   }
 }
 
@@ -154,7 +154,7 @@ ResetShutdown (
       break;
 
     default:
-      DEBUG ((DEBUG_ERROR, "%a: no PSCI method defined\n", __FUNCTION__));
+      DEBUG ((DEBUG_ERROR, "%a: no PSCI method defined\n", __func__));
   }
 }
 
diff --git a/ArmVirtPkg/Library/ArmVirtPsciResetSystemPeiLib/ArmVirtPsciResetSystemPeiLib.c b/ArmVirtPkg/Library/ArmVirtPsciResetSystemPeiLib/ArmVirtPsciResetSystemPeiLib.c
index 03d14fe4325d..dffc1fb9790b 100644
--- a/ArmVirtPkg/Library/ArmVirtPsciResetSystemPeiLib/ArmVirtPsciResetSystemPeiLib.c
+++ b/ArmVirtPkg/Library/ArmVirtPsciResetSystemPeiLib/ArmVirtPsciResetSystemPeiLib.c
@@ -73,7 +73,7 @@ DiscoverPsciMethod (
         DEBUG ((
           DEBUG_ERROR,
           "%a: Missing PSCI method property\n",
-          __FUNCTION__
+          __func__
           ));
         return PsciMethodUnknown;
       }
@@ -86,7 +86,7 @@ DiscoverPsciMethod (
         DEBUG ((
           DEBUG_ERROR,
           "%a: Unknown PSCI method \"%a\"\n",
-          __FUNCTION__,
+          __func__,
           Prop
           ));
         return PsciMethodUnknown;
@@ -119,7 +119,7 @@ PerformPsciAction (
       break;
 
     default:
-      DEBUG ((DEBUG_ERROR, "%a: no PSCI method defined\n", __FUNCTION__));
+      DEBUG ((DEBUG_ERROR, "%a: no PSCI method defined\n", __func__));
       ASSERT (FALSE);
   }
 }
diff --git a/ArmVirtPkg/Library/CloudHvVirtMemInfoLib/CloudHvVirtMemInfoLib.c b/ArmVirtPkg/Library/CloudHvVirtMemInfoLib/CloudHvVirtMemInfoLib.c
index 28a0c0b0785f..98cc13870599 100644
--- a/ArmVirtPkg/Library/CloudHvVirtMemInfoLib/CloudHvVirtMemInfoLib.c
+++ b/ArmVirtPkg/Library/CloudHvVirtMemInfoLib/CloudHvVirtMemInfoLib.c
@@ -98,7 +98,7 @@ CloudHvVirtMemInfoPeiLibConstructor (
         DEBUG ((
           DEBUG_INFO,
           "%a: System RAM @ 0x%lx - 0x%lx\n",
-          __FUNCTION__,
+          __func__,
           CurBase,
           CurBase + CurSize - 1
           ));
@@ -124,7 +124,7 @@ CloudHvVirtMemInfoPeiLibConstructor (
           DEBUG ((
             DEBUG_WARN,
             "%a: memory node larger than %d will not be included into Memory System\n",
-            __FUNCTION__,
+            __func__,
             CLOUDHV_MAX_MEM_NODE_NUM
             ));
           break;
@@ -133,7 +133,7 @@ CloudHvVirtMemInfoPeiLibConstructor (
         DEBUG ((
           DEBUG_ERROR,
           "%a: Failed to parse FDT memory node\n",
-          __FUNCTION__
+          __func__
           ));
       }
     }
@@ -186,7 +186,7 @@ ArmVirtGetMemoryMap (
                          );
 
   if (VirtualMemoryTable == NULL) {
-    DEBUG ((DEBUG_ERROR, "%a: Error: Failed AllocatePool()\n", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a: Error: Failed AllocatePool()\n", __func__));
     return;
   }
 
@@ -205,7 +205,7 @@ ArmVirtGetMemoryMap (
       "\tPhysicalBase: 0x%lX\n"
       "\tVirtualBase: 0x%lX\n"
       "\tLength: 0x%lX\n",
-      __FUNCTION__,
+      __func__,
       MemNodeIndex,
       VirtualMemoryTable[Index].PhysicalBase,
       VirtualMemoryTable[Index].VirtualBase,
diff --git a/ArmVirtPkg/Library/KvmtoolRtcFdtClientLib/KvmtoolRtcFdtClientLib.c b/ArmVirtPkg/Library/KvmtoolRtcFdtClientLib/KvmtoolRtcFdtClientLib.c
index 89eee757d141..e8d3576a71cf 100644
--- a/ArmVirtPkg/Library/KvmtoolRtcFdtClientLib/KvmtoolRtcFdtClientLib.c
+++ b/ArmVirtPkg/Library/KvmtoolRtcFdtClientLib/KvmtoolRtcFdtClientLib.c
@@ -147,7 +147,7 @@ KvmtoolRtcFdtClientLibConstructor (
     DEBUG ((
       DEBUG_ERROR,
       "%a: No 'motorola,mc146818' compatible DT node found\n",
-      __FUNCTION__
+      __func__
       ));
     return Status;
   }
@@ -163,7 +163,7 @@ KvmtoolRtcFdtClientLibConstructor (
     DEBUG ((
       DEBUG_ERROR,
       "%a: No 'reg' property found in 'motorola,mc146818' compatible DT node\n",
-      __FUNCTION__
+      __func__
       ));
     return Status;
   }
diff --git a/ArmVirtPkg/Library/KvmtoolVirtMemInfoLib/KvmtoolVirtMemInfoLib.c b/ArmVirtPkg/Library/KvmtoolVirtMemInfoLib/KvmtoolVirtMemInfoLib.c
index 29122856b6e8..79412897f225 100644
--- a/ArmVirtPkg/Library/KvmtoolVirtMemInfoLib/KvmtoolVirtMemInfoLib.c
+++ b/ArmVirtPkg/Library/KvmtoolVirtMemInfoLib/KvmtoolVirtMemInfoLib.c
@@ -54,7 +54,7 @@ ArmVirtGetMemoryMap (
     DEBUG ((
       DEBUG_ERROR,
       "%a: Error: Failed to Allocate Pages\n",
-      __FUNCTION__
+      __func__
       ));
     return;
   }
diff --git a/ArmVirtPkg/Library/NorFlashKvmtoolLib/NorFlashKvmtool.c b/ArmVirtPkg/Library/NorFlashKvmtoolLib/NorFlashKvmtool.c
index 129c16b7110c..43f5858644b1 100644
--- a/ArmVirtPkg/Library/NorFlashKvmtoolLib/NorFlashKvmtool.c
+++ b/ArmVirtPkg/Library/NorFlashKvmtoolLib/NorFlashKvmtool.c
@@ -265,7 +265,7 @@ NorFlashPlatformLibConstructor (
       DEBUG ((
         DEBUG_ERROR,
         "%a: GetNodeProperty ('label') failed (Status == %r)\n",
-        __FUNCTION__,
+        __func__,
         Status
         ));
     } else if (AsciiStrCmp (Label, LABEL_UEFI_VAR_STORE) == 0) {
@@ -284,7 +284,7 @@ NorFlashPlatformLibConstructor (
       DEBUG ((
         DEBUG_ERROR,
         "%a: GetNodeProperty () failed (Status == %r)\n",
-        __FUNCTION__,
+        __func__,
         Status
         ));
       continue;
diff --git a/ArmVirtPkg/Library/NorFlashQemuLib/NorFlashQemuLib.c b/ArmVirtPkg/Library/NorFlashQemuLib/NorFlashQemuLib.c
index 55bce88bc8dd..d0fa7e5046c9 100644
--- a/ArmVirtPkg/Library/NorFlashQemuLib/NorFlashQemuLib.c
+++ b/ArmVirtPkg/Library/NorFlashQemuLib/NorFlashQemuLib.c
@@ -75,7 +75,7 @@ VirtNorFlashPlatformGetDevices (
       DEBUG ((
         DEBUG_ERROR,
         "%a: GetNodeProperty () failed (Status == %r)\n",
-        __FUNCTION__,
+        __func__,
         Status
         ));
       continue;
diff --git a/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c b/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c
index 3ad1ecd9d286..10c815378cd5 100644
--- a/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c
+++ b/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c
@@ -190,7 +190,7 @@ FilterAndProcess (
     DEBUG ((
       DEBUG_VERBOSE,
       "%a: %g: %r\n",
-      __FUNCTION__,
+      __func__,
       ProtocolGuid,
       Status
       ));
@@ -261,7 +261,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;
   }
 
@@ -410,7 +410,7 @@ IsVirtioPciRng (
   return FALSE;
 
 PciError:
-  DEBUG ((DEBUG_ERROR, "%a: %s: %r\n", __FUNCTION__, ReportText, Status));
+  DEBUG ((DEBUG_ERROR, "%a: %s: %r\n", __func__, ReportText, Status));
   return FALSE;
 }
 
@@ -437,7 +437,7 @@ Connect (
   DEBUG ((
     EFI_ERROR (Status) ? DEBUG_ERROR : DEBUG_VERBOSE,
     "%a: %s: %r\n",
-    __FUNCTION__,
+    __func__,
     ReportText,
     Status
     ));
@@ -463,7 +463,7 @@ AddOutput (
     DEBUG ((
       DEBUG_ERROR,
       "%a: %s: handle %p: device path not found\n",
-      __FUNCTION__,
+      __func__,
       ReportText,
       Handle
       ));
@@ -475,7 +475,7 @@ AddOutput (
     DEBUG ((
       DEBUG_ERROR,
       "%a: %s: adding to ConOut: %r\n",
-      __FUNCTION__,
+      __func__,
       ReportText,
       Status
       ));
@@ -487,7 +487,7 @@ AddOutput (
     DEBUG ((
       DEBUG_ERROR,
       "%a: %s: adding to ErrOut: %r\n",
-      __FUNCTION__,
+      __func__,
       ReportText,
       Status
       ));
@@ -497,7 +497,7 @@ AddOutput (
   DEBUG ((
     DEBUG_VERBOSE,
     "%a: %s: added to ConOut and ErrOut\n",
-    __FUNCTION__,
+    __func__,
     ReportText
     ));
 }
@@ -698,7 +698,7 @@ RemoveStaleFvFileOptions (
     DEBUG ((
       EFI_ERROR (Status) ? DEBUG_WARN : DEBUG_VERBOSE,
       "%a: removing stale Boot#%04x %s: %r\n",
-      __FUNCTION__,
+      __func__,
       (UINT32)BootOptions[Index].OptionNumber,
       DevicePathString == NULL ? L"<unavailable>" : DevicePathString,
       Status
@@ -878,7 +878,7 @@ PlatformBootManagerBeforeConsole (
   DEBUG ((
     EFI_ERROR (Status) ? DEBUG_ERROR : DEBUG_VERBOSE,
     "%a: SetVariable(%s, %u): %r\n",
-    __FUNCTION__,
+    __func__,
     EFI_TIME_OUT_VARIABLE_NAME,
     FrontPageTimeout,
     Status
diff --git a/ArmVirtPkg/Library/PlatformBootManagerLib/QemuKernel.c b/ArmVirtPkg/Library/PlatformBootManagerLib/QemuKernel.c
index c66b7c7b21fc..7dc59ae14d90 100644
--- a/ArmVirtPkg/Library/PlatformBootManagerLib/QemuKernel.c
+++ b/ArmVirtPkg/Library/PlatformBootManagerLib/QemuKernel.c
@@ -66,7 +66,7 @@ TryRunningQemuKernel (
     DEBUG ((
       DEBUG_ERROR,
       "%a: QemuStartKernelImage(): %r\n",
-      __FUNCTION__,
+      __func__,
       Status
       ));
   }
diff --git a/ArmVirtPkg/Library/PlatformPeiLib/PlatformPeiLib.c b/ArmVirtPkg/Library/PlatformPeiLib/PlatformPeiLib.c
index bb71fee64920..8d9dcf504dc6 100644
--- a/ArmVirtPkg/Library/PlatformPeiLib/PlatformPeiLib.c
+++ b/ArmVirtPkg/Library/PlatformPeiLib/PlatformPeiLib.c
@@ -111,7 +111,7 @@ PlatformPeim (
 
         UartBase = fdt64_to_cpu (ReadUnaligned64 (RegProp));
 
-        DEBUG ((DEBUG_INFO, "%a: PL011 UART @ 0x%lx\n", __FUNCTION__, UartBase));
+        DEBUG ((DEBUG_INFO, "%a: PL011 UART @ 0x%lx\n", __func__, UartBase));
 
         *UartHobData = UartBase;
         break;
@@ -148,7 +148,7 @@ PlatformPeim (
               DEBUG ((
                 DEBUG_WARN,
                 "%a: 'ranges' property has unexpected size %d\n",
-                __FUNCTION__,
+                __func__,
                 RangesLen
                 ));
               break;
@@ -175,7 +175,7 @@ PlatformPeim (
 
   if (FeaturePcdGet (PcdTpm2SupportEnabled)) {
     if (TpmBase != 0) {
-      DEBUG ((DEBUG_INFO, "%a: TPM @ 0x%lx\n", __FUNCTION__, TpmBase));
+      DEBUG ((DEBUG_INFO, "%a: TPM @ 0x%lx\n", __func__, TpmBase));
 
       Status = (EFI_STATUS)PcdSet64S (PcdTpmBaseAddress, TpmBase);
       ASSERT_EFI_ERROR (Status);
diff --git a/ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoLib.c b/ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoLib.c
index 9cf43f06c073..23bd0fe68ef7 100644
--- a/ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoLib.c
+++ b/ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoLib.c
@@ -83,7 +83,7 @@ ArmVirtGetMemoryMap (
                          );
 
   if (VirtualMemoryTable == NULL) {
-    DEBUG ((DEBUG_ERROR, "%a: Error: Failed AllocatePool()\n", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a: Error: Failed AllocatePool()\n", __func__));
     return;
   }
 
@@ -99,7 +99,7 @@ ArmVirtGetMemoryMap (
     "\tPhysicalBase: 0x%lX\n"
     "\tVirtualBase: 0x%lX\n"
     "\tLength: 0x%lX\n",
-    __FUNCTION__,
+    __func__,
     VirtualMemoryTable[0].PhysicalBase,
     VirtualMemoryTable[0].VirtualBase,
     VirtualMemoryTable[0].Length
diff --git a/ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoPeiLibConstructor.c b/ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoPeiLibConstructor.c
index c47ab8296622..1bcc2e26aa60 100644
--- a/ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoPeiLibConstructor.c
+++ b/ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoPeiLibConstructor.c
@@ -64,7 +64,7 @@ QemuVirtMemInfoPeiLibConstructor (
         DEBUG ((
           DEBUG_INFO,
           "%a: System RAM @ 0x%lx - 0x%lx\n",
-          __FUNCTION__,
+          __func__,
           CurBase,
           CurBase + CurSize - 1
           ));
@@ -77,7 +77,7 @@ QemuVirtMemInfoPeiLibConstructor (
         DEBUG ((
           DEBUG_ERROR,
           "%a: Failed to parse FDT memory node\n",
-          __FUNCTION__
+          __func__
           ));
       }
     }
diff --git a/ArmVirtPkg/XenAcpiPlatformDxe/XenAcpiPlatformDxe.c b/ArmVirtPkg/XenAcpiPlatformDxe/XenAcpiPlatformDxe.c
index 96bc442f6912..32c8b1e94ed2 100644
--- a/ArmVirtPkg/XenAcpiPlatformDxe/XenAcpiPlatformDxe.c
+++ b/ArmVirtPkg/XenAcpiPlatformDxe/XenAcpiPlatformDxe.c
@@ -68,7 +68,7 @@ GetXenArmAcpiRsdp (
     DEBUG ((
       DEBUG_WARN,
       "%a: No 'xen,guest-acpi' compatible DT node found\n",
-      __FUNCTION__
+      __func__
       ));
     return EFI_NOT_FOUND;
   }
@@ -140,7 +140,7 @@ InstallXenArmTables (
   //
   Status = GetXenArmAcpiRsdp (&XenAcpiRsdpStructurePtr);
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_INFO, "%a: No RSDP table found\n", __FUNCTION__));
+    DEBUG ((DEBUG_INFO, "%a: No RSDP table found\n", __func__));
     return Status;
   }
 
diff --git a/ArmVirtPkg/XenioFdtDxe/XenioFdtDxe.c b/ArmVirtPkg/XenioFdtDxe/XenioFdtDxe.c
index 23d504cc64da..f626c455c411 100644
--- a/ArmVirtPkg/XenioFdtDxe/XenioFdtDxe.c
+++ b/ArmVirtPkg/XenioFdtDxe/XenioFdtDxe.c
@@ -49,7 +49,7 @@ InitializeXenioFdtDxe (
     DEBUG ((
       DEBUG_WARN,
       "%a: No 'xen,xen' compatible DT node found\n",
-      __FUNCTION__
+      __func__
       ));
     return EFI_UNSUPPORTED;
   }
@@ -70,7 +70,7 @@ InitializeXenioFdtDxe (
       DEBUG_ERROR,
       "%a: XenIoMmioInstall () failed on a new handle "
       "(Status == %r)\n",
-      __FUNCTION__,
+      __func__,
       Status
       ));
     return Status;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 03/18] UefiCpuPkg: Update code to be more C11 compliant by using __func__
  2023-04-06 22:23 [PATCH 00/18] Replace pre-standard macro __FUNCTION__ with C99 __func__ throughout edk2 Rebecca Cran
  2023-04-06 22:23 ` [PATCH 01/18] ArmPkg: Update code to be more C11 compliant by using __func__ Rebecca Cran
  2023-04-06 22:23 ` [PATCH 02/18] ArmVirtPkg: " Rebecca Cran
@ 2023-04-06 22:23 ` Rebecca Cran
  2023-04-07  3:09   ` Ni, Ray
  2023-04-07 11:24   ` Sunil V L
  2023-04-06 22:23 ` [PATCH 04/18] OvmfPkg: " Rebecca Cran
                   ` (17 subsequent siblings)
  20 siblings, 2 replies; 34+ messages in thread
From: Rebecca Cran @ 2023-04-06 22:23 UTC (permalink / raw)
  To: devel, Liming Gao, Michael D Kinney, Guomin Jiang, Wei6 Xu,
	Guo Dong, Ray Ni, Sean Rhodes, James Lu, Gua Guo, Andrew Fish,
	Hao A Wu, Maciej Rabeda, Siyuan Fu, Jiewen Yao, Jian J Wang,
	Xiaoyu Lu, Ard Biesheuvel, Sami Mujawar, Supreeth Venkatesh,
	Michael Kubacki, Nate DeSimone, Sean Brogan
  Cc: Rebecca Cran, Leif Lindholm, Abner Chang, Nickle Wang,
	Igor Kulchytskyy, Daniel Schaefer, Min Xu, Jordan Justen,
	Gerd Hoffmann, Peter Grehan, Erdem Aktas, James Bottomley,
	Tom Lendacky, Michael Roth, Sunil V L, Andrei Warkentin

__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
UefiCpuPkg.

Visual Studio versions before VS 2015 don't support __func__ and so
will fail to compile. A workaround is to define __func__ as
__FUNCTION__ :

  #define __func__ __FUNCTION__

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
---
 UefiCpuPkg/CpuDxe/CpuDxe.c                                                         |  8 ++++----
 UefiCpuPkg/CpuDxeRiscV64/CpuDxe.c                                                  |  6 +++---
 UefiCpuPkg/CpuS3DataDxe/CpuS3Data.c                                                |  2 +-
 UefiCpuPkg/Library/BaseRiscV64CpuExceptionHandlerLib/CpuExceptionHandlerLib.c      |  2 +-
 UefiCpuPkg/Library/CpuExceptionHandlerLib/UnitTest/CpuExceptionHandlerTestCommon.c |  2 +-
 UefiCpuPkg/Library/MpInitLib/DxeMpLib.c                                            |  2 +-
 UefiCpuPkg/Library/MpInitLib/Microcode.c                                           |  8 ++++----
 UefiCpuPkg/Library/MpInitLib/MpLib.c                                               |  2 +-
 UefiCpuPkg/Library/MpInitLib/PeiMpLib.c                                            |  2 +-
 UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c                                                  |  2 +-
 UefiCpuPkg/SecCore/SecMain.c                                                       | 10 +++++-----
 UefiCpuPkg/Test/UnitTest/EfiMpServicesPpiProtocol/EfiMpServicesUnitTestCommom.c    | 16 ++++++++--------
 UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c                                  |  2 +-
 13 files changed, 32 insertions(+), 32 deletions(-)

diff --git a/UefiCpuPkg/CpuDxe/CpuDxe.c b/UefiCpuPkg/CpuDxe/CpuDxe.c
index 3febd59d99e0..804ef5d1fe8e 100644
--- a/UefiCpuPkg/CpuDxe/CpuDxe.c
+++ b/UefiCpuPkg/CpuDxe/CpuDxe.c
@@ -1078,7 +1078,7 @@ IntersectMemoryDescriptor (
       EFI_ERROR (Status) ? DEBUG_ERROR : DEBUG_VERBOSE,
       "%a: %a: add [%Lx, %Lx): %r\n",
       gEfiCallerBaseName,
-      __FUNCTION__,
+      __func__,
       IntersectionBase,
       IntersectionEnd,
       Status
@@ -1091,7 +1091,7 @@ IntersectMemoryDescriptor (
     "%a: %a: desc [%Lx, %Lx) type %u cap %Lx conflicts "
     "with aperture [%Lx, %Lx) cap %Lx\n",
     gEfiCallerBaseName,
-    __FUNCTION__,
+    __func__,
     Descriptor->BaseAddress,
     Descriptor->BaseAddress + Descriptor->Length,
     (UINT32)Descriptor->GcdMemoryType,
@@ -1132,7 +1132,7 @@ AddMemoryMappedIoSpace (
       DEBUG_ERROR,
       "%a: %a: GetMemorySpaceMap(): %r\n",
       gEfiCallerBaseName,
-      __FUNCTION__,
+      __func__,
       Status
       ));
     return Status;
@@ -1215,7 +1215,7 @@ AddLocalApicMemorySpace (
       DEBUG_INFO,
       "%a: %a: AllocateMemorySpace() Status - %r\n",
       gEfiCallerBaseName,
-      __FUNCTION__,
+      __func__,
       Status
       ));
   }
diff --git a/UefiCpuPkg/CpuDxeRiscV64/CpuDxe.c b/UefiCpuPkg/CpuDxeRiscV64/CpuDxe.c
index 7551e0653603..25fe3f54c325 100644
--- a/UefiCpuPkg/CpuDxeRiscV64/CpuDxe.c
+++ b/UefiCpuPkg/CpuDxeRiscV64/CpuDxe.c
@@ -296,7 +296,7 @@ CpuSetMemoryAttributes (
   IN UINT64                 Attributes
   )
 {
-  DEBUG ((DEBUG_INFO, "%a: Set memory attributes not supported yet\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a: Set memory attributes not supported yet\n", __func__));
   return EFI_SUCCESS;
 }
 
@@ -328,10 +328,10 @@ InitializeCpu (
     return EFI_NOT_FOUND;
   }
 
-  DEBUG ((DEBUG_INFO, " %a: Firmware Context is at 0x%x.\n", __FUNCTION__, FirmwareContext));
+  DEBUG ((DEBUG_INFO, " %a: Firmware Context is at 0x%x.\n", __func__, FirmwareContext));
 
   mBootHartId = FirmwareContext->BootHartId;
-  DEBUG ((DEBUG_INFO, " %a: mBootHartId = 0x%x.\n", __FUNCTION__, mBootHartId));
+  DEBUG ((DEBUG_INFO, " %a: mBootHartId = 0x%x.\n", __func__, mBootHartId));
 
   InitializeCpuExceptionHandlers (NULL);
 
diff --git a/UefiCpuPkg/CpuS3DataDxe/CpuS3Data.c b/UefiCpuPkg/CpuS3DataDxe/CpuS3Data.c
index 59a5d932eee2..86ce5303cab4 100644
--- a/UefiCpuPkg/CpuS3DataDxe/CpuS3Data.c
+++ b/UefiCpuPkg/CpuS3DataDxe/CpuS3Data.c
@@ -127,7 +127,7 @@ CpuS3DataOnEndOfDxe (
                                                     );
   ASSERT_EFI_ERROR (Status);
 
-  DEBUG ((DEBUG_VERBOSE, "%a\n", __FUNCTION__));
+  DEBUG ((DEBUG_VERBOSE, "%a\n", __func__));
   MtrrGetAllMtrrs (&AcpiCpuDataEx->MtrrTable);
 
   //
diff --git a/UefiCpuPkg/Library/BaseRiscV64CpuExceptionHandlerLib/CpuExceptionHandlerLib.c b/UefiCpuPkg/Library/BaseRiscV64CpuExceptionHandlerLib/CpuExceptionHandlerLib.c
index bce089feb0da..73a9dd57658c 100644
--- a/UefiCpuPkg/Library/BaseRiscV64CpuExceptionHandlerLib/CpuExceptionHandlerLib.c
+++ b/UefiCpuPkg/Library/BaseRiscV64CpuExceptionHandlerLib/CpuExceptionHandlerLib.c
@@ -230,7 +230,7 @@ RegisterCpuInterruptHandler (
   IN EFI_CPU_INTERRUPT_HANDLER  InterruptHandler
   )
 {
-  DEBUG ((DEBUG_INFO, "%a: Type:%x Handler: %x\n", __FUNCTION__, ExceptionType, InterruptHandler));
+  DEBUG ((DEBUG_INFO, "%a: Type:%x Handler: %x\n", __func__, ExceptionType, InterruptHandler));
   if (EXCEPT_RISCV_IS_IRQ (ExceptionType)) {
     if (EXCEPT_RISCV_IRQ_INDEX (ExceptionType) > EXCEPT_RISCV_MAX_IRQS) {
       return EFI_UNSUPPORTED;
diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/UnitTest/CpuExceptionHandlerTestCommon.c b/UefiCpuPkg/Library/CpuExceptionHandlerLib/UnitTest/CpuExceptionHandlerTestCommon.c
index 17afb592d3c8..9ba70c5b7340 100644
--- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/UnitTest/CpuExceptionHandlerTestCommon.c
+++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/UnitTest/CpuExceptionHandlerTestCommon.c
@@ -292,7 +292,7 @@ GetBspStackBase (
       DEBUG ((
         DEBUG_INFO,
         "%a: Bsp StackBase = 0x%016lx  StackSize = 0x%016lx\n",
-        __FUNCTION__,
+        __func__,
         MemoryHob->AllocDescriptor.MemoryBaseAddress,
         MemoryHob->AllocDescriptor.MemoryLength
         ));
diff --git a/UefiCpuPkg/Library/MpInitLib/DxeMpLib.c b/UefiCpuPkg/Library/MpInitLib/DxeMpLib.c
index 330676b700d1..57ddb86600a7 100644
--- a/UefiCpuPkg/Library/MpInitLib/DxeMpLib.c
+++ b/UefiCpuPkg/Library/MpInitLib/DxeMpLib.c
@@ -463,7 +463,7 @@ MpInitChangeApLoopCallback (
       );
   }
 
-  DEBUG ((DEBUG_INFO, "%a() done!\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a() done!\n", __func__));
 }
 
 /**
diff --git a/UefiCpuPkg/Library/MpInitLib/Microcode.c b/UefiCpuPkg/Library/MpInitLib/Microcode.c
index f9f070fa8bf2..11720560afee 100644
--- a/UefiCpuPkg/Library/MpInitLib/Microcode.c
+++ b/UefiCpuPkg/Library/MpInitLib/Microcode.c
@@ -170,7 +170,7 @@ ShadowMicrocodePatchWorker (
   DEBUG ((
     DEBUG_INFO,
     "%a: Required microcode patches have been loaded at 0x%lx, with size 0x%lx.\n",
-    __FUNCTION__,
+    __func__,
     CpuMpData->MicrocodePatchAddress,
     CpuMpData->MicrocodePatchRegionSize
     ));
@@ -305,7 +305,7 @@ ShadowMicrocodePatchByPcd (
     DEBUG ((
       DEBUG_INFO,
       "%a: 0x%x microcode patches will be loaded into memory, with size 0x%x.\n",
-      __FUNCTION__,
+      __func__,
       PatchCount,
       TotalLoadSize
       ));
@@ -365,7 +365,7 @@ GetMicrocodePatchInfoFromHob (
 
   GuidHob = GetFirstGuidHob (&gEdkiiMicrocodePatchHobGuid);
   if (GuidHob == NULL) {
-    DEBUG ((DEBUG_INFO, "%a: Microcode patch cache HOB is not found.\n", __FUNCTION__));
+    DEBUG ((DEBUG_INFO, "%a: Microcode patch cache HOB is not found.\n", __func__));
     return FALSE;
   }
 
@@ -377,7 +377,7 @@ GetMicrocodePatchInfoFromHob (
   DEBUG ((
     DEBUG_INFO,
     "%a: MicrocodeBase = 0x%lx, MicrocodeSize = 0x%lx\n",
-    __FUNCTION__,
+    __func__,
     *Address,
     *RegionSize
     ));
diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c b/UefiCpuPkg/Library/MpInitLib/MpLib.c
index e5dc852ed95f..f1f284071441 100644
--- a/UefiCpuPkg/Library/MpInitLib/MpLib.c
+++ b/UefiCpuPkg/Library/MpInitLib/MpLib.c
@@ -1537,7 +1537,7 @@ TimedWaitForApFinish (
     DEBUG ((
       DEBUG_VERBOSE,
       "%a: reached FinishedApLimit=%u in %Lu microseconds\n",
-      __FUNCTION__,
+      __func__,
       FinishedApLimit,
       DivU64x64Remainder (
         MultU64x32 (CpuMpData->TotalTime, 1000000),
diff --git a/UefiCpuPkg/Library/MpInitLib/PeiMpLib.c b/UefiCpuPkg/Library/MpInitLib/PeiMpLib.c
index e732371ddd21..013f89b197d0 100644
--- a/UefiCpuPkg/Library/MpInitLib/PeiMpLib.c
+++ b/UefiCpuPkg/Library/MpInitLib/PeiMpLib.c
@@ -758,7 +758,7 @@ PlatformShadowMicrocode (
   DEBUG ((
     DEBUG_INFO,
     "%a: Required microcode patches have been loaded at 0x%lx, with size 0x%lx.\n",
-    __FUNCTION__,
+    __func__,
     CpuMpData->MicrocodePatchAddress,
     CpuMpData->MicrocodePatchRegionSize
     ));
diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c b/UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c
index 240eee6a7d2f..0f7ee0372dbd 100644
--- a/UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c
+++ b/UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c
@@ -932,7 +932,7 @@ InitSmmS3ResumeState (
     DEBUG ((
       DEBUG_ERROR,
       "ERROR:%a(): HOB(gEfiAcpiVariableGuid=%g) needed by S3 resume doesn't exist!\n",
-      __FUNCTION__,
+      __func__,
       &gEfiAcpiVariableGuid
       ));
     CpuDeadLoop ();
diff --git a/UefiCpuPkg/SecCore/SecMain.c b/UefiCpuPkg/SecCore/SecMain.c
index fe03d8019a40..95375850ec76 100644
--- a/UefiCpuPkg/SecCore/SecMain.c
+++ b/UefiCpuPkg/SecCore/SecMain.c
@@ -170,7 +170,7 @@ SecStartup (
   DEBUG ((
     DEBUG_INFO,
     "%a() TempRAM Base: 0x%x, TempRAM Size: 0x%x, BootFirmwareVolume 0x%x\n",
-    __FUNCTION__,
+    __func__,
     TempRamBase,
     SizeOfRam,
     BootFirmwareVolume
@@ -242,7 +242,7 @@ SecStartup (
   DEBUG ((
     DEBUG_INFO,
     "%a() BFV Base: 0x%x, BFV Size: 0x%x, TempRAM Base: 0x%x, TempRAM Size: 0x%x, PeiTempRamBase: 0x%x, PeiTempRamSize: 0x%x, StackBase: 0x%x, StackSize: 0x%x\n",
-    __FUNCTION__,
+    __func__,
     SecCoreData.BootFirmwareVolumeBase,
     SecCoreData.BootFirmwareVolumeSize,
     SecCoreData.TemporaryRamBase,
@@ -345,7 +345,7 @@ SecStartupPhase2 (
   DEBUG ((
     DEBUG_INFO,
     "%a() PeiCoreEntryPoint: 0x%x\n",
-    __FUNCTION__,
+    __func__,
     PeiCoreEntryPoint
     ));
 
@@ -394,7 +394,7 @@ SecStartupPhase2 (
     DEBUG ((
       DEBUG_INFO,
       "%a() PeiTemporaryRamBase: 0x%x, PeiTemporaryRamSize: 0x%x\n",
-      __FUNCTION__,
+      __func__,
       SecCoreData->PeiTemporaryRamBase,
       SecCoreData->PeiTemporaryRamSize
       ));
@@ -408,7 +408,7 @@ SecStartupPhase2 (
   DEBUG ((
     DEBUG_INFO,
     "%a() Stack Base: 0x%p, Stack Size: 0x%x\n",
-    __FUNCTION__,
+    __func__,
     SecCoreData->StackBase,
     (UINT32)SecCoreData->StackSize
     ));
diff --git a/UefiCpuPkg/Test/UnitTest/EfiMpServicesPpiProtocol/EfiMpServicesUnitTestCommom.c b/UefiCpuPkg/Test/UnitTest/EfiMpServicesPpiProtocol/EfiMpServicesUnitTestCommom.c
index ff79c5e8d43b..7cd3f48d761f 100644
--- a/UefiCpuPkg/Test/UnitTest/EfiMpServicesPpiProtocol/EfiMpServicesUnitTestCommom.c
+++ b/UefiCpuPkg/Test/UnitTest/EfiMpServicesPpiProtocol/EfiMpServicesUnitTestCommom.c
@@ -45,7 +45,7 @@ InitUTContext (
 
   Status = MpServicesUnitTestWhoAmI (LocalContext->MpServices, &BspNumber);
   UT_ASSERT_NOT_EFI_ERROR (Status);
-  DEBUG ((DEBUG_INFO, "%a: BspNumber = 0x%x\n", __FUNCTION__, BspNumber));
+  DEBUG ((DEBUG_INFO, "%a: BspNumber = 0x%x\n", __func__, BspNumber));
 
   Status = MpServicesUnitTestGetNumberOfProcessors (
              LocalContext->MpServices,
@@ -56,7 +56,7 @@ InitUTContext (
   DEBUG ((
     DEBUG_INFO,
     "%a: NumberOfProcessors = 0x%x, NumberOfEnabledProcessors = 0x%x\n",
-    __FUNCTION__,
+    __func__,
     NumberOfProcessors,
     NumberOfEnabledProcessors
     ));
@@ -89,7 +89,7 @@ InitUTContext (
         LocalContext->DisabledApNumber[IndexOfDisabledAPs] = ProcessorNumber;
         IndexOfDisabledAPs++;
 
-        DEBUG ((DEBUG_INFO, "%a: AP(0x%x) is disabled and temporarily enable it.\n", __FUNCTION__, ProcessorNumber));
+        DEBUG ((DEBUG_INFO, "%a: AP(0x%x) is disabled and temporarily enable it.\n", __func__, ProcessorNumber));
         Status = MpServicesUnitTestEnableDisableAP (
                    LocalContext->MpServices,
                    ProcessorNumber,
@@ -134,7 +134,7 @@ CheckUTContext (
 
   if (BspNumber != LocalContext->BspNumber) {
     LocalContext->BspNumber = BspNumber;
-    DEBUG ((DEBUG_INFO, "%a: New BspNumber = 0x%x\n", __FUNCTION__, BspNumber));
+    DEBUG ((DEBUG_INFO, "%a: New BspNumber = 0x%x\n", __func__, BspNumber));
   }
 
   ASSERT (BspNumber == LocalContext->BspNumber);
@@ -148,11 +148,11 @@ CheckUTContext (
 
   if (NumberOfProcessors != LocalContext->NumberOfProcessors) {
     LocalContext->NumberOfProcessors = NumberOfProcessors;
-    DEBUG ((DEBUG_INFO, "%a: New NumberOfProcessors = 0x%x\n", __FUNCTION__, NumberOfProcessors));
+    DEBUG ((DEBUG_INFO, "%a: New NumberOfProcessors = 0x%x\n", __func__, NumberOfProcessors));
   }
 
   if (NumberOfEnabledProcessors != LocalContext->NumberOfProcessors) {
-    DEBUG ((DEBUG_INFO, "%a: New NumberOfEnabledProcessors = 0x%x\n", __FUNCTION__, NumberOfEnabledProcessors));
+    DEBUG ((DEBUG_INFO, "%a: New NumberOfEnabledProcessors = 0x%x\n", __func__, NumberOfEnabledProcessors));
 
     for (ProcessorNumber = 0; ProcessorNumber < LocalContext->NumberOfProcessors; ProcessorNumber++) {
       Status = MpServicesUnitTestGetProcessorInfo (
@@ -163,7 +163,7 @@ CheckUTContext (
       ASSERT_EFI_ERROR (Status);
 
       if (!(ProcessorInfoBuffer.StatusFlag & PROCESSOR_ENABLED_BIT)) {
-        DEBUG ((DEBUG_INFO, "%a: AP(0x%x) is disabled unexpectedly and reenable it.\n", __FUNCTION__, ProcessorNumber));
+        DEBUG ((DEBUG_INFO, "%a: AP(0x%x) is disabled unexpectedly and reenable it.\n", __func__, ProcessorNumber));
         Status = MpServicesUnitTestEnableDisableAP (
                    LocalContext->MpServices,
                    ProcessorNumber,
@@ -204,7 +204,7 @@ FreeUTContext (
       DEBUG ((
         DEBUG_INFO,
         "%a: Disable AP(0x%x) to restore its state.\n",
-        __FUNCTION__,
+        __func__,
         LocalContext->DisabledApNumber[IndexOfDisabledAPs]
         ));
 
diff --git a/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c b/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c
index e82f179569e9..9ea5f6f4e5e5 100644
--- a/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c
+++ b/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c
@@ -509,7 +509,7 @@ S3ResumeBootOs (
     DEBUG ((
       DEBUG_INFO,
       "%a() Stack Base: 0x%x, Stack Size: 0x%x\n",
-      __FUNCTION__,
+      __func__,
       TempStackTop,
       sizeof (TempStack)
       ));
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 04/18] OvmfPkg: Update code to be more C11 compliant by using __func__
  2023-04-06 22:23 [PATCH 00/18] Replace pre-standard macro __FUNCTION__ with C99 __func__ throughout edk2 Rebecca Cran
                   ` (2 preceding siblings ...)
  2023-04-06 22:23 ` [PATCH 03/18] UefiCpuPkg: " Rebecca Cran
@ 2023-04-06 22:23 ` Rebecca Cran
  2023-04-07 11:19   ` Sunil V L
  2023-04-06 22:23 ` [PATCH 05/18] MdeModulePkg: " Rebecca Cran
                   ` (16 subsequent siblings)
  20 siblings, 1 reply; 34+ messages in thread
From: Rebecca Cran @ 2023-04-06 22:23 UTC (permalink / raw)
  To: devel, Liming Gao, Michael D Kinney, Guomin Jiang, Wei6 Xu,
	Guo Dong, Ray Ni, Sean Rhodes, James Lu, Gua Guo, Andrew Fish,
	Hao A Wu, Maciej Rabeda, Siyuan Fu, Jiewen Yao, Jian J Wang,
	Xiaoyu Lu, Ard Biesheuvel, Sami Mujawar, Supreeth Venkatesh,
	Michael Kubacki, Nate DeSimone, Sean Brogan
  Cc: Rebecca Cran, Leif Lindholm, Abner Chang, Nickle Wang,
	Igor Kulchytskyy, Daniel Schaefer, Min Xu, Jordan Justen,
	Gerd Hoffmann, Peter Grehan, Erdem Aktas, James Bottomley,
	Tom Lendacky, Michael Roth, Sunil V L, Andrei Warkentin

__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
OvmfPkg.

Visual Studio versions before VS 2015 don't support __func__ and so
will fail to compile. A workaround is to define __func__ as
__FUNCTION__ :

  #define __func__ __FUNCTION__

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
---
 OvmfPkg/AcpiPlatformDxe/BootScript.c                                    |  4 +-
 OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c                                   |  4 +-
 OvmfPkg/AcpiPlatformDxe/EntryPoint.c                                    |  8 +--
 OvmfPkg/AcpiPlatformDxe/PciDecoding.c                                   | 10 +--
 OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c                                 | 64 ++++++++++----------
 OvmfPkg/AmdSev/BlobVerifierLibSevHashes/BlobVerifierSevHashes.c         | 18 +++---
 OvmfPkg/AmdSevDxe/AmdSevDxe.c                                           |  2 +-
 OvmfPkg/Bhyve/AcpiPlatformDxe/EntryPoint.c                              |  8 +--
 OvmfPkg/Bhyve/AcpiPlatformDxe/PciDecoding.c                             | 10 +--
 OvmfPkg/Bhyve/BhyveRfbDxe/VbeShim.c                                     |  6 +-
 OvmfPkg/Bhyve/PlatformPei/ClearCache.c                                  |  6 +-
 OvmfPkg/Bhyve/PlatformPei/MemDetect.c                                   | 12 ++--
 OvmfPkg/Bhyve/PlatformPei/Platform.c                                    | 10 +--
 OvmfPkg/CpuHotplugSmm/CpuHotplug.c                                      | 40 ++++++------
 OvmfPkg/CpuHotplugSmm/QemuCpuhp.c                                       | 32 +++++-----
 OvmfPkg/CpuHotplugSmm/Smbase.c                                          | 10 +--
 OvmfPkg/CpuS3DataDxe/CpuS3Data.c                                        |  2 +-
 OvmfPkg/Csm/CsmSupportLib/LegacyInterrupt.c                             |  2 +-
 OvmfPkg/Csm/CsmSupportLib/LegacyRegion.c                                |  2 +-
 OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.c                           |  2 +-
 OvmfPkg/Fdt/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c                   | 28 ++++-----
 OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.c                 |  4 +-
 OvmfPkg/Fdt/HighMemDxe/HighMemDxe.c                                     | 10 +--
 OvmfPkg/Fdt/VirtioFdtDxe/VirtioFdtDxe.c                                 | 10 +--
 OvmfPkg/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.c  |  2 +-
 OvmfPkg/IoMmuDxe/CcIoMmu.c                                              | 18 +++---
 OvmfPkg/IoMmuDxe/IoMmuBuffer.c                                          |  8 +--
 OvmfPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.c                         |  2 +-
 OvmfPkg/Library/AcpiTimerLib/BaseRomAcpiTimerLib.c                      |  4 +-
 OvmfPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.c                          |  2 +-
 OvmfPkg/Library/BaseMemEncryptSevLib/X64/PeiDxeVirtualMemory.c          | 22 +++----
 OvmfPkg/Library/BaseMemEncryptSevLib/X64/SnpPageStateChangeInternal.c   |  4 +-
 OvmfPkg/Library/BaseMemEncryptTdxLib/MemoryEncryption.c                 | 26 ++++----
 OvmfPkg/Library/BasePciCapLib/BasePciCapLib.c                           |  4 +-
 OvmfPkg/Library/CcExitLib/CcExitVeHandler.c                             | 18 +++---
 OvmfPkg/Library/GenericQemuLoadImageLib/GenericQemuLoadImageLib.c       |  6 +-
 OvmfPkg/Library/HardwareInfoLib/HardwareInfoDxe.c                       |  2 +-
 OvmfPkg/Library/LockBoxLib/LockBoxLib.c                                 | 10 +--
 OvmfPkg/Library/PciHostBridgeUtilityLib/PciHostBridgeUtilityLib.c       | 22 +++----
 OvmfPkg/Library/PeilessStartupLib/X64/VirtualMemory.c                   |  2 +-
 OvmfPkg/Library/PlatformBmPrintScLib/StatusCodeHandler.c                | 12 ++--
 OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c                    | 12 ++--
 OvmfPkg/Library/PlatformBootManagerLib/QemuKernel.c                     |  2 +-
 OvmfPkg/Library/PlatformBootManagerLibBhyve/BdsPlatform.c               | 10 +--
 OvmfPkg/Library/PlatformBootManagerLibGrub/BdsPlatform.c                | 10 +--
 OvmfPkg/Library/PlatformBootManagerLibGrub/QemuKernel.c                 |  2 +-
 OvmfPkg/Library/PlatformInitLib/MemDetect.c                             | 28 ++++-----
 OvmfPkg/Library/PlatformInitLib/Platform.c                              | 20 +++---
 OvmfPkg/Library/QemuBootOrderLib/ExtraRootBusMap.c                      |  2 +-
 OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.c                     | 42 ++++++-------
 OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgDxe.c                             | 18 +++---
 OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMmio.c                         |  2 +-
 OvmfPkg/Library/QemuFwCfgS3Lib/QemuFwCfgS3Dxe.c                         | 34 +++++------
 OvmfPkg/Library/ResetSystemLib/DxeResetSystemLibMicrovm.c               |  8 +--
 OvmfPkg/Library/ResetSystemLib/ResetSystemLibMicrovm.c                  |  8 +--
 OvmfPkg/Library/SerializeVariablesLib/SerializeVariablesLib.c           |  4 +-
 OvmfPkg/Library/SmbiosVersionLib/DetectSmbiosVersionLib.c               |  4 +-
 OvmfPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c                   |  4 +-
 OvmfPkg/Library/TlsAuthConfigLib/TlsAuthConfigLib.c                     | 24 ++++----
 OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDevice.c                  |  4 +-
 OvmfPkg/Library/X86QemuLoadImageLib/X86QemuLoadImageLib.c               |  8 +--
 OvmfPkg/Library/XenIoMmioLib/XenIoMmioLib.c                             |  4 +-
 OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.c |  2 +-
 OvmfPkg/LsiScsiDxe/LsiScsi.c                                            |  4 +-
 OvmfPkg/MptScsiDxe/MptScsi.c                                            | 10 +--
 OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.c                              |  6 +-
 OvmfPkg/PlatformDxe/Platform.c                                          | 14 ++---
 OvmfPkg/PlatformPei/ClearCache.c                                        |  6 +-
 OvmfPkg/PlatformPei/FeatureControl.c                                    |  6 +-
 OvmfPkg/PlatformPei/MemDetect.c                                         | 12 ++--
 OvmfPkg/PlatformPei/MemTypeInfo.c                                       | 10 +--
 OvmfPkg/PlatformPei/Platform.c                                          | 18 +++---
 OvmfPkg/PvScsiDxe/PvScsi.c                                              |  4 +-
 OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c                   | 12 ++--
 OvmfPkg/QemuRamfbDxe/QemuRamfb.c                                        |  2 +-
 OvmfPkg/QemuVideoDxe/Gop.c                                              |  2 +-
 OvmfPkg/QemuVideoDxe/Initialize.c                                       | 14 ++---
 OvmfPkg/QemuVideoDxe/VbeShim.c                                          | 12 ++--
 OvmfPkg/RiscVVirt/Library/PlatformBootManagerLib/PlatformBm.c           | 20 +++---
 OvmfPkg/RiscVVirt/Library/PlatformBootManagerLib/QemuKernel.c           |  2 +-
 OvmfPkg/RiscVVirt/Library/PrePiHobListPointerLib/PrePiHobListPointer.c  |  4 +-
 OvmfPkg/RiscVVirt/Sec/Memory.c                                          | 10 +--
 OvmfPkg/RiscVVirt/Sec/Platform.c                                        | 12 ++--
 OvmfPkg/RiscVVirt/Sec/SecMain.c                                         |  2 +-
 OvmfPkg/Sec/SecMain.c                                                   |  2 +-
 OvmfPkg/SmmAccess/SmmAccessPei.c                                        |  6 +-
 OvmfPkg/SmmControl2Dxe/SmiFeatures.c                                    | 22 +++----
 OvmfPkg/SmmControl2Dxe/SmmControl2Dxe.c                                 | 18 +++---
 OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPeim.c                                 |  8 +--
 OvmfPkg/Tcg/TpmMmioSevDecryptPei/TpmMmioSevDecryptPeim.c                |  6 +-
 OvmfPkg/TdxDxe/TdxAcpiTable.c                                           |  2 +-
 OvmfPkg/VirtNorFlashDxe/VirtNorFlashDxe.c                               |  4 +-
 OvmfPkg/VirtNorFlashDxe/VirtNorFlashFvb.c                               | 22 +++----
 OvmfPkg/VirtioBlkDxe/VirtioBlk.c                                        |  8 +--
 OvmfPkg/VirtioFsDxe/FuseFlush.c                                         |  2 +-
 OvmfPkg/VirtioFsDxe/FuseFsync.c                                         |  2 +-
 OvmfPkg/VirtioFsDxe/FuseGetAttr.c                                       |  2 +-
 OvmfPkg/VirtioFsDxe/FuseInit.c                                          |  2 +-
 OvmfPkg/VirtioFsDxe/FuseLookup.c                                        |  2 +-
 OvmfPkg/VirtioFsDxe/FuseMkDir.c                                         |  2 +-
 OvmfPkg/VirtioFsDxe/FuseOpen.c                                          |  2 +-
 OvmfPkg/VirtioFsDxe/FuseOpenDir.c                                       |  2 +-
 OvmfPkg/VirtioFsDxe/FuseOpenOrCreate.c                                  |  2 +-
 OvmfPkg/VirtioFsDxe/FuseRead.c                                          |  2 +-
 OvmfPkg/VirtioFsDxe/FuseRelease.c                                       |  2 +-
 OvmfPkg/VirtioFsDxe/FuseRename.c                                        |  2 +-
 OvmfPkg/VirtioFsDxe/FuseSetAttr.c                                       |  2 +-
 OvmfPkg/VirtioFsDxe/FuseStatFs.c                                        |  2 +-
 OvmfPkg/VirtioFsDxe/FuseUnlink.c                                        |  2 +-
 OvmfPkg/VirtioFsDxe/FuseWrite.c                                         |  2 +-
 OvmfPkg/VirtioFsDxe/Helpers.c                                           |  2 +-
 OvmfPkg/VirtioFsDxe/SimpleFsOpen.c                                      |  4 +-
 OvmfPkg/VirtioGpuDxe/Commands.c                                         |  6 +-
 OvmfPkg/VirtioGpuDxe/DriverBinding.c                                    |  8 +--
 OvmfPkg/VirtioGpuDxe/Gop.c                                              |  2 +-
 OvmfPkg/VirtioNetDxe/Events.c                                           |  2 +-
 OvmfPkg/VirtioRngDxe/VirtioRng.c                                        |  2 +-
 OvmfPkg/VirtioScsiDxe/VirtioScsi.c                                      |  2 +-
 OvmfPkg/XenAcpiPlatformDxe/Xen.c                                        |  2 +-
 OvmfPkg/XenPlatformPei/ClearCache.c                                     |  6 +-
 OvmfPkg/XenPlatformPei/MemDetect.c                                      |  6 +-
 OvmfPkg/XenPlatformPei/Platform.c                                       |  2 +-
 OvmfPkg/XenPvBlkDxe/BlockFront.c                                        |  4 +-
 123 files changed, 540 insertions(+), 540 deletions(-)

diff --git a/OvmfPkg/AcpiPlatformDxe/BootScript.c b/OvmfPkg/AcpiPlatformDxe/BootScript.c
index 08d0f41bda5c..ff1491de0d2d 100644
--- a/OvmfPkg/AcpiPlatformDxe/BootScript.c
+++ b/OvmfPkg/AcpiPlatformDxe/BootScript.c
@@ -175,7 +175,7 @@ SaveCondensedWritePointerToS3Context (
   DEBUG ((
     DEBUG_VERBOSE,
     "%a: 0x%04x/[0x%08x+%d] := 0x%Lx (%Lu)\n",
-    __FUNCTION__,
+    __func__,
     PointerItem,
     PointerOffset,
     PointerSize,
@@ -225,7 +225,7 @@ AppendFwCfgBootScript (
     }
   }
 
-  DEBUG ((DEBUG_VERBOSE, "%a: boot script fragment saved\n", __FUNCTION__));
+  DEBUG ((DEBUG_VERBOSE, "%a: boot script fragment saved\n", __func__));
 
   ReleaseS3Context (S3Context);
   return;
diff --git a/OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c b/OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c
index d56eb074a987..d3e73c155e8f 100644
--- a/OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c
+++ b/OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c
@@ -69,7 +69,7 @@ InstallCloudHvTablesTdx (
   // then we're out of sync with the hypervisor, and cannot continue.
   //
   if (DsdtTable == NULL) {
-    DEBUG ((DEBUG_INFO, "%a: no DSDT found\n", __FUNCTION__));
+    DEBUG ((DEBUG_INFO, "%a: no DSDT found\n", __func__));
     ASSERT (FALSE);
   }
 
@@ -201,7 +201,7 @@ InstallCloudHvTables (
   // then we're out of sync with the hypervisor, and cannot continue.
   //
   if (DsdtTable == NULL) {
-    DEBUG ((DEBUG_ERROR, "%a: no DSDT found\n", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a: no DSDT found\n", __func__));
     ASSERT (FALSE);
     CpuDeadLoop ();
   }
diff --git a/OvmfPkg/AcpiPlatformDxe/EntryPoint.c b/OvmfPkg/AcpiPlatformDxe/EntryPoint.c
index 143e860fe187..17f1c4017f87 100644
--- a/OvmfPkg/AcpiPlatformDxe/EntryPoint.c
+++ b/OvmfPkg/AcpiPlatformDxe/EntryPoint.c
@@ -46,11 +46,11 @@ OnRootBridgesConnected (
   DEBUG ((
     DEBUG_INFO,
     "%a: root bridges have been connected, installing ACPI tables\n",
-    __FUNCTION__
+    __func__
     ));
   Status = InstallAcpiTables (FindAcpiTableProtocol ());
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "%a: InstallAcpiTables: %r\n", __FUNCTION__, Status));
+    DEBUG ((DEBUG_ERROR, "%a: InstallAcpiTables: %r\n", __func__, Status));
   }
 
   gBS->CloseEvent (Event);
@@ -76,7 +76,7 @@ AcpiPlatformEntryPoint (
       DEBUG_INFO,
       "%a: PCI or its enumeration disabled, installing "
       "ACPI tables\n",
-      __FUNCTION__
+      __func__
       ));
     return InstallAcpiTables (FindAcpiTableProtocol ());
   }
@@ -99,7 +99,7 @@ AcpiPlatformEntryPoint (
     DEBUG ((
       DEBUG_INFO,
       "%a: waiting for root bridges to be connected, registered callback\n",
-      __FUNCTION__
+      __func__
       ));
   }
 
diff --git a/OvmfPkg/AcpiPlatformDxe/PciDecoding.c b/OvmfPkg/AcpiPlatformDxe/PciDecoding.c
index c178f857a224..c7dbfb1baaea 100644
--- a/OvmfPkg/AcpiPlatformDxe/PciDecoding.c
+++ b/OvmfPkg/AcpiPlatformDxe/PciDecoding.c
@@ -78,7 +78,7 @@ EnablePciDecoding (
     DEBUG ((
       DEBUG_WARN,
       "%a: LocateHandleBuffer(): %r\n",
-      __FUNCTION__,
+      __func__,
       Status
       ));
     return;
@@ -89,7 +89,7 @@ EnablePciDecoding (
     DEBUG ((
       DEBUG_WARN,
       "%a: AllocatePool(): out of resources\n",
-      __FUNCTION__
+      __func__
       ));
     goto FreeHandles;
   }
@@ -122,7 +122,7 @@ EnablePciDecoding (
       DEBUG ((
         DEBUG_WARN,
         "%a: EfiPciIoAttributeOperationGet: %r\n",
-        __FUNCTION__,
+        __func__,
         Status
         ));
       goto RestoreAttributes;
@@ -141,7 +141,7 @@ EnablePciDecoding (
       DEBUG ((
         DEBUG_WARN,
         "%a: EfiPciIoAttributeOperationSupported: %r\n",
-        __FUNCTION__,
+        __func__,
         Status
         ));
       goto RestoreAttributes;
@@ -161,7 +161,7 @@ EnablePciDecoding (
       DEBUG ((
         DEBUG_WARN,
         "%a: EfiPciIoAttributeOperationEnable: %r\n",
-        __FUNCTION__,
+        __func__,
         Status
         ));
       goto RestoreAttributes;
diff --git a/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c b/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c
index 68abc34f2280..a073b292b743 100644
--- a/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c
+++ b/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c
@@ -238,7 +238,7 @@ CollectAllocationsRestrictedTo32Bit (
     }
 
     if (AddPointer->PointeeFile[QEMU_LOADER_FNAME_SIZE - 1] != '\0') {
-      DEBUG ((DEBUG_ERROR, "%a: malformed file name\n", __FUNCTION__));
+      DEBUG ((DEBUG_ERROR, "%a: malformed file name\n", __func__));
       Status = EFI_PROTOCOL_ERROR;
       goto RollBack;
     }
@@ -253,7 +253,7 @@ CollectAllocationsRestrictedTo32Bit (
         DEBUG ((
           DEBUG_VERBOSE,
           "%a: restricting blob \"%a\" from 64-bit allocation\n",
-          __FUNCTION__,
+          __func__,
           AddPointer->PointeeFile
           ));
         break;
@@ -330,7 +330,7 @@ ProcessCmdAllocate (
   BLOB                  *Blob;
 
   if (Allocate->File[QEMU_LOADER_FNAME_SIZE - 1] != '\0') {
-    DEBUG ((DEBUG_ERROR, "%a: malformed file name\n", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a: malformed file name\n", __func__));
     return EFI_PROTOCOL_ERROR;
   }
 
@@ -338,7 +338,7 @@ ProcessCmdAllocate (
     DEBUG ((
       DEBUG_ERROR,
       "%a: unsupported alignment 0x%x\n",
-      __FUNCTION__,
+      __func__,
       Allocate->Alignment
       ));
     return EFI_UNSUPPORTED;
@@ -349,7 +349,7 @@ ProcessCmdAllocate (
     DEBUG ((
       DEBUG_ERROR,
       "%a: QemuFwCfgFindFile(\"%a\"): %r\n",
-      __FUNCTION__,
+      __func__,
       Allocate->File,
       Status
       ));
@@ -392,7 +392,7 @@ ProcessCmdAllocate (
     DEBUG ((
       DEBUG_ERROR,
       "%a: duplicated file \"%a\"\n",
-      __FUNCTION__,
+      __func__,
       Allocate->File
       ));
     Status = EFI_PROTOCOL_ERROR;
@@ -410,7 +410,7 @@ ProcessCmdAllocate (
     DEBUG_VERBOSE,
     "%a: File=\"%a\" Alignment=0x%x Zone=%d Size=0x%Lx "
     "Address=0x%Lx\n",
-    __FUNCTION__,
+    __func__,
     Allocate->File,
     Allocate->Alignment,
     Allocate->Zone,
@@ -477,7 +477,7 @@ ProcessCmdAddPointer (
   if ((AddPointer->PointerFile[QEMU_LOADER_FNAME_SIZE - 1] != '\0') ||
       (AddPointer->PointeeFile[QEMU_LOADER_FNAME_SIZE - 1] != '\0'))
   {
-    DEBUG ((DEBUG_ERROR, "%a: malformed file name\n", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a: malformed file name\n", __func__));
     return EFI_PROTOCOL_ERROR;
   }
 
@@ -487,7 +487,7 @@ ProcessCmdAddPointer (
     DEBUG ((
       DEBUG_ERROR,
       "%a: invalid blob reference(s) \"%a\" / \"%a\"\n",
-      __FUNCTION__,
+      __func__,
       AddPointer->PointerFile,
       AddPointer->PointeeFile
       ));
@@ -504,7 +504,7 @@ ProcessCmdAddPointer (
     DEBUG ((
       DEBUG_ERROR,
       "%a: invalid pointer location or size in \"%a\"\n",
-      __FUNCTION__,
+      __func__,
       AddPointer->PointerFile
       ));
     return EFI_PROTOCOL_ERROR;
@@ -517,7 +517,7 @@ ProcessCmdAddPointer (
     DEBUG ((
       DEBUG_ERROR,
       "%a: invalid pointer value in \"%a\"\n",
-      __FUNCTION__,
+      __func__,
       AddPointer->PointerFile
       ));
     return EFI_PROTOCOL_ERROR;
@@ -537,7 +537,7 @@ ProcessCmdAddPointer (
       DEBUG_ERROR,
       "%a: relocated pointer value unrepresentable in "
       "\"%a\"\n",
-      __FUNCTION__,
+      __func__,
       AddPointer->PointerFile
       ));
     return EFI_PROTOCOL_ERROR;
@@ -549,7 +549,7 @@ ProcessCmdAddPointer (
     DEBUG_VERBOSE,
     "%a: PointerFile=\"%a\" PointeeFile=\"%a\" "
     "PointerOffset=0x%x PointerSize=%d\n",
-    __FUNCTION__,
+    __func__,
     AddPointer->PointerFile,
     AddPointer->PointeeFile,
     AddPointer->PointerOffset,
@@ -585,7 +585,7 @@ ProcessCmdAddChecksum (
   BLOB                      *Blob;
 
   if (AddChecksum->File[QEMU_LOADER_FNAME_SIZE - 1] != '\0') {
-    DEBUG ((DEBUG_ERROR, "%a: malformed file name\n", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a: malformed file name\n", __func__));
     return EFI_PROTOCOL_ERROR;
   }
 
@@ -594,7 +594,7 @@ ProcessCmdAddChecksum (
     DEBUG ((
       DEBUG_ERROR,
       "%a: invalid blob reference \"%a\"\n",
-      __FUNCTION__,
+      __func__,
       AddChecksum->File
       ));
     return EFI_PROTOCOL_ERROR;
@@ -608,7 +608,7 @@ ProcessCmdAddChecksum (
     DEBUG ((
       DEBUG_ERROR,
       "%a: invalid checksum range in \"%a\"\n",
-      __FUNCTION__,
+      __func__,
       AddChecksum->File
       ));
     return EFI_PROTOCOL_ERROR;
@@ -622,7 +622,7 @@ ProcessCmdAddChecksum (
     DEBUG_VERBOSE,
     "%a: File=\"%a\" ResultOffset=0x%x Start=0x%x "
     "Length=0x%x\n",
-    __FUNCTION__,
+    __func__,
     AddChecksum->File,
     AddChecksum->ResultOffset,
     AddChecksum->Start,
@@ -680,7 +680,7 @@ ProcessCmdWritePointer (
   if ((WritePointer->PointerFile[QEMU_LOADER_FNAME_SIZE - 1] != '\0') ||
       (WritePointer->PointeeFile[QEMU_LOADER_FNAME_SIZE - 1] != '\0'))
   {
-    DEBUG ((DEBUG_ERROR, "%a: malformed file name\n", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a: malformed file name\n", __func__));
     return EFI_PROTOCOL_ERROR;
   }
 
@@ -694,7 +694,7 @@ ProcessCmdWritePointer (
     DEBUG ((
       DEBUG_ERROR,
       "%a: invalid fw_cfg file or blob reference \"%a\" / \"%a\"\n",
-      __FUNCTION__,
+      __func__,
       WritePointer->PointerFile,
       WritePointer->PointeeFile
       ));
@@ -710,7 +710,7 @@ ProcessCmdWritePointer (
     DEBUG ((
       DEBUG_ERROR,
       "%a: invalid pointer location or size in \"%a\"\n",
-      __FUNCTION__,
+      __func__,
       WritePointer->PointerFile
       ));
     return EFI_PROTOCOL_ERROR;
@@ -719,7 +719,7 @@ ProcessCmdWritePointer (
   PointeeBlob  = OrderedCollectionUserStruct (PointeeEntry);
   PointerValue = WritePointer->PointeeOffset;
   if (PointerValue >= PointeeBlob->Size) {
-    DEBUG ((DEBUG_ERROR, "%a: invalid PointeeOffset\n", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a: invalid PointeeOffset\n", __func__));
     return EFI_PROTOCOL_ERROR;
   }
 
@@ -736,7 +736,7 @@ ProcessCmdWritePointer (
     DEBUG ((
       DEBUG_ERROR,
       "%a: pointer value unrepresentable in \"%a\"\n",
-      __FUNCTION__,
+      __func__,
       WritePointer->PointerFile
       ));
     return EFI_PROTOCOL_ERROR;
@@ -776,7 +776,7 @@ ProcessCmdWritePointer (
     DEBUG_VERBOSE,
     "%a: PointerFile=\"%a\" PointeeFile=\"%a\" "
     "PointerOffset=0x%x PointeeOffset=0x%x PointerSize=%d\n",
-    __FUNCTION__,
+    __func__,
     WritePointer->PointerFile,
     WritePointer->PointeeFile,
     WritePointer->PointerOffset,
@@ -822,7 +822,7 @@ UndoCmdWritePointer (
   DEBUG ((
     DEBUG_VERBOSE,
     "%a: PointerFile=\"%a\" PointerOffset=0x%x PointerSize=%d\n",
-    __FUNCTION__,
+    __func__,
     WritePointer->PointerFile,
     WritePointer->PointerOffset,
     WritePointer->PointerSize
@@ -953,7 +953,7 @@ Process2ndPassCmdAddPointer (
       DEBUG ((
         DEBUG_VERBOSE,
         "%a: PointerValue=0x%Lx already processed, skipping.\n",
-        __FUNCTION__,
+        __func__,
         PointerValue
         ));
       Status = EFI_SUCCESS;
@@ -967,7 +967,7 @@ Process2ndPassCmdAddPointer (
     DEBUG_VERBOSE,
     "%a: checking for ACPI header in \"%a\" at 0x%Lx "
     "(remaining: 0x%Lx): ",
-    __FUNCTION__,
+    __func__,
     AddPointer->PointeeFile,
     PointerValue,
     (UINT64)Blob2Remaining
@@ -1042,7 +1042,7 @@ Process2ndPassCmdAddPointer (
     DEBUG ((
       DEBUG_ERROR,
       "%a: can't install more than %d tables\n",
-      __FUNCTION__,
+      __func__,
       INSTALLED_TABLES_MAX
       ));
     Status = EFI_OUT_OF_RESOURCES;
@@ -1059,7 +1059,7 @@ Process2ndPassCmdAddPointer (
     DEBUG ((
       DEBUG_ERROR,
       "%a: InstallAcpiTable(): %r\n",
-      __FUNCTION__,
+      __func__,
       Status
       ));
     goto RollbackSeenPointer;
@@ -1128,7 +1128,7 @@ InstallQemuFwCfgTables (
     DEBUG ((
       DEBUG_ERROR,
       "%a: \"etc/table-loader\" has invalid size 0x%Lx\n",
-      __FUNCTION__,
+      __func__,
       (UINT64)FwCfgSize
       ));
     return EFI_PROTOCOL_ERROR;
@@ -1236,7 +1236,7 @@ InstallQemuFwCfgTables (
         DEBUG ((
           DEBUG_VERBOSE,
           "%a: unknown loader command: 0x%x\n",
-          __FUNCTION__,
+          __func__,
           LoaderEntry->Type
           ));
         break;
@@ -1311,7 +1311,7 @@ InstallQemuFwCfgTables (
     S3Context = NULL;
   }
 
-  DEBUG ((DEBUG_INFO, "%a: installed %d tables\n", __FUNCTION__, Installed));
+  DEBUG ((DEBUG_INFO, "%a: installed %d tables\n", __func__, Installed));
 
 UninstallQemuAcpiTableNotifyProtocol:
   if (EFI_ERROR (Status)) {
@@ -1380,7 +1380,7 @@ InstallQemuFwCfgTables (
       DEBUG ((
         DEBUG_VERBOSE,
         "%a: freeing \"%a\"\n",
-        __FUNCTION__,
+        __func__,
         Blob->File
         ));
       gBS->FreePages ((UINTN)Blob->Base, EFI_SIZE_TO_PAGES (Blob->Size));
diff --git a/OvmfPkg/AmdSev/BlobVerifierLibSevHashes/BlobVerifierSevHashes.c b/OvmfPkg/AmdSev/BlobVerifierLibSevHashes/BlobVerifierSevHashes.c
index 65f040f94758..2e58794c3c70 100644
--- a/OvmfPkg/AmdSev/BlobVerifierLibSevHashes/BlobVerifierSevHashes.c
+++ b/OvmfPkg/AmdSev/BlobVerifierLibSevHashes/BlobVerifierSevHashes.c
@@ -101,7 +101,7 @@ VerifyBlob (
     DEBUG ((
       DEBUG_ERROR,
       "%a: Verifier called but no hashes table discoverd in MEMFD\n",
-      __FUNCTION__
+      __func__
       ));
     return EFI_ACCESS_DENIED;
   }
@@ -111,7 +111,7 @@ VerifyBlob (
     DEBUG ((
       DEBUG_ERROR,
       "%a: Unknown blob name \"%s\"\n",
-      __FUNCTION__,
+      __func__,
       BlobName
       ));
     return EFI_ACCESS_DENIED;
@@ -134,14 +134,14 @@ VerifyBlob (
       continue;
     }
 
-    DEBUG ((DEBUG_INFO, "%a: Found GUID %g in table\n", __FUNCTION__, Guid));
+    DEBUG ((DEBUG_INFO, "%a: Found GUID %g in table\n", __func__, Guid));
 
     EntrySize = Entry->Len - sizeof Entry->Guid - sizeof Entry->Len;
     if (EntrySize != SHA256_DIGEST_SIZE) {
       DEBUG ((
         DEBUG_ERROR,
         "%a: Hash has the wrong size %d != %d\n",
-        __FUNCTION__,
+        __func__,
         EntrySize,
         SHA256_DIGEST_SIZE
         ));
@@ -159,7 +159,7 @@ VerifyBlob (
       DEBUG ((
         DEBUG_INFO,
         "%a: Hash comparison succeeded for \"%s\"\n",
-        __FUNCTION__,
+        __func__,
         BlobName
         ));
     } else {
@@ -167,7 +167,7 @@ VerifyBlob (
       DEBUG ((
         DEBUG_ERROR,
         "%a: Hash comparison failed for \"%s\"\n",
-        __FUNCTION__,
+        __func__,
         BlobName
         ));
     }
@@ -178,7 +178,7 @@ VerifyBlob (
   DEBUG ((
     DEBUG_ERROR,
     "%a: Hash GUID %g not found in table\n",
-    __FUNCTION__,
+    __func__,
     Guid
     ));
   return EFI_ACCESS_DENIED;
@@ -218,7 +218,7 @@ BlobVerifierLibSevHashesConstructor (
   DEBUG ((
     DEBUG_INFO,
     "%a: Found injected hashes table in secure location\n",
-    __FUNCTION__
+    __func__
     ));
 
   mHashesTable     = (HASH_TABLE *)Ptr->Data;
@@ -227,7 +227,7 @@ BlobVerifierLibSevHashesConstructor (
   DEBUG ((
     DEBUG_VERBOSE,
     "%a: mHashesTable=0x%p, Size=%u\n",
-    __FUNCTION__,
+    __func__,
     mHashesTable,
     mHashesTableSize
     ));
diff --git a/OvmfPkg/AmdSevDxe/AmdSevDxe.c b/OvmfPkg/AmdSevDxe/AmdSevDxe.c
index 9b0d0e92b6f7..05b728d32a65 100644
--- a/OvmfPkg/AmdSevDxe/AmdSevDxe.c
+++ b/OvmfPkg/AmdSevDxe/AmdSevDxe.c
@@ -276,7 +276,7 @@ AmdSevDxeEntryPoint (
       DEBUG ((
         DEBUG_ERROR,
         "%a: MemEncryptSevClearPageEncMask(): %r\n",
-        __FUNCTION__,
+        __func__,
         Status
         ));
       ASSERT (FALSE);
diff --git a/OvmfPkg/Bhyve/AcpiPlatformDxe/EntryPoint.c b/OvmfPkg/Bhyve/AcpiPlatformDxe/EntryPoint.c
index b6ef101b2abe..23d1856ad5e2 100644
--- a/OvmfPkg/Bhyve/AcpiPlatformDxe/EntryPoint.c
+++ b/OvmfPkg/Bhyve/AcpiPlatformDxe/EntryPoint.c
@@ -41,11 +41,11 @@ OnRootBridgesConnected (
   DEBUG ((
     DEBUG_INFO,
     "%a: root bridges have been connected, installing ACPI tables\n",
-    __FUNCTION__
+    __func__
     ));
   Status = InstallAcpiTables (FindAcpiTableProtocol ());
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "%a: InstallAcpiTables: %r\n", __FUNCTION__, Status));
+    DEBUG ((DEBUG_ERROR, "%a: InstallAcpiTables: %r\n", __func__, Status));
   }
 
   gBS->CloseEvent (Event);
@@ -71,7 +71,7 @@ AcpiPlatformEntryPoint (
       DEBUG_INFO,
       "%a: PCI or its enumeration disabled, installing "
       "ACPI tables\n",
-      __FUNCTION__
+      __func__
       ));
     return InstallAcpiTables (FindAcpiTableProtocol ());
   }
@@ -94,7 +94,7 @@ AcpiPlatformEntryPoint (
     DEBUG ((
       DEBUG_INFO,
       "%a: waiting for root bridges to be connected, registered callback\n",
-      __FUNCTION__
+      __func__
       ));
   }
 
diff --git a/OvmfPkg/Bhyve/AcpiPlatformDxe/PciDecoding.c b/OvmfPkg/Bhyve/AcpiPlatformDxe/PciDecoding.c
index d31fd6539363..0dcf3517f1e7 100644
--- a/OvmfPkg/Bhyve/AcpiPlatformDxe/PciDecoding.c
+++ b/OvmfPkg/Bhyve/AcpiPlatformDxe/PciDecoding.c
@@ -76,7 +76,7 @@ EnablePciDecoding (
     DEBUG ((
       DEBUG_WARN,
       "%a: LocateHandleBuffer(): %r\n",
-      __FUNCTION__,
+      __func__,
       Status
       ));
     return;
@@ -87,7 +87,7 @@ EnablePciDecoding (
     DEBUG ((
       DEBUG_WARN,
       "%a: AllocatePool(): out of resources\n",
-      __FUNCTION__
+      __func__
       ));
     goto FreeHandles;
   }
@@ -120,7 +120,7 @@ EnablePciDecoding (
       DEBUG ((
         DEBUG_WARN,
         "%a: EfiPciIoAttributeOperationGet: %r\n",
-        __FUNCTION__,
+        __func__,
         Status
         ));
       goto RestoreAttributes;
@@ -139,7 +139,7 @@ EnablePciDecoding (
       DEBUG ((
         DEBUG_WARN,
         "%a: EfiPciIoAttributeOperationSupported: %r\n",
-        __FUNCTION__,
+        __func__,
         Status
         ));
       goto RestoreAttributes;
@@ -159,7 +159,7 @@ EnablePciDecoding (
       DEBUG ((
         DEBUG_WARN,
         "%a: EfiPciIoAttributeOperationEnable: %r\n",
-        __FUNCTION__,
+        __func__,
         Status
         ));
       goto RestoreAttributes;
diff --git a/OvmfPkg/Bhyve/BhyveRfbDxe/VbeShim.c b/OvmfPkg/Bhyve/BhyveRfbDxe/VbeShim.c
index 41f0180001f9..ea7a364d8500 100644
--- a/OvmfPkg/Bhyve/BhyveRfbDxe/VbeShim.c
+++ b/OvmfPkg/Bhyve/BhyveRfbDxe/VbeShim.c
@@ -147,7 +147,7 @@ InstallVbeShim (
       DEBUG ((
         DEBUG_VERBOSE,
         "%a: Video BIOS handler found at %04x:%04x\n",
-        __FUNCTION__,
+        __func__,
         Int0x10->Segment,
         Int0x10->Offset
         ));
@@ -161,7 +161,7 @@ InstallVbeShim (
     DEBUG ((
       DEBUG_VERBOSE,
       "%a: failed to allocate page at zero: %r\n",
-      __FUNCTION__,
+      __func__,
       Status
       ));
   } else {
@@ -271,7 +271,7 @@ InstallVbeShim (
   DEBUG ((
     DEBUG_INFO,
     "%a: VBE shim installed to %x:%x\n",
-    __FUNCTION__,
+    __func__,
     Int0x10->Segment,
     Int0x10->Offset
     ));
diff --git a/OvmfPkg/Bhyve/PlatformPei/ClearCache.c b/OvmfPkg/Bhyve/PlatformPei/ClearCache.c
index 9f23f9a42847..9e59f31df7fd 100644
--- a/OvmfPkg/Bhyve/PlatformPei/ClearCache.c
+++ b/OvmfPkg/Bhyve/PlatformPei/ClearCache.c
@@ -59,7 +59,7 @@ ClearCacheOnMpServicesAvailable (
   EFI_PEI_MP_SERVICES_PPI  *MpServices;
   EFI_STATUS               Status;
 
-  DEBUG ((DEBUG_INFO, "%a: %a\n", gEfiCallerBaseName, __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a: %a\n", gEfiCallerBaseName, __func__));
 
   //
   // Clear cache on all the APs in parallel.
@@ -74,7 +74,7 @@ ClearCacheOnMpServicesAvailable (
                              NULL             // ProcedureArgument
                              );
   if (EFI_ERROR (Status) && (Status != EFI_NOT_STARTED)) {
-    DEBUG ((DEBUG_ERROR, "%a: StartupAllAps(): %r\n", __FUNCTION__, Status));
+    DEBUG ((DEBUG_ERROR, "%a: StartupAllAps(): %r\n", __func__, Status));
     return Status;
   }
 
@@ -108,7 +108,7 @@ InstallClearCacheCallback (
     DEBUG ((
       DEBUG_ERROR,
       "%a: failed to set up MP Services callback: %r\n",
-      __FUNCTION__,
+      __func__,
       Status
       ));
   }
diff --git a/OvmfPkg/Bhyve/PlatformPei/MemDetect.c b/OvmfPkg/Bhyve/PlatformPei/MemDetect.c
index 1949e586a07e..29cbb9e3dcc8 100644
--- a/OvmfPkg/Bhyve/PlatformPei/MemDetect.c
+++ b/OvmfPkg/Bhyve/PlatformPei/MemDetect.c
@@ -58,7 +58,7 @@ Q35TsegMbytesInitialization (
       DEBUG_ERROR,
       "%a: no TSEG (SMRAM) on host bridge DID=0x%04x; "
       "only DID=0x%04x (Q35) is supported\n",
-      __FUNCTION__,
+      __func__,
       mHostBridgeDevId,
       INTEL_Q35_MCH_DEVICE_ID
       ));
@@ -92,7 +92,7 @@ Q35TsegMbytesInitialization (
   DEBUG ((
     DEBUG_INFO,
     "%a: QEMU offers an extended TSEG (%d MB)\n",
-    __FUNCTION__,
+    __func__,
     ExtendedTsegMbytes
     ));
   PcdStatus = PcdSet16S (PcdQ35TsegMbytes, ExtendedTsegMbytes);
@@ -185,7 +185,7 @@ GetFirstNonAddress (
       DEBUG ((
         DEBUG_INFO,
         "%a: disabling 64-bit PCI host aperture\n",
-        __FUNCTION__
+        __func__
         ));
       PcdStatus = PcdSet64S (PcdPciMmio64Size, 0);
       ASSERT_RETURN_ERROR (PcdStatus);
@@ -228,7 +228,7 @@ GetFirstNonAddress (
     DEBUG ((
       DEBUG_INFO,
       "%a: Pci64Base=0x%Lx Pci64Size=0x%Lx\n",
-      __FUNCTION__,
+      __func__,
       Pci64Base,
       Pci64Size
       ));
@@ -392,7 +392,7 @@ PublishPeiMemory (
     DEBUG ((
       DEBUG_INFO,
       "%a: mPhysMemAddressWidth=%d PeiMemoryCap=%u KB\n",
-      __FUNCTION__,
+      __func__,
       mPhysMemAddressWidth,
       PeiMemoryCap >> 10
       ));
@@ -441,7 +441,7 @@ QemuInitializeRam (
   MTRR_SETTINGS  MtrrSettings;
   EFI_STATUS     Status;
 
-  DEBUG ((DEBUG_INFO, "%a called\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a called\n", __func__));
 
   //
   // Determine total memory size available
diff --git a/OvmfPkg/Bhyve/PlatformPei/Platform.c b/OvmfPkg/Bhyve/PlatformPei/Platform.c
index eba7c60fced8..2523e49e368a 100644
--- a/OvmfPkg/Bhyve/PlatformPei/Platform.c
+++ b/OvmfPkg/Bhyve/PlatformPei/Platform.c
@@ -373,7 +373,7 @@ MiscInitialization (
       DEBUG ((
         DEBUG_ERROR,
         "%a: Unknown Host Bridge Device ID: 0x%04x\n",
-        __FUNCTION__,
+        __func__,
         mHostBridgeDevId
         ));
       ASSERT (FALSE);
@@ -501,17 +501,17 @@ S3Verification (
     DEBUG ((
       DEBUG_ERROR,
       "%a: S3Resume2Pei doesn't support X64 PEI + SMM yet.\n",
-      __FUNCTION__
+      __func__
       ));
     DEBUG ((
       DEBUG_ERROR,
       "%a: Please disable S3 on the QEMU command line (see the README),\n",
-      __FUNCTION__
+      __func__
       ));
     DEBUG ((
       DEBUG_ERROR,
       "%a: or build OVMF with \"OvmfPkgIa32X64.dsc\".\n",
-      __FUNCTION__
+      __func__
       ));
     ASSERT (FALSE);
     CpuDeadLoop ();
@@ -558,7 +558,7 @@ MaxCpuCountInitialization (
   DEBUG ((
     DEBUG_INFO,
     "%a: QEMU reports %d processor(s)\n",
-    __FUNCTION__,
+    __func__,
     ProcessorCount
     ));
 }
diff --git a/OvmfPkg/CpuHotplugSmm/CpuHotplug.c b/OvmfPkg/CpuHotplugSmm/CpuHotplug.c
index 97ecd32eb6de..d50416302677 100644
--- a/OvmfPkg/CpuHotplugSmm/CpuHotplug.c
+++ b/OvmfPkg/CpuHotplugSmm/CpuHotplug.c
@@ -135,7 +135,7 @@ ProcessHotAddedCpus (
         DEBUG_VERBOSE,
         "%a: APIC ID " FMT_APIC_ID " was hot-plugged "
                                    "before; ignoring it\n",
-        __FUNCTION__,
+        __func__,
         NewApicId
         ));
       PluggedIdx++;
@@ -155,7 +155,7 @@ ProcessHotAddedCpus (
       DEBUG ((
         DEBUG_ERROR,
         "%a: no room for APIC ID " FMT_APIC_ID "\n",
-        __FUNCTION__,
+        __func__,
         NewApicId
         ));
       return EFI_OUT_OF_RESOURCES;
@@ -190,7 +190,7 @@ ProcessHotAddedCpus (
       DEBUG ((
         DEBUG_ERROR,
         "%a: AddProcessor(" FMT_APIC_ID "): %r\n",
-        __FUNCTION__,
+        __func__,
         NewApicId,
         Status
         ));
@@ -201,7 +201,7 @@ ProcessHotAddedCpus (
       DEBUG_INFO,
       "%a: hot-added APIC ID " FMT_APIC_ID ", SMBASE 0x%Lx, "
                                            "EFI_SMM_CPU_SERVICE_PROTOCOL assigned number %Lu\n",
-      __FUNCTION__,
+      __func__,
       NewApicId,
       (UINT64)mCpuHotPlugData->SmBase[NewSlot],
       (UINT64)NewProcessorNumberByProtocol
@@ -310,7 +310,7 @@ EjectCpu (
           DEBUG_INFO,
           "%a: Unplugged ProcessorNum %u, "
           "QemuSelector %Lu\n",
-          __FUNCTION__,
+          __func__,
           Idx,
           QemuSelector
           ));
@@ -454,7 +454,7 @@ UnplugCpus (
         DEBUG_VERBOSE,
         "%a: did not find APIC ID " FMT_APIC_ID
         " to unplug\n",
-        __FUNCTION__,
+        __func__,
         RemoveApicId
         ));
       ToUnplugIdx++;
@@ -469,7 +469,7 @@ UnplugCpus (
       DEBUG ((
         DEBUG_ERROR,
         "%a: RemoveProcessor(" FMT_APIC_ID "): %r\n",
-        __FUNCTION__,
+        __func__,
         RemoveApicId,
         Status
         ));
@@ -493,7 +493,7 @@ UnplugCpus (
         DEBUG_ERROR,
         "%a: ProcessorNum %Lu maps to QemuSelector %Lu, "
         "cannot also map to %u\n",
-        __FUNCTION__,
+        __func__,
         (UINT64)ProcessorNum,
         mCpuHotEjectData->QemuSelectorMap[ProcessorNum],
         QemuSelector
@@ -511,7 +511,7 @@ UnplugCpus (
       DEBUG_INFO,
       "%a: Started hot-unplug on ProcessorNum %Lu, APIC ID "
       FMT_APIC_ID ", QemuSelector %u\n",
-      __FUNCTION__,
+      __func__,
       (UINT64)ProcessorNum,
       RemoveApicId,
       QemuSelector
@@ -635,7 +635,7 @@ CpuHotplugMmi (
     DEBUG ((
       DEBUG_ERROR,
       "%a: failed to read ICH9_APM_CNT: %r\n",
-      __FUNCTION__,
+      __func__,
       Status
       ));
     //
@@ -736,7 +736,7 @@ CpuHotplugEntry (
                     (VOID **)&mMmCpuIo
                     );
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "%a: locate MmCpuIo: %r\n", __FUNCTION__, Status));
+    DEBUG ((DEBUG_ERROR, "%a: locate MmCpuIo: %r\n", __func__, Status));
     goto Fatal;
   }
 
@@ -749,7 +749,7 @@ CpuHotplugEntry (
     DEBUG ((
       DEBUG_ERROR,
       "%a: locate MmCpuService: %r\n",
-      __FUNCTION__,
+      __func__,
       Status
       ));
     goto Fatal;
@@ -767,7 +767,7 @@ CpuHotplugEntry (
 
   if (mCpuHotPlugData == NULL) {
     Status = EFI_NOT_FOUND;
-    DEBUG ((DEBUG_ERROR, "%a: CPU_HOT_PLUG_DATA: %r\n", __FUNCTION__, Status));
+    DEBUG ((DEBUG_ERROR, "%a: CPU_HOT_PLUG_DATA: %r\n", __func__, Status));
     goto Fatal;
   }
 
@@ -787,7 +787,7 @@ CpuHotplugEntry (
   }
 
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "%a: CPU_HOT_EJECT_DATA: %r\n", __FUNCTION__, Status));
+    DEBUG ((DEBUG_ERROR, "%a: CPU_HOT_EJECT_DATA: %r\n", __func__, Status));
     goto Fatal;
   }
 
@@ -799,7 +799,7 @@ CpuHotplugEntry (
       RETURN_ERROR (SafeUintnMult (sizeof (UINT32), Len, &SizeSel)))
   {
     Status = EFI_ABORTED;
-    DEBUG ((DEBUG_ERROR, "%a: invalid CPU_HOT_PLUG_DATA\n", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a: invalid CPU_HOT_PLUG_DATA\n", __func__));
     goto Fatal;
   }
 
@@ -809,7 +809,7 @@ CpuHotplugEntry (
                     (VOID **)&mPluggedApicIds
                     );
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "%a: MmAllocatePool(): %r\n", __FUNCTION__, Status));
+    DEBUG ((DEBUG_ERROR, "%a: MmAllocatePool(): %r\n", __func__, Status));
     goto Fatal;
   }
 
@@ -819,7 +819,7 @@ CpuHotplugEntry (
                     (VOID **)&mToUnplugApicIds
                     );
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "%a: MmAllocatePool(): %r\n", __FUNCTION__, Status));
+    DEBUG ((DEBUG_ERROR, "%a: MmAllocatePool(): %r\n", __func__, Status));
     goto ReleasePluggedApicIds;
   }
 
@@ -829,7 +829,7 @@ CpuHotplugEntry (
                     (VOID **)&mToUnplugSelectors
                     );
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "%a: MmAllocatePool(): %r\n", __FUNCTION__, Status));
+    DEBUG ((DEBUG_ERROR, "%a: MmAllocatePool(): %r\n", __func__, Status));
     goto ReleaseToUnplugApicIds;
   }
 
@@ -874,7 +874,7 @@ CpuHotplugEntry (
     DEBUG ((
       DEBUG_ERROR,
       "%a: modern CPU hotplug interface: %r\n",
-      __FUNCTION__,
+      __func__,
       Status
       ));
     goto ReleasePostSmmPen;
@@ -892,7 +892,7 @@ CpuHotplugEntry (
     DEBUG ((
       DEBUG_ERROR,
       "%a: MmiHandlerRegister(): %r\n",
-      __FUNCTION__,
+      __func__,
       Status
       ));
     goto ReleasePostSmmPen;
diff --git a/OvmfPkg/CpuHotplugSmm/QemuCpuhp.c b/OvmfPkg/CpuHotplugSmm/QemuCpuhp.c
index ec3dc379f309..1687dada4c92 100644
--- a/OvmfPkg/CpuHotplugSmm/QemuCpuhp.c
+++ b/OvmfPkg/CpuHotplugSmm/QemuCpuhp.c
@@ -36,7 +36,7 @@ QemuCpuhpReadCommandData2 (
                                &CommandData2
                                );
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "%a: %r\n", __FUNCTION__, Status));
+    DEBUG ((DEBUG_ERROR, "%a: %r\n", __func__, Status));
     ASSERT (FALSE);
     CpuDeadLoop ();
   }
@@ -61,7 +61,7 @@ QemuCpuhpReadCpuStatus (
                             &CpuStatus
                             );
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "%a: %r\n", __FUNCTION__, Status));
+    DEBUG ((DEBUG_ERROR, "%a: %r\n", __func__, Status));
     ASSERT (FALSE);
     CpuDeadLoop ();
   }
@@ -86,7 +86,7 @@ QemuCpuhpReadCommandData (
                               &CommandData
                               );
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "%a: %r\n", __FUNCTION__, Status));
+    DEBUG ((DEBUG_ERROR, "%a: %r\n", __func__, Status));
     ASSERT (FALSE);
     CpuDeadLoop ();
   }
@@ -110,7 +110,7 @@ QemuCpuhpWriteCpuSelector (
                          &Selector
                          );
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "%a: %r\n", __FUNCTION__, Status));
+    DEBUG ((DEBUG_ERROR, "%a: %r\n", __func__, Status));
     ASSERT (FALSE);
     CpuDeadLoop ();
   }
@@ -132,7 +132,7 @@ QemuCpuhpWriteCpuStatus (
                          &CpuStatus
                          );
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "%a: %r\n", __FUNCTION__, Status));
+    DEBUG ((DEBUG_ERROR, "%a: %r\n", __func__, Status));
     ASSERT (FALSE);
     CpuDeadLoop ();
   }
@@ -154,7 +154,7 @@ QemuCpuhpWriteCommand (
                          &Command
                          );
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "%a: %r\n", __FUNCTION__, Status));
+    DEBUG ((DEBUG_ERROR, "%a: %r\n", __func__, Status));
     ASSERT (FALSE);
     CpuDeadLoop ();
   }
@@ -266,7 +266,7 @@ QemuCpuhpCollectApicIds (
         DEBUG_VERBOSE,
         "%a: CurrentSelector=%u PendingSelector=%u: "
         "wrap-around\n",
-        __FUNCTION__,
+        __func__,
         CurrentSelector,
         PendingSelector
         ));
@@ -291,7 +291,7 @@ QemuCpuhpCollectApicIds (
           DEBUG_ERROR,
           "%a: CurrentSelector=%u CpuStatus=0x%x: "
           "inconsistent CPU status\n",
-          __FUNCTION__,
+          __func__,
           CurrentSelector,
           CpuStatus
           ));
@@ -301,7 +301,7 @@ QemuCpuhpCollectApicIds (
       DEBUG ((
         DEBUG_VERBOSE,
         "%a: CurrentSelector=%u: insert\n",
-        __FUNCTION__,
+        __func__,
         CurrentSelector
         ));
 
@@ -317,7 +317,7 @@ QemuCpuhpCollectApicIds (
           DEBUG_ERROR,
           "%a: CurrentSelector=%u CpuStatus=0x%x: "
           "inconsistent CPU status\n",
-          __FUNCTION__,
+          __func__,
           CurrentSelector,
           CpuStatus
           ));
@@ -327,7 +327,7 @@ QemuCpuhpCollectApicIds (
       DEBUG ((
         DEBUG_VERBOSE,
         "%a: CurrentSelector=%u: fw_remove\n",
-        __FUNCTION__,
+        __func__,
         CurrentSelector
         ));
 
@@ -341,7 +341,7 @@ QemuCpuhpCollectApicIds (
       DEBUG ((
         DEBUG_VERBOSE,
         "%a: CurrentSelector=%u: remove (ignored)\n",
-        __FUNCTION__,
+        __func__,
         CurrentSelector
         ));
 
@@ -352,7 +352,7 @@ QemuCpuhpCollectApicIds (
       DEBUG ((
         DEBUG_VERBOSE,
         "%a: CurrentSelector=%u: no event\n",
-        __FUNCTION__,
+        __func__,
         CurrentSelector
         ));
       break;
@@ -368,7 +368,7 @@ QemuCpuhpCollectApicIds (
       // For unplug events, also save the CurrentSelector.
       //
       if (*ExtendCount == ApicIdCount) {
-        DEBUG ((DEBUG_ERROR, "%a: APIC ID array too small\n", __FUNCTION__));
+        DEBUG ((DEBUG_ERROR, "%a: APIC ID array too small\n", __func__));
         return EFI_BUFFER_TOO_SMALL;
       }
 
@@ -377,7 +377,7 @@ QemuCpuhpCollectApicIds (
       DEBUG ((
         DEBUG_VERBOSE,
         "%a: ApicId=" FMT_APIC_ID "\n",
-        __FUNCTION__,
+        __func__,
         NewApicId
         ));
       if (ExtendSels != NULL) {
@@ -399,7 +399,7 @@ QemuCpuhpCollectApicIds (
   DEBUG ((
     DEBUG_VERBOSE,
     "%a: PluggedCount=%u ToUnplugCount=%u\n",
-    __FUNCTION__,
+    __func__,
     *PluggedCount,
     *ToUnplugCount
     ));
diff --git a/OvmfPkg/CpuHotplugSmm/Smbase.c b/OvmfPkg/CpuHotplugSmm/Smbase.c
index 5d5060589317..dc6f4f4b4994 100644
--- a/OvmfPkg/CpuHotplugSmm/Smbase.c
+++ b/OvmfPkg/CpuHotplugSmm/Smbase.c
@@ -62,7 +62,7 @@ SmbaseAllocatePostSmmPen (
     DEBUG ((
       DEBUG_ERROR,
       "%a: mPostSmmPenSize=%u: %r\n",
-      __FUNCTION__,
+      __func__,
       mPostSmmPenSize,
       Status
       ));
@@ -77,11 +77,11 @@ SmbaseAllocatePostSmmPen (
                             &Address
                             );
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "%a: AllocatePages(): %r\n", __FUNCTION__, Status));
+    DEBUG ((DEBUG_ERROR, "%a: AllocatePages(): %r\n", __func__, Status));
     return Status;
   }
 
-  DEBUG ((DEBUG_INFO, "%a: Post-SMM Pen at 0x%Lx\n", __FUNCTION__, Address));
+  DEBUG ((DEBUG_INFO, "%a: Post-SMM Pen at 0x%Lx\n", __func__, Address));
   *PenAddress = (UINT32)Address;
   return EFI_SUCCESS;
 }
@@ -211,7 +211,7 @@ SmbaseRelocate (
     DEBUG ((
       DEBUG_ERROR,
       "%a: ApicId=" FMT_APIC_ID " Smbase=0x%Lx: %r\n",
-      __FUNCTION__,
+      __func__,
       ApicId,
       (UINT64)Smbase,
       Status
@@ -289,7 +289,7 @@ SmbaseRelocate (
     DEBUG ((
       DEBUG_ERROR,
       "%a: ApicId=" FMT_APIC_ID " ApicIdGate=0x%Lx: %r\n",
-      __FUNCTION__,
+      __func__,
       ApicId,
       ExchangeResult,
       Status
diff --git a/OvmfPkg/CpuS3DataDxe/CpuS3Data.c b/OvmfPkg/CpuS3DataDxe/CpuS3Data.c
index c192a09cf182..289048b75db3 100644
--- a/OvmfPkg/CpuS3DataDxe/CpuS3Data.c
+++ b/OvmfPkg/CpuS3DataDxe/CpuS3Data.c
@@ -127,7 +127,7 @@ CpuS3DataOnEndOfDxe (
                                                     );
   ASSERT_EFI_ERROR (Status);
 
-  DEBUG ((DEBUG_VERBOSE, "%a\n", __FUNCTION__));
+  DEBUG ((DEBUG_VERBOSE, "%a\n", __func__));
   MtrrGetAllMtrrs (&AcpiCpuDataEx->MtrrTable);
 
   //
diff --git a/OvmfPkg/Csm/CsmSupportLib/LegacyInterrupt.c b/OvmfPkg/Csm/CsmSupportLib/LegacyInterrupt.c
index 5bed2e2b5107..410e4e457d9c 100644
--- a/OvmfPkg/Csm/CsmSupportLib/LegacyInterrupt.c
+++ b/OvmfPkg/Csm/CsmSupportLib/LegacyInterrupt.c
@@ -190,7 +190,7 @@ LegacyInterruptInstall (
       DEBUG ((
         DEBUG_ERROR,
         "%a: Unknown Host Bridge Device ID: 0x%04x\n",
-        __FUNCTION__,
+        __func__,
         HostBridgeDevId
         ));
       ASSERT (FALSE);
diff --git a/OvmfPkg/Csm/CsmSupportLib/LegacyRegion.c b/OvmfPkg/Csm/CsmSupportLib/LegacyRegion.c
index 4969c88dc33e..3c32b75bd692 100644
--- a/OvmfPkg/Csm/CsmSupportLib/LegacyRegion.c
+++ b/OvmfPkg/Csm/CsmSupportLib/LegacyRegion.c
@@ -484,7 +484,7 @@ LegacyRegionInit (
       DEBUG ((
         DEBUG_ERROR,
         "%a: Unknown Host Bridge Device ID: 0x%04x\n",
-        __FUNCTION__,
+        __func__,
         HostBridgeDevId
         ));
       ASSERT (FALSE);
diff --git a/OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.c b/OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.c
index 094e4c821bd5..88b6bafee8cc 100644
--- a/OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.c
+++ b/OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.c
@@ -393,7 +393,7 @@ EnrollListOfCerts (
   if (EFI_ERROR (Status)) {
     AsciiPrint (
       "error: %a(\"%s\", %g): %r\n",
-      __FUNCTION__,
+      __func__,
       VariableName,
       VendorGuid,
       Status
diff --git a/OvmfPkg/Fdt/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c b/OvmfPkg/Fdt/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c
index 14b41a533e96..0d116f60dd4d 100644
--- a/OvmfPkg/Fdt/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c
+++ b/OvmfPkg/Fdt/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c
@@ -61,7 +61,7 @@ MapGcdMmioSpace (
     DEBUG ((
       DEBUG_ERROR,
       "%a: failed to add GCD memory space for region [0x%Lx+0x%Lx)\n",
-      __FUNCTION__,
+      __func__,
       Base,
       Size
       ));
@@ -73,7 +73,7 @@ MapGcdMmioSpace (
     DEBUG ((
       DEBUG_ERROR,
       "%a: failed to set memory space attributes for region [0x%Lx+0x%Lx)\n",
-      __FUNCTION__,
+      __func__,
       Base,
       Size
       ));
@@ -143,7 +143,7 @@ ProcessPciHost (
     DEBUG ((
       DEBUG_INFO,
       "%a: No 'pci-host-ecam-generic' compatible DT node found\n",
-      __FUNCTION__
+      __func__
       ));
     return EFI_NOT_FOUND;
   }
@@ -169,7 +169,7 @@ ProcessPciHost (
     DEBUG ((
       DEBUG_ERROR,
       "%a: 'reg' property not found or invalid\n",
-      __FUNCTION__
+      __func__
       ));
     return EFI_PROTOCOL_ERROR;
   }
@@ -194,7 +194,7 @@ ProcessPciHost (
     DEBUG ((
       DEBUG_ERROR,
       "%a: 'bus-range' not found or invalid\n",
-      __FUNCTION__
+      __func__
       ));
     return EFI_PROTOCOL_ERROR;
   }
@@ -212,7 +212,7 @@ ProcessPciHost (
     DEBUG ((
       DEBUG_ERROR,
       "%a: invalid 'bus-range' and/or 'reg'\n",
-      __FUNCTION__
+      __func__
       ));
     return EFI_PROTOCOL_ERROR;
   }
@@ -224,7 +224,7 @@ ProcessPciHost (
   if (EFI_ERROR (Status) || (Len == 0) ||
       (Len % sizeof (DTB_PCI_HOST_RANGE_RECORD) != 0))
   {
-    DEBUG ((DEBUG_ERROR, "%a: 'ranges' not found or invalid\n", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a: 'ranges' not found or invalid\n", __func__));
     return EFI_PROTOCOL_ERROR;
   }
 
@@ -251,7 +251,7 @@ ProcessPciHost (
         if ((*Mmio32Base > MAX_UINT32) || (*Mmio32Size > MAX_UINT32) ||
             (*Mmio32Base + *Mmio32Size > SIZE_4GB))
         {
-          DEBUG ((DEBUG_ERROR, "%a: MMIO32 space invalid\n", __FUNCTION__));
+          DEBUG ((DEBUG_ERROR, "%a: MMIO32 space invalid\n", __func__));
           return EFI_PROTOCOL_ERROR;
         }
 
@@ -262,7 +262,7 @@ ProcessPciHost (
             DEBUG_ERROR,
             "%a: unsupported nonzero MMIO32 translation "
             "0x%Lx\n",
-            __FUNCTION__,
+            __func__,
             Mmio32Translation
             ));
           return EFI_UNSUPPORTED;
@@ -282,7 +282,7 @@ ProcessPciHost (
             DEBUG_ERROR,
             "%a: unsupported nonzero MMIO64 translation "
             "0x%Lx\n",
-            __FUNCTION__,
+            __func__,
             Mmio64Translation
             ));
           return EFI_UNSUPPORTED;
@@ -293,7 +293,7 @@ ProcessPciHost (
   }
 
   if (*Mmio32Size == 0) {
-    DEBUG ((DEBUG_ERROR, "%a: MMIO32 space empty\n", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a: MMIO32 space empty\n", __func__));
     return EFI_PROTOCOL_ERROR;
   }
 
@@ -307,7 +307,7 @@ ProcessPciHost (
     DEBUG_INFO,
     "%a: Config[0x%Lx+0x%Lx) Bus[0x%x..0x%x] "
     "Io[0x%Lx+0x%Lx)@0x%Lx Mem32[0x%Lx+0x%Lx)@0x0 Mem64[0x%Lx+0x%Lx)@0x0\n",
-    __FUNCTION__,
+    __func__,
     ConfigBase,
     ConfigSize,
     *BusMin,
@@ -370,7 +370,7 @@ PciHostBridgeGetRootBridges (
   PCI_ROOT_BRIDGE_APERTURE  PMemAbove4G;
 
   if (PcdGet64 (PcdPciExpressBaseAddress) == 0) {
-    DEBUG ((DEBUG_INFO, "%a: PCI host bridge not present\n", __FUNCTION__));
+    DEBUG ((DEBUG_INFO, "%a: PCI host bridge not present\n", __func__));
 
     *Count = 0;
     return NULL;
@@ -390,7 +390,7 @@ PciHostBridgeGetRootBridges (
     DEBUG ((
       DEBUG_ERROR,
       "%a: failed to discover PCI host bridge: %r\n",
-      __FUNCTION__,
+      __func__,
       Status
       ));
     *Count = 0;
diff --git a/OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.c b/OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.c
index b5a6718146f8..a3b09e547fb7 100644
--- a/OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.c
+++ b/OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.c
@@ -58,7 +58,7 @@ GetPciIoTranslation (
   if (EFI_ERROR (Status) || (Len == 0) ||
       (Len % sizeof (DTB_PCI_HOST_RANGE_RECORD) != 0))
   {
-    DEBUG ((DEBUG_ERROR, "%a: 'ranges' not found or invalid\n", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a: 'ranges' not found or invalid\n", __func__));
     return RETURN_PROTOCOL_ERROR;
   }
 
@@ -152,7 +152,7 @@ FdtPciPcdProducerLibConstructor (
         DEBUG ((
           DEBUG_WARN,
           "%a: 'pci-host-ecam-generic' device encountered with no I/O range\n",
-          __FUNCTION__
+          __func__
           ));
       }
     }
diff --git a/OvmfPkg/Fdt/HighMemDxe/HighMemDxe.c b/OvmfPkg/Fdt/HighMemDxe/HighMemDxe.c
index 87bc8b6827a2..779bf5c827f5 100644
--- a/OvmfPkg/Fdt/HighMemDxe/HighMemDxe.c
+++ b/OvmfPkg/Fdt/HighMemDxe/HighMemDxe.c
@@ -93,7 +93,7 @@ InitializeHighMemDxe (
         DEBUG ((
           DEBUG_WARN,
           "%a: Region 0x%lx - 0x%lx not found in the GCD memory space map\n",
-          __FUNCTION__,
+          __func__,
           CurBase,
           CurBase + CurSize - 1
           ));
@@ -112,7 +112,7 @@ InitializeHighMemDxe (
           DEBUG ((
             DEBUG_ERROR,
             "%a: Failed to add System RAM @ 0x%lx - 0x%lx (%r)\n",
-            __FUNCTION__,
+            __func__,
             CurBase,
             CurBase + CurSize - 1,
             Status
@@ -129,7 +129,7 @@ InitializeHighMemDxe (
           DEBUG ((
             DEBUG_WARN,
             "%a: gDS->SetMemorySpaceAttributes() failed on region 0x%lx - 0x%lx (%r)\n",
-            __FUNCTION__,
+            __func__,
             CurBase,
             CurBase + CurSize - 1,
             Status
@@ -160,7 +160,7 @@ InitializeHighMemDxe (
           DEBUG ((
             DEBUG_ERROR,
             "%a: Failed to set System RAM @ 0x%lx - 0x%lx attribute (%r)\n",
-            __FUNCTION__,
+            __func__,
             CurBase,
             CurBase + CurSize - 1,
             Status
@@ -169,7 +169,7 @@ InitializeHighMemDxe (
           DEBUG ((
             DEBUG_INFO,
             "%a: Add System RAM @ 0x%lx - 0x%lx\n",
-            __FUNCTION__,
+            __func__,
             CurBase,
             CurBase + CurSize - 1
             ));
diff --git a/OvmfPkg/Fdt/VirtioFdtDxe/VirtioFdtDxe.c b/OvmfPkg/Fdt/VirtioFdtDxe/VirtioFdtDxe.c
index 619740e6e708..668090dbea80 100644
--- a/OvmfPkg/Fdt/VirtioFdtDxe/VirtioFdtDxe.c
+++ b/OvmfPkg/Fdt/VirtioFdtDxe/VirtioFdtDxe.c
@@ -75,7 +75,7 @@ InitializeVirtioFdtDxe (
       DEBUG ((
         DEBUG_ERROR,
         "%a: GetNodeProperty () failed (Status == %r)\n",
-        __FUNCTION__,
+        __func__,
         Status
         ));
       continue;
@@ -93,7 +93,7 @@ InitializeVirtioFdtDxe (
                                                    sizeof (VIRTIO_TRANSPORT_DEVICE_PATH)
                                                    );
     if (DevicePath == NULL) {
-      DEBUG ((DEBUG_ERROR, "%a: Out of memory\n", __FUNCTION__));
+      DEBUG ((DEBUG_ERROR, "%a: Out of memory\n", __func__));
       continue;
     }
 
@@ -117,7 +117,7 @@ InitializeVirtioFdtDxe (
         DEBUG_ERROR,
         "%a: Failed to install the EFI_DEVICE_PATH "
         "protocol on a new handle (Status == %r)\n",
-        __FUNCTION__,
+        __func__,
         Status
         ));
       FreePool (DevicePath);
@@ -130,7 +130,7 @@ InitializeVirtioFdtDxe (
         DEBUG_ERROR,
         "%a: Failed to install VirtIO transport @ 0x%Lx "
         "on handle %p (Status == %r)\n",
-        __FUNCTION__,
+        __func__,
         RegBase,
         Handle,
         Status
@@ -152,7 +152,7 @@ InitializeVirtioFdtDxe (
       DEBUG_ERROR,
       "%a: Error occurred while iterating DT nodes "
       "(FindNodeStatus == %r)\n",
-      __FUNCTION__,
+      __func__,
       FindNodeStatus
       ));
   }
diff --git a/OvmfPkg/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.c b/OvmfPkg/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.c
index 686d85633e7c..3092a174bc51 100644
--- a/OvmfPkg/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.c
+++ b/OvmfPkg/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.c
@@ -275,7 +275,7 @@ CheckDevice (
     DEBUG ((
       DEBUG_WARN,
       "%a: 64-bit MMIO BARs may be degraded for PCI 0x%04x:0x%04x (rev %d)\n",
-      __FUNCTION__,
+      __func__,
       (UINT32)VendorId,
       (UINT32)DeviceId,
       (UINT8)RevisionId
diff --git a/OvmfPkg/IoMmuDxe/CcIoMmu.c b/OvmfPkg/IoMmuDxe/CcIoMmu.c
index 7c2843cd238a..b83a9690062b 100644
--- a/OvmfPkg/IoMmuDxe/CcIoMmu.c
+++ b/OvmfPkg/IoMmuDxe/CcIoMmu.c
@@ -92,7 +92,7 @@ IoMmuMap (
   DEBUG ((
     DEBUG_VERBOSE,
     "%a: Operation=%a Host=0x%p Bytes=0x%Lx\n",
-    __FUNCTION__,
+    __func__,
     ((Operation >= 0 &&
       Operation < ARRAY_SIZE (mBusMasterOperationName)) ?
      mBusMasterOperationName[Operation] :
@@ -289,7 +289,7 @@ IoMmuMap (
   DEBUG ((
     DEBUG_VERBOSE,
     "%a: Mapping=0x%p Device(PlainText)=0x%Lx Crypted=0x%Lx Pages=0x%Lx, ReservedMemBitmap=0x%Lx\n",
-    __FUNCTION__,
+    __func__,
     MapInfo,
     MapInfo->PlainTextAddress,
     MapInfo->CryptedAddress,
@@ -342,7 +342,7 @@ IoMmuUnmapWorker (
   DEBUG ((
     DEBUG_VERBOSE,
     "%a: Mapping=0x%p MemoryMapLocked=%d\n",
-    __FUNCTION__,
+    __func__,
     Mapping,
     MemoryMapLocked
     ));
@@ -537,7 +537,7 @@ IoMmuAllocateBuffer (
   DEBUG ((
     DEBUG_VERBOSE,
     "%a: MemoryType=%u Pages=0x%Lx Attributes=0x%Lx\n",
-    __FUNCTION__,
+    __func__,
     (UINT32)MemoryType,
     (UINT64)Pages,
     Attributes
@@ -625,7 +625,7 @@ IoMmuAllocateBuffer (
   DEBUG ((
     DEBUG_VERBOSE,
     "%a: Host=0x%Lx Stash=0x%p\n",
-    __FUNCTION__,
+    __func__,
     PhysicalAddress,
     StashBuffer
     ));
@@ -663,7 +663,7 @@ IoMmuFreeBuffer (
   DEBUG ((
     DEBUG_VERBOSE,
     "%a: Host=0x%p Pages=0x%Lx\n",
-    __FUNCTION__,
+    __func__,
     HostAddress,
     (UINT64)Pages
     ));
@@ -818,7 +818,7 @@ IoMmuExitBoot (
   //   queue EventToSignal's NotifyFunction after the NotifyFunctions of *all*
   //   events in EFI_EVENT_GROUP_EXIT_BOOT_SERVICES.
   //
-  DEBUG ((DEBUG_VERBOSE, "%a\n", __FUNCTION__));
+  DEBUG ((DEBUG_VERBOSE, "%a\n", __func__));
   gBS->SignalEvent (EventToSignal);
 }
 
@@ -847,7 +847,7 @@ IoMmuUnmapAllMappings (
   LIST_ENTRY  *NextNode;
   MAP_INFO    *MapInfo;
 
-  DEBUG ((DEBUG_VERBOSE, "%a\n", __FUNCTION__));
+  DEBUG ((DEBUG_VERBOSE, "%a\n", __func__));
 
   //
   // All drivers that had set up IOMMU mappings have halted their respective
@@ -933,7 +933,7 @@ InstallIoMmuProtocol (
   if (EFI_ERROR (Status)) {
     mReservedSharedMemSupported = FALSE;
   } else {
-    DEBUG ((DEBUG_INFO, "%a: Feature of reserved memory for DMA is supported.\n", __FUNCTION__));
+    DEBUG ((DEBUG_INFO, "%a: Feature of reserved memory for DMA is supported.\n", __func__));
   }
 
   return EFI_SUCCESS;
diff --git a/OvmfPkg/IoMmuDxe/IoMmuBuffer.c b/OvmfPkg/IoMmuDxe/IoMmuBuffer.c
index 83c7c5958340..c8f6cf4818e8 100644
--- a/OvmfPkg/IoMmuDxe/IoMmuBuffer.c
+++ b/OvmfPkg/IoMmuDxe/IoMmuBuffer.c
@@ -153,7 +153,7 @@ IoMmuInitReservedSharedMem (
   DEBUG ((
     DEBUG_VERBOSE,
     "%a: ReservedMem (%d pages) address = 0x%llx\n",
-    __FUNCTION__,
+    __func__,
     TotalPages,
     PhysicalAddress
     ));
@@ -330,7 +330,7 @@ InternalAllocateBuffer (
   DEBUG ((
     DEBUG_VERBOSE,
     "%a: range-size: %lx, start-address=0x%llx, pages=0x%llx, bits=0x%lx, bitmap: %lx => %lx\n",
-    __FUNCTION__,
+    __func__,
     MemRange->DataSize,
     *PhysicalAddress,
     Pages,
@@ -401,7 +401,7 @@ IoMmuFreeBounceBuffer (
     DEBUG ((
       DEBUG_VERBOSE,
       "%a: PlainTextAddress=0x%Lx, bits=0x%Lx, bitmap: %Lx => %Lx\n",
-      __FUNCTION__,
+      __func__,
       MapInfo->PlainTextAddress,
       MapInfo->ReservedMemBitmap,
       mReservedMemBitmap,
@@ -480,7 +480,7 @@ IoMmuFreeCommonBuffer (
   DEBUG ((
     DEBUG_VERBOSE,
     "%a: CommonBuffer=0x%Lx, bits=0x%Lx, bitmap: %Lx => %Lx\n",
-    __FUNCTION__,
+    __func__,
     (UINT64)(UINTN)CommonBufferHeader + SIZE_4KB,
     CommonBufferHeader->ReservedMemBitmap,
     mReservedMemBitmap,
diff --git a/OvmfPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.c b/OvmfPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.c
index 6d1e1cb05e00..150fe07c672b 100644
--- a/OvmfPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.c
+++ b/OvmfPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.c
@@ -62,7 +62,7 @@ AcpiTimerLibConstructor (
       DEBUG ((
         DEBUG_ERROR,
         "%a: Unknown Host Bridge Device ID: 0x%04x\n",
-        __FUNCTION__,
+        __func__,
         HostBridgeDevId
         ));
       ASSERT (FALSE);
diff --git a/OvmfPkg/Library/AcpiTimerLib/BaseRomAcpiTimerLib.c b/OvmfPkg/Library/AcpiTimerLib/BaseRomAcpiTimerLib.c
index c771997a2a49..9b3cd055117a 100644
--- a/OvmfPkg/Library/AcpiTimerLib/BaseRomAcpiTimerLib.c
+++ b/OvmfPkg/Library/AcpiTimerLib/BaseRomAcpiTimerLib.c
@@ -59,7 +59,7 @@ AcpiTimerLibConstructor (
       DEBUG ((
         DEBUG_ERROR,
         "%a: Unknown Host Bridge Device ID: 0x%04x\n",
-        __FUNCTION__,
+        __func__,
         HostBridgeDevId
         ));
       ASSERT (FALSE);
@@ -119,7 +119,7 @@ InternalAcpiGetTimerTick (
       DEBUG ((
         DEBUG_ERROR,
         "%a: Unknown Host Bridge Device ID: 0x%04x\n",
-        __FUNCTION__,
+        __func__,
         HostBridgeDevId
         ));
       ASSERT (FALSE);
diff --git a/OvmfPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.c b/OvmfPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.c
index 01a41a6a4515..03d47cf11cce 100644
--- a/OvmfPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.c
+++ b/OvmfPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.c
@@ -76,7 +76,7 @@ AcpiTimerLibConstructor (
       DEBUG ((
         DEBUG_ERROR,
         "%a: Unknown Host Bridge Device ID: 0x%04x\n",
-        __FUNCTION__,
+        __func__,
         HostBridgeDevId
         ));
       ASSERT (FALSE);
diff --git a/OvmfPkg/Library/BaseMemEncryptSevLib/X64/PeiDxeVirtualMemory.c b/OvmfPkg/Library/BaseMemEncryptSevLib/X64/PeiDxeVirtualMemory.c
index b9c0a5b25ac0..a1f6e61c1e09 100644
--- a/OvmfPkg/Library/BaseMemEncryptSevLib/X64/PeiDxeVirtualMemory.c
+++ b/OvmfPkg/Library/BaseMemEncryptSevLib/X64/PeiDxeVirtualMemory.c
@@ -164,7 +164,7 @@ AllocatePageTableMemory (
     DEBUG_VERBOSE,
     "%a:%a: Buffer=0x%Lx Pages=%ld\n",
     gEfiCallerBaseName,
-    __FUNCTION__,
+    __func__,
     Buffer,
     Pages
     ));
@@ -561,7 +561,7 @@ InternalMemEncryptSevCreateIdentityMap1G (
     DEBUG_VERBOSE,
     "%a:%a: Cr3Base=0x%Lx Physical=0x%Lx Length=0x%Lx\n",
     gEfiCallerBaseName,
-    __FUNCTION__,
+    __func__,
     Cr3BaseAddress,
     PhysicalAddress,
     (UINT64)Length
@@ -606,7 +606,7 @@ InternalMemEncryptSevCreateIdentityMap1G (
         DEBUG_ERROR,
         "%a:%a: bad PML4 for Physical=0x%Lx\n",
         gEfiCallerBaseName,
-        __FUNCTION__,
+        __func__,
         PhysicalAddress
         ));
       Status = RETURN_NO_MAPPING;
@@ -713,7 +713,7 @@ SetMemoryEncDec (
     DEBUG_VERBOSE,
     "%a:%a: Cr3Base=0x%Lx Physical=0x%Lx Length=0x%Lx Mode=%a CacheFlush=%u Mmio=%u\n",
     gEfiCallerBaseName,
-    __FUNCTION__,
+    __func__,
     Cr3BaseAddress,
     PhysicalAddress,
     (UINT64)Length,
@@ -786,7 +786,7 @@ SetMemoryEncDec (
         DEBUG_ERROR,
         "%a:%a: bad PML4 for Physical=0x%Lx\n",
         gEfiCallerBaseName,
-        __FUNCTION__,
+        __func__,
         PhysicalAddress
         ));
       Status = RETURN_NO_MAPPING;
@@ -803,7 +803,7 @@ SetMemoryEncDec (
         DEBUG_ERROR,
         "%a:%a: bad PDPE for Physical=0x%Lx\n",
         gEfiCallerBaseName,
-        __FUNCTION__,
+        __func__,
         PhysicalAddress
         ));
       Status = RETURN_NO_MAPPING;
@@ -824,7 +824,7 @@ SetMemoryEncDec (
           DEBUG_VERBOSE,
           "%a:%a: updated 1GB entry for Physical=0x%Lx\n",
           gEfiCallerBaseName,
-          __FUNCTION__,
+          __func__,
           PhysicalAddress
           ));
         PhysicalAddress += BIT30;
@@ -837,7 +837,7 @@ SetMemoryEncDec (
           DEBUG_VERBOSE,
           "%a:%a: splitting 1GB page for Physical=0x%Lx\n",
           gEfiCallerBaseName,
-          __FUNCTION__,
+          __func__,
           PhysicalAddress
           ));
         Split1GPageTo2M (
@@ -865,7 +865,7 @@ SetMemoryEncDec (
           DEBUG_ERROR,
           "%a:%a: bad PDE for Physical=0x%Lx\n",
           gEfiCallerBaseName,
-          __FUNCTION__,
+          __func__,
           PhysicalAddress
           ));
         Status = RETURN_NO_MAPPING;
@@ -892,7 +892,7 @@ SetMemoryEncDec (
             DEBUG_VERBOSE,
             "%a:%a: splitting 2MB page for Physical=0x%Lx\n",
             gEfiCallerBaseName,
-            __FUNCTION__,
+            __func__,
             PhysicalAddress
             ));
           Split2MPageTo4K (
@@ -917,7 +917,7 @@ SetMemoryEncDec (
             DEBUG_ERROR,
             "%a:%a: bad PTE for Physical=0x%Lx\n",
             gEfiCallerBaseName,
-            __FUNCTION__,
+            __func__,
             PhysicalAddress
             ));
           Status = RETURN_NO_MAPPING;
diff --git a/OvmfPkg/Library/BaseMemEncryptSevLib/X64/SnpPageStateChangeInternal.c b/OvmfPkg/Library/BaseMemEncryptSevLib/X64/SnpPageStateChangeInternal.c
index 7a8878b1a9c2..85eb41585b91 100644
--- a/OvmfPkg/Library/BaseMemEncryptSevLib/X64/SnpPageStateChangeInternal.c
+++ b/OvmfPkg/Library/BaseMemEncryptSevLib/X64/SnpPageStateChangeInternal.c
@@ -113,7 +113,7 @@ PvalidateRange (
         DEBUG_ERROR,
         "%a:%a: Failed to %a address 0x%Lx Error code %d\n",
         gEfiCallerBaseName,
-        __FUNCTION__,
+        __func__,
         Validate ? "Validate" : "Invalidate",
         Address,
         Ret
@@ -237,7 +237,7 @@ InternalSetPageState (
     DEBUG_VERBOSE,
     "%a:%a Address 0x%Lx - 0x%Lx State = %a LargeEntry = %d\n",
     gEfiCallerBaseName,
-    __FUNCTION__,
+    __func__,
     BaseAddress,
     EndAddress,
     State == SevSnpPageShared ? "Shared" : "Private",
diff --git a/OvmfPkg/Library/BaseMemEncryptTdxLib/MemoryEncryption.c b/OvmfPkg/Library/BaseMemEncryptTdxLib/MemoryEncryption.c
index 5b13042512ad..a01dc98852b8 100644
--- a/OvmfPkg/Library/BaseMemEncryptTdxLib/MemoryEncryption.c
+++ b/OvmfPkg/Library/BaseMemEncryptTdxLib/MemoryEncryption.c
@@ -180,7 +180,7 @@ AllocatePageTableMemory (
     DEBUG_VERBOSE,
     "%a:%a: Buffer=0x%Lx Pages=%ld\n",
     gEfiCallerBaseName,
-    __FUNCTION__,
+    __func__,
     Buffer,
     Pages
     ));
@@ -542,7 +542,7 @@ SetOrClearSharedBit (
 
   TdStatus = TdVmCall (TDVMCALL_MAPGPA, PhysicalAddress, Length, 0, 0, NULL);
   if (TdStatus != 0) {
-    DEBUG ((DEBUG_ERROR, "%a: TdVmcall(MAPGPA) failed with %llx\n", __FUNCTION__, TdStatus));
+    DEBUG ((DEBUG_ERROR, "%a: TdVmcall(MAPGPA) failed with %llx\n", __func__, TdStatus));
     ASSERT (FALSE);
     return EFI_DEVICE_ERROR;
   }
@@ -553,14 +553,14 @@ SetOrClearSharedBit (
   if (Mode == ClearSharedBit) {
     Status = gBS->LocateProtocol (&gEdkiiMemoryAcceptProtocolGuid, NULL, (VOID **)&MemoryAcceptProtocol);
     if (EFI_ERROR (Status)) {
-      DEBUG ((DEBUG_ERROR, "%a: Failed to locate MemoryAcceptProtocol with %r\n", __FUNCTION__, Status));
+      DEBUG ((DEBUG_ERROR, "%a: Failed to locate MemoryAcceptProtocol with %r\n", __func__, Status));
       ASSERT (FALSE);
       return Status;
     }
 
     Status = MemoryAcceptProtocol->AcceptMemory (MemoryAcceptProtocol, PhysicalAddress, Length);
     if (EFI_ERROR (Status)) {
-      DEBUG ((DEBUG_ERROR, "%a: Failed to AcceptMemory with %r\n", __FUNCTION__, Status));
+      DEBUG ((DEBUG_ERROR, "%a: Failed to AcceptMemory with %r\n", __func__, Status));
       ASSERT (FALSE);
       return Status;
     }
@@ -570,7 +570,7 @@ SetOrClearSharedBit (
     DEBUG_VERBOSE,
     "%a:%a: pte=0x%Lx AddressEncMask=0x%Lx Mode=0x%x MapGPA Status=0x%x\n",
     gEfiCallerBaseName,
-    __FUNCTION__,
+    __func__,
     *PageTablePointer,
     AddressEncMask,
     Mode,
@@ -677,7 +677,7 @@ SetMemorySharedOrPrivate (
     DEBUG_VERBOSE,
     "%a:%a: Cr3Base=0x%Lx Physical=0x%Lx Length=0x%Lx Mode=%a\n",
     gEfiCallerBaseName,
-    __FUNCTION__,
+    __func__,
     Cr3BaseAddress,
     PhysicalAddress,
     (UINT64)Length,
@@ -734,7 +734,7 @@ SetMemorySharedOrPrivate (
         DEBUG_ERROR,
         "%a:%a: bad PML4 for Physical=0x%Lx\n",
         gEfiCallerBaseName,
-        __FUNCTION__,
+        __func__,
         PhysicalAddress
         ));
       Status = RETURN_NO_MAPPING;
@@ -751,7 +751,7 @@ SetMemorySharedOrPrivate (
         DEBUG_ERROR,
         "%a:%a: bad PDPE for Physical=0x%Lx\n",
         gEfiCallerBaseName,
-        __FUNCTION__,
+        __func__,
         PhysicalAddress
         ));
       Status = RETURN_NO_MAPPING;
@@ -776,7 +776,7 @@ SetMemorySharedOrPrivate (
           DEBUG_VERBOSE,
           "%a:%a: updated 1GB entry for Physical=0x%Lx\n",
           gEfiCallerBaseName,
-          __FUNCTION__,
+          __func__,
           PhysicalAddress
           ));
         PhysicalAddress += BIT30;
@@ -789,7 +789,7 @@ SetMemorySharedOrPrivate (
           DEBUG_VERBOSE,
           "%a:%a: splitting 1GB page for Physical=0x%Lx\n",
           gEfiCallerBaseName,
-          __FUNCTION__,
+          __func__,
           PhysicalAddress
           ));
         Split1GPageTo2M (
@@ -817,7 +817,7 @@ SetMemorySharedOrPrivate (
           DEBUG_ERROR,
           "%a:%a: bad PDE for Physical=0x%Lx\n",
           gEfiCallerBaseName,
-          __FUNCTION__,
+          __func__,
           PhysicalAddress
           ));
         Status = RETURN_NO_MAPPING;
@@ -848,7 +848,7 @@ SetMemorySharedOrPrivate (
             DEBUG_VERBOSE,
             "%a:%a: splitting 2MB page for Physical=0x%Lx\n",
             gEfiCallerBaseName,
-            __FUNCTION__,
+            __func__,
             PhysicalAddress
             ));
 
@@ -877,7 +877,7 @@ SetMemorySharedOrPrivate (
             DEBUG_ERROR,
             "%a:%a: bad PTE for Physical=0x%Lx\n",
             gEfiCallerBaseName,
-            __FUNCTION__,
+            __func__,
             PhysicalAddress
             ));
           Status = RETURN_NO_MAPPING;
diff --git a/OvmfPkg/Library/BasePciCapLib/BasePciCapLib.c b/OvmfPkg/Library/BasePciCapLib/BasePciCapLib.c
index 4215e6cdaa2e..766a2ccb9c60 100644
--- a/OvmfPkg/Library/BasePciCapLib/BasePciCapLib.c
+++ b/OvmfPkg/Library/BasePciCapLib/BasePciCapLib.c
@@ -427,7 +427,7 @@ DebugDumpPciCapList (
       DEBUG_VERBOSE,
       "%a:%a: %a 0x%04x %03u/%03u v0x%x @0x%03x+0x%03x\n",
       gEfiCallerBaseName,
-      __FUNCTION__,
+      __func__,
       (Info.Domain == PciCapNormal ? "Norm" : "Extd"),
       Info.CapId,
       Info.Instance,
@@ -753,7 +753,7 @@ PciCapListInit (
     DEBUG_ERROR,
     "%a:%a: %r\n",
     gEfiCallerBaseName,
-    __FUNCTION__,
+    __func__,
     Status
     ));
   return Status;
diff --git a/OvmfPkg/Library/CcExitLib/CcExitVeHandler.c b/OvmfPkg/Library/CcExitLib/CcExitVeHandler.c
index 2c1de0039d36..9acc6fbe20fc 100644
--- a/OvmfPkg/Library/CcExitLib/CcExitVeHandler.c
+++ b/OvmfPkg/Library/CcExitLib/CcExitVeHandler.c
@@ -265,7 +265,7 @@ TdxMmioReadWrite (
   UINT64  TdStatus;
 
   if ((MmioSize != 1) && (MmioSize != 2) && (MmioSize != 4) && (MmioSize != 8)) {
-    DEBUG ((DEBUG_ERROR, "%a: Invalid MmioSize - %d\n", __FUNCTION__, MmioSize));
+    DEBUG ((DEBUG_ERROR, "%a: Invalid MmioSize - %d\n", __func__, MmioSize));
     return EFI_INVALID_PARAMETER;
   }
 
@@ -283,7 +283,7 @@ TdxMmioReadWrite (
   }
 
   if (TdStatus != 0) {
-    DEBUG ((DEBUG_ERROR, "%a: TdVmcall failed with %llx\n", __FUNCTION__, TdStatus));
+    DEBUG ((DEBUG_ERROR, "%a: TdVmcall failed with %llx\n", __func__, TdStatus));
     return EFI_ABORTED;
   }
 
@@ -334,7 +334,7 @@ ParseMmioExitInstructions (
 
   Status = CcInitInstructionData (InstructionData, NULL, Regs);
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "%a: Initialize InstructionData failed! (%r)\n", __FUNCTION__, Status));
+    DEBUG ((DEBUG_ERROR, "%a: Initialize InstructionData failed! (%r)\n", __func__, Status));
     return Status;
   }
 
@@ -361,7 +361,7 @@ ParseMmioExitInstructions (
                0);
 
       if (InstructionData->Ext.ModRm.Mod == 3) {
-        DEBUG ((DEBUG_ERROR, "%a: Parse Ext.ModRm.Mod error! (OpCode: 0x%x)\n", __FUNCTION__, OpCode));
+        DEBUG ((DEBUG_ERROR, "%a: Parse Ext.ModRm.Mod error! (OpCode: 0x%x)\n", __func__, OpCode));
         return EFI_UNSUPPORTED;
       }
 
@@ -440,7 +440,7 @@ ParseMmioExitInstructions (
         //
         // NPF on two register operands???
         //
-        DEBUG ((DEBUG_ERROR, "%a: Parse Ext.ModRm.Mod error! (OpCode: 0x%x)\n", __FUNCTION__, OpCode));
+        DEBUG ((DEBUG_ERROR, "%a: Parse Ext.ModRm.Mod error! (OpCode: 0x%x)\n", __func__, OpCode));
         return EFI_UNSUPPORTED;
       }
 
@@ -558,7 +558,7 @@ ParseMmioExitInstructions (
       break;
 
     default:
-      DEBUG ((DEBUG_ERROR, "%a: Invalid MMIO opcode (%x)\n", __FUNCTION__, OpCode));
+      DEBUG ((DEBUG_ERROR, "%a: Invalid MMIO opcode (%x)\n", __func__, OpCode));
       Status = EFI_UNSUPPORTED;
   }
 
@@ -606,12 +606,12 @@ MmioExit (
     Gpaw             = (UINT8)(TdReturnData.TdInfo.Gpaw & 0x3f);
     TdSharedPageMask = 1ULL << (Gpaw - 1);
   } else {
-    DEBUG ((DEBUG_ERROR, "%a: TDCALL failed with status=%llx\n", __FUNCTION__, TdStatus));
+    DEBUG ((DEBUG_ERROR, "%a: TDCALL failed with status=%llx\n", __func__, TdStatus));
     goto FatalError;
   }
 
   if ((Veinfo->GuestPA & TdSharedPageMask) == 0) {
-    DEBUG ((DEBUG_ERROR, "%a: EPT-violation #VE on private memory is not allowed!", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a: EPT-violation #VE on private memory is not allowed!", __func__));
     goto FatalError;
   }
 
@@ -624,7 +624,7 @@ MmioExit (
     DEBUG ((
       DEBUG_ERROR,
       "%a: Address is not correct! (%d: 0x%llx != 0x%llx)\n",
-      __FUNCTION__,
+      __func__,
       ParsedInstruction.OpCode,
       Veinfo->GuestPA,
       ParsedInstruction.Address
diff --git a/OvmfPkg/Library/GenericQemuLoadImageLib/GenericQemuLoadImageLib.c b/OvmfPkg/Library/GenericQemuLoadImageLib/GenericQemuLoadImageLib.c
index c751b106792f..b99fb350aa8f 100644
--- a/OvmfPkg/Library/GenericQemuLoadImageLib/GenericQemuLoadImageLib.c
+++ b/OvmfPkg/Library/GenericQemuLoadImageLib/GenericQemuLoadImageLib.c
@@ -201,7 +201,7 @@ QemuLoadKernelImage (
       DEBUG ((
         Status == EFI_NOT_FOUND ? DEBUG_INFO : DEBUG_ERROR,
         "%a: LoadImage(): %r\n",
-        __FUNCTION__,
+        __func__,
         Status
         ));
       return Status;
@@ -279,7 +279,7 @@ QemuLoadKernelImage (
       DEBUG ((
         DEBUG_ERROR,
         "%a: kernel command line is not NUL-terminated\n",
-        __FUNCTION__
+        __func__
         ));
       Status = EFI_PROTOCOL_ERROR;
       goto FreeCommandLine;
@@ -330,7 +330,7 @@ QemuLoadKernelImage (
     DEBUG ((
       DEBUG_INFO,
       "%a: command line: \"%s\"\n",
-      __FUNCTION__,
+      __func__,
       (CHAR16 *)KernelLoadedImage->LoadOptions
       ));
   }
diff --git a/OvmfPkg/Library/HardwareInfoLib/HardwareInfoDxe.c b/OvmfPkg/Library/HardwareInfoLib/HardwareInfoDxe.c
index a74de5287153..5a1a69dcc370 100644
--- a/OvmfPkg/Library/HardwareInfoLib/HardwareInfoDxe.c
+++ b/OvmfPkg/Library/HardwareInfoLib/HardwareInfoDxe.c
@@ -91,7 +91,7 @@ CreateHardwareInfoList (
   DEBUG ((
     EFI_D_ERROR,
     "%a: Failed to allocate memory for hardware info\n",
-    __FUNCTION__
+    __func__
     ));
 
   return EFI_OUT_OF_RESOURCES;
diff --git a/OvmfPkg/Library/LockBoxLib/LockBoxLib.c b/OvmfPkg/Library/LockBoxLib/LockBoxLib.c
index 2000afeeb85e..a8af4ea8d009 100644
--- a/OvmfPkg/Library/LockBoxLib/LockBoxLib.c
+++ b/OvmfPkg/Library/LockBoxLib/LockBoxLib.c
@@ -125,7 +125,7 @@ SaveLockBox (
   DEBUG ((
     DEBUG_VERBOSE,
     "%a: Guid=%g Buffer=%p Length=0x%x\n",
-    __FUNCTION__,
+    __func__,
     Guid,
     Buffer,
     (UINT32)Length
@@ -196,7 +196,7 @@ SetLockBoxAttributes (
   DEBUG ((
     DEBUG_VERBOSE,
     "%a: Guid=%g Attributes=0x%Lx\n",
-    __FUNCTION__,
+    __func__,
     Guid,
     Attributes
     ));
@@ -253,7 +253,7 @@ UpdateLockBox (
   DEBUG ((
     DEBUG_VERBOSE,
     "%a: Guid=%g Offset=0x%x Length=0x%x\n",
-    __FUNCTION__,
+    __func__,
     Guid,
     (UINT32)Offset,
     (UINT32)Length
@@ -315,7 +315,7 @@ RestoreLockBox (
   DEBUG ((
     DEBUG_VERBOSE,
     "%a: Guid=%g Buffer=%p\n",
-    __FUNCTION__,
+    __func__,
     Guid,
     Buffer
     ));
@@ -397,7 +397,7 @@ RestoreAllLockBoxInPlace (
       DEBUG ((
         DEBUG_VERBOSE,
         "%a: Guid=%g Buffer=%p\n",
-        __FUNCTION__,
+        __func__,
         &Header->Guid,
         Buffer
         ));
diff --git a/OvmfPkg/Library/PciHostBridgeUtilityLib/PciHostBridgeUtilityLib.c b/OvmfPkg/Library/PciHostBridgeUtilityLib/PciHostBridgeUtilityLib.c
index cad2bd6c9687..0424aa5df124 100644
--- a/OvmfPkg/Library/PciHostBridgeUtilityLib/PciHostBridgeUtilityLib.c
+++ b/OvmfPkg/Library/PciHostBridgeUtilityLib/PciHostBridgeUtilityLib.c
@@ -156,7 +156,7 @@ PciHostBridgeUtilityInitRootBridge (
                  &mRootBridgeDevicePathTemplate
                  );
   if (DevicePath == NULL) {
-    DEBUG ((DEBUG_ERROR, "%a: %r\n", __FUNCTION__, EFI_OUT_OF_RESOURCES));
+    DEBUG ((DEBUG_ERROR, "%a: %r\n", __func__, EFI_OUT_OF_RESOURCES));
     return EFI_OUT_OF_RESOURCES;
   }
 
@@ -166,7 +166,7 @@ PciHostBridgeUtilityInitRootBridge (
   DEBUG ((
     DEBUG_INFO,
     "%a: populated root bus %d, with room for %d subordinate bus(es)\n",
-    __FUNCTION__,
+    __func__,
     RootBusNumber,
     MaxSubBusNumber - RootBusNumber
     ));
@@ -253,7 +253,7 @@ PciHostBridgeUtilityGetRootBridgesBusScan (
       DEBUG_ERROR,
       "%a: invalid bus range with BusMin %Lu and BusMax "
       "%Lu\n",
-      __FUNCTION__,
+      __func__,
       (UINT64)BusMin,
       (UINT64)BusMax
       ));
@@ -283,7 +283,7 @@ PciHostBridgeUtilityGetRootBridgesBusScan (
         DEBUG_ERROR,
         "%a: invalid count of extra root buses (%Lu) "
         "reported by QEMU\n",
-        __FUNCTION__,
+        __func__,
         ExtraRootBridges
         ));
       return NULL;
@@ -292,7 +292,7 @@ PciHostBridgeUtilityGetRootBridgesBusScan (
     DEBUG ((
       DEBUG_INFO,
       "%a: %Lu extra root buses reported by QEMU\n",
-      __FUNCTION__,
+      __func__,
       ExtraRootBridges
       ));
   }
@@ -302,7 +302,7 @@ PciHostBridgeUtilityGetRootBridgesBusScan (
   //
   Bridges = AllocatePool ((1 + (UINTN)ExtraRootBridges) * sizeof *Bridges);
   if (Bridges == NULL) {
-    DEBUG ((DEBUG_ERROR, "%a: %r\n", __FUNCTION__, EFI_OUT_OF_RESOURCES));
+    DEBUG ((DEBUG_ERROR, "%a: %r\n", __func__, EFI_OUT_OF_RESOURCES));
     return NULL;
   }
 
@@ -471,7 +471,7 @@ PciHostBridgeUtilityGetRootBridgesHostProvided (
     DEBUG ((
       DEBUG_ERROR,
       "%a: Failed to allocate memory for hardware resources info\n",
-      __FUNCTION__
+      __func__
       ));
     return NULL;
   }
@@ -495,7 +495,7 @@ PciHostBridgeUtilityGetRootBridgesHostProvided (
       DEBUG_ERROR,
       "%a: Failed to create hardware info list to retrieve host "
       "bridges information from fw-cfg\n",
-      __FUNCTION__
+      __func__
       ));
 
     goto FreeBridges;
@@ -514,7 +514,7 @@ PciHostBridgeUtilityGetRootBridgesHostProvided (
   DEBUG ((
     DEBUG_INFO,
     "%a: Host provided description for %Lu root bridges\n",
-    __FUNCTION__,
+    __func__,
     PciHostBridgeCount
     ));
 
@@ -523,7 +523,7 @@ PciHostBridgeUtilityGetRootBridgesHostProvided (
   //
   Bridges = AllocatePool (((UINTN)PciHostBridgeCount) * sizeof *Bridges);
   if (Bridges == NULL) {
-    DEBUG ((DEBUG_ERROR, "%a: %r\n", __FUNCTION__, EFI_OUT_OF_RESOURCES));
+    DEBUG ((DEBUG_ERROR, "%a: %r\n", __func__, EFI_OUT_OF_RESOURCES));
     goto FreeBridges;
   }
 
@@ -567,7 +567,7 @@ PciHostBridgeUtilityGetRootBridgesHostProvided (
         DEBUG_ERROR,
         "%a: invalid bus range with BusMin %Lu and BusMax "
         "%Lu\n",
-        __FUNCTION__,
+        __func__,
         (UINT64)RootBridgeNumber,
         (UINT64)LastRootBridgeNumber
         ));
diff --git a/OvmfPkg/Library/PeilessStartupLib/X64/VirtualMemory.c b/OvmfPkg/Library/PeilessStartupLib/X64/VirtualMemory.c
index b444c052d1bf..e2c1bac5e059 100644
--- a/OvmfPkg/Library/PeilessStartupLib/X64/VirtualMemory.c
+++ b/OvmfPkg/Library/PeilessStartupLib/X64/VirtualMemory.c
@@ -371,7 +371,7 @@ AllocatePageTableMemory (
     DEBUG_INFO,
     "%a:%a: Buffer=0x%Lx Pages=%ld, PageTablePool=%p\n",
     gEfiCallerBaseName,
-    __FUNCTION__,
+    __func__,
     Buffer,
     Pages,
     *PageTablePool
diff --git a/OvmfPkg/Library/PlatformBmPrintScLib/StatusCodeHandler.c b/OvmfPkg/Library/PlatformBmPrintScLib/StatusCodeHandler.c
index 065673d90494..18091640d12d 100644
--- a/OvmfPkg/Library/PlatformBmPrintScLib/StatusCodeHandler.c
+++ b/OvmfPkg/Library/PlatformBmPrintScLib/StatusCodeHandler.c
@@ -122,7 +122,7 @@ HandleStatusCode (
       DEBUG_ERROR,
       "%a:%a: malformed Data\n",
       gEfiCallerBaseName,
-      __FUNCTION__
+      __func__
       ));
     return EFI_INVALID_PARAMETER;
   }
@@ -143,7 +143,7 @@ HandleStatusCode (
       DEBUG_ERROR,
       "%a:%a: failed to get %g:\"%s\": %r\n",
       gEfiCallerBaseName,
-      __FUNCTION__,
+      __func__,
       &gEfiGlobalVariableGuid,
       EFI_BOOT_CURRENT_VARIABLE_NAME,
       Status
@@ -156,7 +156,7 @@ HandleStatusCode (
       DEBUG_ERROR,
       "%a:%a: got %Lu bytes for %g:\"%s\", expected %Lu\n",
       gEfiCallerBaseName,
-      __FUNCTION__,
+      __func__,
       (UINT64)VariableSize,
       &gEfiGlobalVariableGuid,
       EFI_BOOT_CURRENT_VARIABLE_NAME,
@@ -180,7 +180,7 @@ HandleStatusCode (
       DEBUG_ERROR,
       "%a:%a: EfiBootManagerVariableToLoadOption(\"%s\"): %r\n",
       gEfiCallerBaseName,
-      __FUNCTION__,
+      __func__,
       BootOptionName,
       Status
       ));
@@ -309,7 +309,7 @@ PlatformBmPrintScRegisterHandler (
       DEBUG_ERROR,
       "%a:%a: failed to register status code handler: %r\n",
       gEfiCallerBaseName,
-      __FUNCTION__,
+      __func__,
       Status
       ));
     return Status;
@@ -337,7 +337,7 @@ PlatformBmPrintScRegisterHandler (
       "%a:%a: failed to create ExitBootServices() event: "
       "%r\n",
       gEfiCallerBaseName,
-      __FUNCTION__,
+      __func__,
       Status
       ));
     StatusCodeRouter->Unregister (HandleStatusCode);
diff --git a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c
index 98f6f07341ec..a90076c9e672 100644
--- a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c
+++ b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c
@@ -275,7 +275,7 @@ RemoveStaleFvFileOptions (
     DEBUG ((
       EFI_ERROR (Status) ? DEBUG_WARN : DEBUG_VERBOSE,
       "%a: removing stale Boot#%04x %s: %r\n",
-      __FUNCTION__,
+      __func__,
       (UINT32)BootOptions[Index].OptionNumber,
       DevicePathString == NULL ? L"<unavailable>" : DevicePathString,
       Status
@@ -479,7 +479,7 @@ PlatformBootManagerBeforeConsole (
   DEBUG ((
     EFI_ERROR (Status) ? DEBUG_ERROR : DEBUG_VERBOSE,
     "%a: SetVariable(%s, %u): %r\n",
-    __FUNCTION__,
+    __func__,
     EFI_TIME_OUT_VARIABLE_NAME,
     FrontPageTimeout,
     Status
@@ -632,7 +632,7 @@ ConnectVirtioPciRng (
   return EFI_SUCCESS;
 
 Error:
-  DEBUG ((DEBUG_ERROR, "%a: %r\n", __FUNCTION__, Status));
+  DEBUG ((DEBUG_ERROR, "%a: %r\n", __func__, Status));
   return Status;
 }
 
@@ -1283,7 +1283,7 @@ SetPciIntLine (
       DEBUG ((
         DEBUG_ERROR,
         "%a: PCI host bridge (00:00.0) should have no interrupts!\n",
-        __FUNCTION__
+        __func__
         ));
       ASSERT (FALSE);
     }
@@ -1338,7 +1338,7 @@ SetPciIntLine (
       DEBUG ((
         DEBUG_VERBOSE,
         "%a: [%02x:%02x.%x] %s -> 0x%02x\n",
-        __FUNCTION__,
+        __func__,
         (UINT32)Bus,
         (UINT32)Device,
         (UINT32)Function,
@@ -1416,7 +1416,7 @@ PciAcpiInitialization (
       DEBUG ((
         DEBUG_ERROR,
         "%a: Unknown Host Bridge Device ID: 0x%04x\n",
-        __FUNCTION__,
+        __func__,
         mHostBridgeDevId
         ));
       ASSERT (FALSE);
diff --git a/OvmfPkg/Library/PlatformBootManagerLib/QemuKernel.c b/OvmfPkg/Library/PlatformBootManagerLib/QemuKernel.c
index 1e66e3c45258..84b25db52159 100644
--- a/OvmfPkg/Library/PlatformBootManagerLib/QemuKernel.c
+++ b/OvmfPkg/Library/PlatformBootManagerLib/QemuKernel.c
@@ -44,7 +44,7 @@ TryRunningQemuKernel (
     DEBUG ((
       DEBUG_ERROR,
       "%a: QemuStartKernelImage(): %r\n",
-      __FUNCTION__,
+      __func__,
       Status
       ));
   }
diff --git a/OvmfPkg/Library/PlatformBootManagerLibBhyve/BdsPlatform.c b/OvmfPkg/Library/PlatformBootManagerLibBhyve/BdsPlatform.c
index bf2701965ff2..ac9c02cb1c59 100644
--- a/OvmfPkg/Library/PlatformBootManagerLibBhyve/BdsPlatform.c
+++ b/OvmfPkg/Library/PlatformBootManagerLibBhyve/BdsPlatform.c
@@ -273,7 +273,7 @@ RemoveStaleFvFileOptions (
     DEBUG ((
       EFI_ERROR (Status) ? DEBUG_WARN : DEBUG_VERBOSE,
       "%a: removing stale Boot#%04x %s: %r\n",
-      __FUNCTION__,
+      __func__,
       (UINT32)BootOptions[Index].OptionNumber,
       DevicePathString == NULL ? L"<unavailable>" : DevicePathString,
       Status
@@ -586,7 +586,7 @@ ConnectVirtioPciRng (
   return EFI_SUCCESS;
 
 Error:
-  DEBUG ((DEBUG_ERROR, "%a: %r\n", __FUNCTION__, Status));
+  DEBUG ((DEBUG_ERROR, "%a: %r\n", __func__, Status));
   return Status;
 }
 
@@ -1156,7 +1156,7 @@ SetPciIntLine (
       DEBUG ((
         DEBUG_ERROR,
         "%a: PCI host bridge (00:00.0) should have no interrupts!\n",
-        __FUNCTION__
+        __func__
         ));
       ASSERT (FALSE);
     }
@@ -1213,7 +1213,7 @@ SetPciIntLine (
       DEBUG ((
         DEBUG_VERBOSE,
         "%a: [%02x:%02x.%x] %s -> 0x%02x\n",
-        __FUNCTION__,
+        __func__,
         (UINT32)Bus,
         (UINT32)Device,
         (UINT32)Function,
@@ -1283,7 +1283,7 @@ PciAcpiInitialization (
       DEBUG ((
         DEBUG_ERROR,
         "%a: Unknown Host Bridge Device ID: 0x%04x\n",
-        __FUNCTION__,
+        __func__,
         mHostBridgeDevId
         ));
       ASSERT (FALSE);
diff --git a/OvmfPkg/Library/PlatformBootManagerLibGrub/BdsPlatform.c b/OvmfPkg/Library/PlatformBootManagerLibGrub/BdsPlatform.c
index a402589206bb..df8e2fe15786 100644
--- a/OvmfPkg/Library/PlatformBootManagerLibGrub/BdsPlatform.c
+++ b/OvmfPkg/Library/PlatformBootManagerLibGrub/BdsPlatform.c
@@ -280,7 +280,7 @@ RemoveStaleFvFileOptions (
     DEBUG ((
       EFI_ERROR (Status) ? DEBUG_WARN : DEBUG_VERBOSE,
       "%a: removing stale Boot#%04x %s: %r\n",
-      __FUNCTION__,
+      __func__,
       (UINT32)BootOptions[Index].OptionNumber,
       DevicePathString == NULL ? L"<unavailable>" : DevicePathString,
       Status
@@ -551,7 +551,7 @@ ConnectVirtioPciRng (
   return EFI_SUCCESS;
 
 Error:
-  DEBUG ((DEBUG_ERROR, "%a: %r\n", __FUNCTION__, Status));
+  DEBUG ((DEBUG_ERROR, "%a: %r\n", __func__, Status));
   return Status;
 }
 
@@ -1157,7 +1157,7 @@ SetPciIntLine (
       DEBUG ((
         DEBUG_ERROR,
         "%a: PCI host bridge (00:00.0) should have no interrupts!\n",
-        __FUNCTION__
+        __func__
         ));
       ASSERT (FALSE);
     }
@@ -1212,7 +1212,7 @@ SetPciIntLine (
       DEBUG ((
         DEBUG_VERBOSE,
         "%a: [%02x:%02x.%x] %s -> 0x%02x\n",
-        __FUNCTION__,
+        __func__,
         (UINT32)Bus,
         (UINT32)Device,
         (UINT32)Function,
@@ -1280,7 +1280,7 @@ PciAcpiInitialization (
       DEBUG ((
         DEBUG_ERROR,
         "%a: Unknown Host Bridge Device ID: 0x%04x\n",
-        __FUNCTION__,
+        __func__,
         mHostBridgeDevId
         ));
       ASSERT (FALSE);
diff --git a/OvmfPkg/Library/PlatformBootManagerLibGrub/QemuKernel.c b/OvmfPkg/Library/PlatformBootManagerLibGrub/QemuKernel.c
index 1e66e3c45258..84b25db52159 100644
--- a/OvmfPkg/Library/PlatformBootManagerLibGrub/QemuKernel.c
+++ b/OvmfPkg/Library/PlatformBootManagerLibGrub/QemuKernel.c
@@ -44,7 +44,7 @@ TryRunningQemuKernel (
     DEBUG ((
       DEBUG_ERROR,
       "%a: QemuStartKernelImage(): %r\n",
-      __FUNCTION__,
+      __func__,
       Status
       ));
   }
diff --git a/OvmfPkg/Library/PlatformInitLib/MemDetect.c b/OvmfPkg/Library/PlatformInitLib/MemDetect.c
index aced8535e6d1..acf90b4e93fd 100644
--- a/OvmfPkg/Library/PlatformInitLib/MemDetect.c
+++ b/OvmfPkg/Library/PlatformInitLib/MemDetect.c
@@ -91,7 +91,7 @@ PlatformQemuUc32BaseInitialization (
       DEBUG_VERBOSE,
       "%a: rounded UC32 base from 0x%x up to 0x%x, for "
       "an UC32 size of 0x%x\n",
-      __FUNCTION__,
+      __func__,
       PlatformInfoHob->LowMemory,
       PlatformInfoHob->Uc32Base,
       PlatformInfoHob->Uc32Size
@@ -123,7 +123,7 @@ PlatformGetFirstNonAddressCB (
 
   Candidate = E820Entry->BaseAddr + E820Entry->Length;
   if (PlatformInfoHob->FirstNonAddress < Candidate) {
-    DEBUG ((DEBUG_INFO, "%a: FirstNonAddress=0x%Lx\n", __FUNCTION__, Candidate));
+    DEBUG ((DEBUG_INFO, "%a: FirstNonAddress=0x%Lx\n", __func__, Candidate));
     PlatformInfoHob->FirstNonAddress = Candidate;
   }
 }
@@ -151,7 +151,7 @@ PlatformGetLowMemoryCB (
   }
 
   if (PlatformInfoHob->LowMemory < Candidate) {
-    DEBUG ((DEBUG_INFO, "%a: LowMemory=0x%Lx\n", __FUNCTION__, Candidate));
+    DEBUG ((DEBUG_INFO, "%a: LowMemory=0x%Lx\n", __func__, Candidate));
     PlatformInfoHob->LowMemory = (UINT32)Candidate;
   }
 }
@@ -180,7 +180,7 @@ PlatformAddHobCB (
         Base = ALIGN_VALUE (Base, (UINT64)EFI_PAGE_SIZE);
         End  = End & ~(UINT64)EFI_PAGE_MASK;
         if (Base < End) {
-          DEBUG ((DEBUG_INFO, "%a: HighMemory [0x%Lx, 0x%Lx)\n", __FUNCTION__, Base, End));
+          DEBUG ((DEBUG_INFO, "%a: HighMemory [0x%Lx, 0x%Lx)\n", __func__, Base, End));
           PlatformAddMemoryRangeHob (Base, End);
         }
       }
@@ -188,13 +188,13 @@ PlatformAddHobCB (
       break;
     case EfiAcpiAddressRangeReserved:
       BuildResourceDescriptorHob (EFI_RESOURCE_MEMORY_RESERVED, 0, Base, End - Base);
-      DEBUG ((DEBUG_INFO, "%a: Reserved [0x%Lx, 0x%Lx)\n", __FUNCTION__, Base, End));
+      DEBUG ((DEBUG_INFO, "%a: Reserved [0x%Lx, 0x%Lx)\n", __func__, Base, End));
       break;
     default:
       DEBUG ((
         DEBUG_WARN,
         "%a: Type %u [0x%Lx, 0x%Lx) (NOT HANDLED)\n",
-        __FUNCTION__,
+        __func__,
         E820Entry->Type,
         Base,
         End
@@ -241,7 +241,7 @@ PlatformReservationConflictCB (
   DEBUG ((
     DEBUG_INFO,
     "%a: move mmio: 0x%Lx => %Lx\n",
-    __FUNCTION__,
+    __func__,
     PlatformInfoHob->PcdPciMmio64Base,
     NewBase
     ));
@@ -495,7 +495,7 @@ PlatformGetFirstNonAddress (
       DEBUG ((
         DEBUG_WARN,
         "%a: ignoring malformed 64-bit PCI host aperture size from fw_cfg\n",
-        __FUNCTION__
+        __func__
         ));
       break;
   }
@@ -505,7 +505,7 @@ PlatformGetFirstNonAddress (
       DEBUG ((
         DEBUG_INFO,
         "%a: disabling 64-bit PCI host aperture\n",
-        __FUNCTION__
+        __func__
         ));
     }
 
@@ -534,7 +534,7 @@ PlatformGetFirstNonAddress (
     DEBUG ((
       DEBUG_VERBOSE,
       "%a: HotPlugMemoryEnd=0x%Lx\n",
-      __FUNCTION__,
+      __func__,
       HotPlugMemoryEnd
       ));
 
@@ -638,7 +638,7 @@ PlatformAddressWidthFromCpuid (
   DEBUG ((
     DEBUG_INFO,
     "%a: Signature: '%a', PhysBits: %d, QemuQuirk: %a, Valid: %a\n",
-    __FUNCTION__,
+    __func__,
     Signature,
     PhysBits,
     QemuQuirk ? "On" : "Off",
@@ -783,7 +783,7 @@ PlatformScanHostProvided64BitPciMmioEnd (
       DEBUG ((
         DEBUG_ERROR,
         "%a: ignoring malformed hardware information from fw_cfg\n",
-        __FUNCTION__
+        __func__
         ));
       *PciMmioAddressEnd = 0;
       return Status;
@@ -806,7 +806,7 @@ PlatformScanHostProvided64BitPciMmioEnd (
     DEBUG ((
       DEBUG_INFO,
       "%a: Pci64End=0x%Lx\n",
-      __FUNCTION__,
+      __func__,
       *PciMmioAddressEnd
       ));
 
@@ -942,7 +942,7 @@ PlatformQemuInitializeRam (
   MTRR_SETTINGS  MtrrSettings;
   EFI_STATUS     Status;
 
-  DEBUG ((DEBUG_INFO, "%a called\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a called\n", __func__));
 
   //
   // Determine total memory size available
diff --git a/OvmfPkg/Library/PlatformInitLib/Platform.c b/OvmfPkg/Library/PlatformInitLib/Platform.c
index 5cf8af825a2f..f48bf16ae300 100644
--- a/OvmfPkg/Library/PlatformInitLib/Platform.c
+++ b/OvmfPkg/Library/PlatformInitLib/Platform.c
@@ -358,7 +358,7 @@ PlatformMiscInitialization (
       DEBUG ((
         DEBUG_ERROR,
         "%a: Unknown Host Bridge Device ID: 0x%04x\n",
-        __FUNCTION__,
+        __func__,
         PlatformInfoHob->HostBridgeDevId
         ));
       ASSERT (FALSE);
@@ -366,7 +366,7 @@ PlatformMiscInitialization (
   }
 
   if (PlatformInfoHob->HostBridgeDevId == CLOUDHV_DEVICE_ID) {
-    DEBUG ((DEBUG_INFO, "%a: Cloud Hypervisor is done.\n", __FUNCTION__));
+    DEBUG ((DEBUG_INFO, "%a: Cloud Hypervisor is done.\n", __func__));
     return;
   }
 
@@ -489,12 +489,12 @@ PlatformCpuCountBugCheck (
     DEBUG ((
       DEBUG_ERROR,
       "%a: Present=%u Possible=%u\n",
-      __FUNCTION__,
+      __func__,
       *Present,
       *Possible
       ));
     for (Idx = 0; Idx < ARRAY_SIZE (Message); ++Idx) {
-      DEBUG ((DEBUG_ERROR, "%a: %a\n", __FUNCTION__, Message[Idx]));
+      DEBUG ((DEBUG_ERROR, "%a: %a\n", __func__, Message[Idx]));
     }
 
     ParseStatus = QemuFwCfgParseBool (
@@ -505,7 +505,7 @@ PlatformCpuCountBugCheck (
       DEBUG ((
         DEBUG_WARN,
         "%a: \"%a\" active. You've been warned.\n",
-        __FUNCTION__,
+        __func__,
         CPUHP_BUGCHECK_OVERRIDE_FWCFG_FILE
         ));
       //
@@ -531,7 +531,7 @@ PlatformCpuCountBugCheck (
     DEBUG ((
       DEBUG_WARN,
       "%a: QEMU v2.7 reset bug: BootCpuCount=%d Present=%u\n",
-      __FUNCTION__,
+      __func__,
       *BootCpuCount,
       *Present
       ));
@@ -573,7 +573,7 @@ PlatformMaxCpuCountInitialization (
     // until PcdCpuApInitTimeOutInMicroSeconds elapses (whichever is reached
     // first).
     //
-    DEBUG ((DEBUG_WARN, "%a: boot CPU count unavailable\n", __FUNCTION__));
+    DEBUG ((DEBUG_WARN, "%a: boot CPU count unavailable\n", __func__));
     MaxCpuCount = PlatformInfoHob->DefaultMaxCpuNumber;
   } else {
     //
@@ -626,7 +626,7 @@ PlatformMaxCpuCountInitialization (
     //    steps. Both cases confirm modern mode.
     //
     CmdData2 = IoRead32 (CpuHpBase + QEMU_CPUHP_R_CMD_DATA2);
-    DEBUG ((DEBUG_VERBOSE, "%a: CmdData2=0x%x\n", __FUNCTION__, CmdData2));
+    DEBUG ((DEBUG_VERBOSE, "%a: CmdData2=0x%x\n", __func__, CmdData2));
     if (CmdData2 != 0) {
       //
       // QEMU doesn't support the modern CPU hotplug interface. Assume that the
@@ -635,7 +635,7 @@ PlatformMaxCpuCountInitialization (
       DEBUG ((
         DEBUG_WARN,
         "%a: modern CPU hotplug interface unavailable\n",
-        __FUNCTION__
+        __func__
         ));
       MaxCpuCount = BootCpuCount;
     } else {
@@ -693,7 +693,7 @@ PlatformMaxCpuCountInitialization (
   DEBUG ((
     DEBUG_INFO,
     "%a: BootCpuCount=%d MaxCpuCount=%u\n",
-    __FUNCTION__,
+    __func__,
     BootCpuCount,
     MaxCpuCount
     ));
diff --git a/OvmfPkg/Library/QemuBootOrderLib/ExtraRootBusMap.c b/OvmfPkg/Library/QemuBootOrderLib/ExtraRootBusMap.c
index 37d488e01c2a..c32c3eddd532 100644
--- a/OvmfPkg/Library/QemuBootOrderLib/ExtraRootBusMap.c
+++ b/OvmfPkg/Library/QemuBootOrderLib/ExtraRootBusMap.c
@@ -227,7 +227,7 @@ CreateExtraRootBusMap (
     DEBUG ((
       DEBUG_VERBOSE,
       "%a: extra bus position 0x%Lx maps to bus number (UID) 0x%x\n",
-      __FUNCTION__,
+      __func__,
       (UINT64)(Idx + 1),
       Acpi->UID
       ));
diff --git a/OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.c b/OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.c
index cea4b7a099e3..2fe6ab30c032 100644
--- a/OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.c
+++ b/OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.c
@@ -543,7 +543,7 @@ ParseOfwNode (
   DEBUG ((
     DEBUG_VERBOSE,
     "%a: DriverName=\"%.*a\" UnitAddress=\"%.*a\" DeviceArguments=\"%.*a\"\n",
-    __FUNCTION__,
+    __func__,
     OfwNode->DriverName.Len,
     OfwNode->DriverName.Ptr,
     OfwNode->UnitAddress.Len,
@@ -1477,7 +1477,7 @@ TranslateOfwPath (
   }
 
   if (Status == RETURN_NOT_FOUND) {
-    DEBUG ((DEBUG_VERBOSE, "%a: no more nodes\n", __FUNCTION__));
+    DEBUG ((DEBUG_VERBOSE, "%a: no more nodes\n", __func__));
     return RETURN_NOT_FOUND;
   }
 
@@ -1496,7 +1496,7 @@ TranslateOfwPath (
       break;
 
     case RETURN_INVALID_PARAMETER:
-      DEBUG ((DEBUG_VERBOSE, "%a: parse error\n", __FUNCTION__));
+      DEBUG ((DEBUG_VERBOSE, "%a: parse error\n", __func__));
       return RETURN_INVALID_PARAMETER;
 
     default:
@@ -1512,22 +1512,22 @@ TranslateOfwPath (
              );
   switch (Status) {
     case RETURN_SUCCESS:
-      DEBUG ((DEBUG_VERBOSE, "%a: success: \"%s\"\n", __FUNCTION__, Translated));
+      DEBUG ((DEBUG_VERBOSE, "%a: success: \"%s\"\n", __func__, Translated));
       break;
 
     case RETURN_BUFFER_TOO_SMALL:
-      DEBUG ((DEBUG_VERBOSE, "%a: buffer too small\n", __FUNCTION__));
+      DEBUG ((DEBUG_VERBOSE, "%a: buffer too small\n", __func__));
       break;
 
     case RETURN_UNSUPPORTED:
-      DEBUG ((DEBUG_VERBOSE, "%a: unsupported\n", __FUNCTION__));
+      DEBUG ((DEBUG_VERBOSE, "%a: unsupported\n", __func__));
       break;
 
     case RETURN_PROTOCOL_ERROR:
       DEBUG ((
         DEBUG_VERBOSE,
         "%a: logic error / system state mismatch\n",
-        __FUNCTION__
+        __func__
         ));
       break;
 
@@ -1604,9 +1604,9 @@ ConnectDevicesFromQemu (
     goto FreeFwCfg;
   }
 
-  DEBUG ((DEBUG_VERBOSE, "%a: FwCfg:\n", __FUNCTION__));
+  DEBUG ((DEBUG_VERBOSE, "%a: FwCfg:\n", __func__));
   DEBUG ((DEBUG_VERBOSE, "%a\n", FwCfg));
-  DEBUG ((DEBUG_VERBOSE, "%a: FwCfg: <end>\n", __FUNCTION__));
+  DEBUG ((DEBUG_VERBOSE, "%a: FwCfg: <end>\n", __func__));
 
   if (FeaturePcdGet (PcdQemuBootOrderPciTranslation)) {
     EfiStatus = CreateExtraRootBusMap (&ExtraPciRoots);
@@ -1686,7 +1686,7 @@ ConnectDevicesFromQemu (
     DEBUG ((
       DEBUG_INFO,
       "%a: %Lu OpenFirmware device path(s) connected\n",
-      __FUNCTION__,
+      __func__,
       (UINT64)NumConnected
       ));
     Status = RETURN_SUCCESS;
@@ -1750,9 +1750,9 @@ StoreQemuBootOrder (
     goto FreeFwCfg;
   }
 
-  DEBUG ((DEBUG_VERBOSE, "%a: FwCfg:\n", __FUNCTION__));
+  DEBUG ((DEBUG_VERBOSE, "%a: FwCfg:\n", __func__));
   DEBUG ((DEBUG_VERBOSE, "%a\n", FwCfg));
-  DEBUG ((DEBUG_VERBOSE, "%a: FwCfg: <end>\n", __FUNCTION__));
+  DEBUG ((DEBUG_VERBOSE, "%a: FwCfg: <end>\n", __func__));
 
   if (FeaturePcdGet (PcdQemuBootOrderPciTranslation)) {
     EfiStatus = CreateExtraRootBusMap (&ExtraPciRoots);
@@ -1797,7 +1797,7 @@ StoreQemuBootOrder (
         L"VMMBootOrder%04x",
         VariableIndex++
         );
-      DEBUG ((DEBUG_INFO, "%a: %s = %s\n", __FUNCTION__, VariableName, Translated));
+      DEBUG ((DEBUG_INFO, "%a: %s = %s\n", __func__, VariableName, Translated));
       gRT->SetVariable (
              VariableName,
              &gVMMBootOrderGuid,
@@ -1944,7 +1944,7 @@ Match (
     DEBUG ((
       DEBUG_VERBOSE,
       "%a: expanded relative device path \"%s\" for prefix matching\n",
-      __FUNCTION__,
+      __func__,
       Converted
       ));
     FreePool (Converted);
@@ -1958,7 +1958,7 @@ Match (
   DEBUG ((
     DEBUG_VERBOSE,
     "%a: against \"%s\": %a\n",
-    __FUNCTION__,
+    __func__,
     Converted,
     Result ? "match" : "no match"
     ));
@@ -2068,7 +2068,7 @@ BootOrderComplete (
             DEBUG ((
               DEBUG_VERBOSE,
               "%a: keeping \"%s\"\n",
-              __FUNCTION__,
+              __func__,
               Converted
               ));
           }
@@ -2076,7 +2076,7 @@ BootOrderComplete (
           DEBUG ((
             DEBUG_VERBOSE,
             "%a: dropping \"%s\"\n",
-            __FUNCTION__,
+            __func__,
             Converted
             ));
         }
@@ -2211,9 +2211,9 @@ SetBootOrderFromQemu (
     goto ErrorFreeFwCfg;
   }
 
-  DEBUG ((DEBUG_VERBOSE, "%a: FwCfg:\n", __FUNCTION__));
+  DEBUG ((DEBUG_VERBOSE, "%a: FwCfg:\n", __func__));
   DEBUG ((DEBUG_VERBOSE, "%a\n", FwCfg));
-  DEBUG ((DEBUG_VERBOSE, "%a: FwCfg: <end>\n", __FUNCTION__));
+  DEBUG ((DEBUG_VERBOSE, "%a: FwCfg: <end>\n", __func__));
   FwCfgPtr = FwCfg;
 
   BootOrder.Produced  = 0;
@@ -2332,13 +2332,13 @@ SetBootOrderFromQemu (
       DEBUG ((
         DEBUG_ERROR,
         "%a: setting BootOrder: %r\n",
-        __FUNCTION__,
+        __func__,
         Status
         ));
       goto ErrorFreeExtraPciRoots;
     }
 
-    DEBUG ((DEBUG_INFO, "%a: setting BootOrder: success\n", __FUNCTION__));
+    DEBUG ((DEBUG_INFO, "%a: setting BootOrder: success\n", __func__));
     PruneBootVariables (ActiveOption, ActiveCount);
   }
 
diff --git a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgDxe.c b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgDxe.c
index 6a810928a060..4250e633b57f 100644
--- a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgDxe.c
+++ b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgDxe.c
@@ -103,7 +103,7 @@ QemuFwCfgInitialize (
         DEBUG_ERROR,
         "QemuFwCfgDma %a:%a Failed to locate IOMMU protocol.\n",
         gEfiCallerBaseName,
-        __FUNCTION__
+        __func__
         ));
       ASSERT (FALSE);
       CpuDeadLoop ();
@@ -186,7 +186,7 @@ AllocFwCfgDmaAccessBuffer (
       DEBUG_ERROR,
       "%a:%a failed to allocate FW_CFG_DMA_ACCESS\n",
       gEfiCallerBaseName,
-      __FUNCTION__
+      __func__
       ));
     ASSERT (FALSE);
     CpuDeadLoop ();
@@ -215,7 +215,7 @@ AllocFwCfgDmaAccessBuffer (
       DEBUG_ERROR,
       "%a:%a failed to Map() FW_CFG_DMA_ACCESS\n",
       gEfiCallerBaseName,
-      __FUNCTION__
+      __func__
       ));
     ASSERT (FALSE);
     CpuDeadLoop ();
@@ -228,7 +228,7 @@ AllocFwCfgDmaAccessBuffer (
       DEBUG_ERROR,
       "%a:%a failed to Map() - requested 0x%Lx got 0x%Lx\n",
       gEfiCallerBaseName,
-      __FUNCTION__,
+      __func__,
       (UINT64)sizeof (FW_CFG_DMA_ACCESS),
       (UINT64)Size
       ));
@@ -263,7 +263,7 @@ FreeFwCfgDmaAccessBuffer (
       DEBUG_ERROR,
       "%a:%a failed to UnMap() Mapping 0x%Lx\n",
       gEfiCallerBaseName,
-      __FUNCTION__,
+      __func__,
       (UINT64)(UINTN)Mapping
       ));
     ASSERT (FALSE);
@@ -276,7 +276,7 @@ FreeFwCfgDmaAccessBuffer (
       DEBUG_ERROR,
       "%a:%a failed to Free() 0x%Lx\n",
       gEfiCallerBaseName,
-      __FUNCTION__,
+      __func__,
       (UINT64)(UINTN)Access
       ));
     ASSERT (FALSE);
@@ -320,7 +320,7 @@ MapFwCfgDmaDataBuffer (
       DEBUG_ERROR,
       "%a:%a failed to Map() Address 0x%Lx Size 0x%Lx\n",
       gEfiCallerBaseName,
-      __FUNCTION__,
+      __func__,
       (UINT64)(UINTN)HostAddress,
       (UINT64)Size
       ));
@@ -334,7 +334,7 @@ MapFwCfgDmaDataBuffer (
       DEBUG_ERROR,
       "%a:%a failed to Map() - requested 0x%x got 0x%Lx\n",
       gEfiCallerBaseName,
-      __FUNCTION__,
+      __func__,
       Size,
       (UINT64)NumberOfBytes
       ));
@@ -360,7 +360,7 @@ UnmapFwCfgDmaDataBuffer (
       DEBUG_ERROR,
       "%a:%a failed to UnMap() Mapping 0x%Lx\n",
       gEfiCallerBaseName,
-      __FUNCTION__,
+      __func__,
       (UINT64)(UINTN)Mapping
       ));
     ASSERT (FALSE);
diff --git a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMmio.c b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMmio.c
index 583d8a8e9f41..115a21075912 100644
--- a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMmio.c
+++ b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMmio.c
@@ -134,7 +134,7 @@ QemuFwCfgInitialize (
     DEBUG ((
       DEBUG_WARN,
       "%a: No 'qemu,fw-cfg-mmio' compatible DT node found (Status == %r)\n",
-      __FUNCTION__,
+      __func__,
       Status
       ));
     return EFI_SUCCESS;
diff --git a/OvmfPkg/Library/QemuFwCfgS3Lib/QemuFwCfgS3Dxe.c b/OvmfPkg/Library/QemuFwCfgS3Lib/QemuFwCfgS3Dxe.c
index 5706fa9be46a..f5237564388f 100644
--- a/OvmfPkg/Library/QemuFwCfgS3Lib/QemuFwCfgS3Dxe.c
+++ b/OvmfPkg/Library/QemuFwCfgS3Lib/QemuFwCfgS3Dxe.c
@@ -71,7 +71,7 @@ S3SaveStateInstalledNotify (
     DEBUG_INFO,
     "%a: %a: DmaAccess@0x%Lx ScratchBuffer@[0x%Lx+0x%Lx]\n",
     gEfiCallerBaseName,
-    __FUNCTION__,
+    __func__,
     (UINT64)(UINTN)mDmaAccess,
     (UINT64)(UINTN)mScratchBuffer,
     (UINT64)mScratchBufferSize
@@ -161,7 +161,7 @@ QemuFwCfgS3CallWhenBootScriptReady (
       DEBUG_ERROR,
       "%a: %a: fw_cfg DMA unavailable\n",
       gEfiCallerBaseName,
-      __FUNCTION__
+      __func__
       ));
     return RETURN_NOT_FOUND;
   }
@@ -177,7 +177,7 @@ QemuFwCfgS3CallWhenBootScriptReady (
       DEBUG_ERROR,
       "%a: %a: ScratchBufferSize too big: %Lu\n",
       gEfiCallerBaseName,
-      __FUNCTION__,
+      __func__,
       (UINT64)ScratchBufferSize
       ));
     return RETURN_BAD_BUFFER_SIZE;
@@ -192,7 +192,7 @@ QemuFwCfgS3CallWhenBootScriptReady (
       DEBUG_ERROR,
       "%a: %a: AllocateReservedPool(): out of resources\n",
       gEfiCallerBaseName,
-      __FUNCTION__
+      __func__
       ));
     return RETURN_OUT_OF_RESOURCES;
   }
@@ -215,7 +215,7 @@ QemuFwCfgS3CallWhenBootScriptReady (
       DEBUG_ERROR,
       "%a: %a: CreateEvent(): %r\n",
       gEfiCallerBaseName,
-      __FUNCTION__,
+      __func__,
       Status
       ));
     goto FreeDmaAccess;
@@ -231,7 +231,7 @@ QemuFwCfgS3CallWhenBootScriptReady (
       DEBUG_ERROR,
       "%a: %a: RegisterProtocolNotify(): %r\n",
       gEfiCallerBaseName,
-      __FUNCTION__,
+      __func__,
       Status
       ));
     goto CloseEvent;
@@ -256,7 +256,7 @@ QemuFwCfgS3CallWhenBootScriptReady (
       DEBUG_ERROR,
       "%a: %a: SignalEvent(): %r\n",
       gEfiCallerBaseName,
-      __FUNCTION__,
+      __func__,
       Status
       ));
     goto NullGlobals;
@@ -383,7 +383,7 @@ QemuFwCfgS3ScriptWriteBytes (
       DEBUG_ERROR,
       "%a: %a: EFI_BOOT_SCRIPT_MEM_WRITE_OPCODE: %r\n",
       gEfiCallerBaseName,
-      __FUNCTION__,
+      __func__,
       Status
       ));
     return (RETURN_STATUS)Status;
@@ -409,7 +409,7 @@ QemuFwCfgS3ScriptWriteBytes (
       DEBUG_ERROR,
       "%a: %a: EFI_BOOT_SCRIPT_IO_WRITE_OPCODE: %r\n",
       gEfiCallerBaseName,
-      __FUNCTION__,
+      __func__,
       Status
       ));
     return (RETURN_STATUS)Status;
@@ -436,7 +436,7 @@ QemuFwCfgS3ScriptWriteBytes (
       DEBUG_ERROR,
       "%a: %a: EFI_BOOT_SCRIPT_MEM_POLL_OPCODE: %r\n",
       gEfiCallerBaseName,
-      __FUNCTION__,
+      __func__,
       Status
       ));
     return (RETURN_STATUS)Status;
@@ -544,7 +544,7 @@ QemuFwCfgS3ScriptReadBytes (
       DEBUG_ERROR,
       "%a: %a: EFI_BOOT_SCRIPT_MEM_WRITE_OPCODE: %r\n",
       gEfiCallerBaseName,
-      __FUNCTION__,
+      __func__,
       Status
       ));
     return (RETURN_STATUS)Status;
@@ -570,7 +570,7 @@ QemuFwCfgS3ScriptReadBytes (
       DEBUG_ERROR,
       "%a: %a: EFI_BOOT_SCRIPT_IO_WRITE_OPCODE: %r\n",
       gEfiCallerBaseName,
-      __FUNCTION__,
+      __func__,
       Status
       ));
     return (RETURN_STATUS)Status;
@@ -597,7 +597,7 @@ QemuFwCfgS3ScriptReadBytes (
       DEBUG_ERROR,
       "%a: %a: EFI_BOOT_SCRIPT_MEM_POLL_OPCODE: %r\n",
       gEfiCallerBaseName,
-      __FUNCTION__,
+      __func__,
       Status
       ));
     return (RETURN_STATUS)Status;
@@ -692,7 +692,7 @@ QemuFwCfgS3ScriptSkipBytes (
       DEBUG_ERROR,
       "%a: %a: EFI_BOOT_SCRIPT_MEM_WRITE_OPCODE: %r\n",
       gEfiCallerBaseName,
-      __FUNCTION__,
+      __func__,
       Status
       ));
     return (RETURN_STATUS)Status;
@@ -718,7 +718,7 @@ QemuFwCfgS3ScriptSkipBytes (
       DEBUG_ERROR,
       "%a: %a: EFI_BOOT_SCRIPT_IO_WRITE_OPCODE: %r\n",
       gEfiCallerBaseName,
-      __FUNCTION__,
+      __func__,
       Status
       ));
     return (RETURN_STATUS)Status;
@@ -745,7 +745,7 @@ QemuFwCfgS3ScriptSkipBytes (
       DEBUG_ERROR,
       "%a: %a: EFI_BOOT_SCRIPT_MEM_POLL_OPCODE: %r\n",
       gEfiCallerBaseName,
-      __FUNCTION__,
+      __func__,
       Status
       ));
     return (RETURN_STATUS)Status;
@@ -877,7 +877,7 @@ QemuFwCfgS3ScriptCheckValue (
       DEBUG_ERROR,
       "%a: %a: EFI_BOOT_SCRIPT_MEM_POLL_OPCODE: %r\n",
       gEfiCallerBaseName,
-      __FUNCTION__,
+      __func__,
       Status
       ));
     return (RETURN_STATUS)Status;
diff --git a/OvmfPkg/Library/ResetSystemLib/DxeResetSystemLibMicrovm.c b/OvmfPkg/Library/ResetSystemLib/DxeResetSystemLibMicrovm.c
index a31fd0e7bbbe..ae9d2260d585 100644
--- a/OvmfPkg/Library/ResetSystemLib/DxeResetSystemLibMicrovm.c
+++ b/OvmfPkg/Library/ResetSystemLib/DxeResetSystemLibMicrovm.c
@@ -29,11 +29,11 @@ DxeResetSystemLibMicrovmConstructor (
   EFI_STATUS                       Status;
   EFI_GCD_MEMORY_SPACE_DESCRIPTOR  Descriptor;
 
-  DEBUG ((DEBUG_INFO, "%a: start\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a: start\n", __func__));
 
   Status = gDS->GetMemorySpaceDescriptor (Address, &Descriptor);
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_INFO, "%a: GetMemorySpaceDescriptor failed\n", __FUNCTION__));
+    DEBUG ((DEBUG_INFO, "%a: GetMemorySpaceDescriptor failed\n", __func__));
     return RETURN_UNSUPPORTED;
   }
 
@@ -43,10 +43,10 @@ DxeResetSystemLibMicrovmConstructor (
                   Descriptor.Attributes | EFI_MEMORY_RUNTIME
                   );
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_INFO, "%a: SetMemorySpaceAttributes failed\n", __FUNCTION__));
+    DEBUG ((DEBUG_INFO, "%a: SetMemorySpaceAttributes failed\n", __func__));
     return RETURN_UNSUPPORTED;
   }
 
-  DEBUG ((DEBUG_INFO, "%a: done\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a: done\n", __func__));
   return EFI_SUCCESS;
 }
diff --git a/OvmfPkg/Library/ResetSystemLib/ResetSystemLibMicrovm.c b/OvmfPkg/Library/ResetSystemLib/ResetSystemLibMicrovm.c
index 44fe929e937d..4a4e78cca40a 100644
--- a/OvmfPkg/Library/ResetSystemLib/ResetSystemLibMicrovm.c
+++ b/OvmfPkg/Library/ResetSystemLib/ResetSystemLibMicrovm.c
@@ -25,9 +25,9 @@ MicrovmGedBase (
 
   if (EfiGoneVirtual ()) {
     EfiConvertPointer (0, &Address);
-    DEBUG ((DEBUG_INFO, "%a: virtual -> 0x%x\n", __FUNCTION__, Address));
+    DEBUG ((DEBUG_INFO, "%a: virtual -> 0x%x\n", __func__, Address));
   } else {
-    DEBUG ((DEBUG_INFO, "%a: physical -> 0x%x\n", __FUNCTION__, Address));
+    DEBUG ((DEBUG_INFO, "%a: physical -> 0x%x\n", __func__, Address));
   }
 
   return (UINTN)Address;
@@ -40,7 +40,7 @@ MicrovmReset (
 {
   UINTN  Address = MicrovmGedBase ();
 
-  DEBUG ((DEBUG_INFO, "%a: microvm reset via ged\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a: microvm reset via ged\n", __func__));
   MmioWrite8 (
     Address + MICROVM_ACPI_GED_REG_RESET,
     MICROVM_ACPI_GED_RESET_VALUE
@@ -55,7 +55,7 @@ MicrovmShutdown (
 {
   UINTN  Address = MicrovmGedBase ();
 
-  DEBUG ((DEBUG_INFO, "%a: microvm poweroff via ged\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a: microvm poweroff via ged\n", __func__));
   MmioWrite8 (
     Address + MICROVM_ACPI_GED_REG_SLEEP_CTL,
     (1 << 5) /* enable bit */ |
diff --git a/OvmfPkg/Library/SerializeVariablesLib/SerializeVariablesLib.c b/OvmfPkg/Library/SerializeVariablesLib/SerializeVariablesLib.c
index c70b4556b7f2..8df82e161a90 100644
--- a/OvmfPkg/Library/SerializeVariablesLib/SerializeVariablesLib.c
+++ b/OvmfPkg/Library/SerializeVariablesLib/SerializeVariablesLib.c
@@ -294,7 +294,7 @@ IterateVariablesCallbackSetSystemVariable (
       DEBUG_WARN,
       "%a: setting authenticated variable \"%s\" "
       "failed with EFI_SECURITY_VIOLATION, ignoring\n",
-      __FUNCTION__,
+      __func__,
       VariableName
       ));
     Status = EFI_SUCCESS;
@@ -303,7 +303,7 @@ IterateVariablesCallbackSetSystemVariable (
       DEBUG_WARN,
       "%a: setting ReadOnly variable \"%s\" "
       "failed with EFI_WRITE_PROTECTED, ignoring\n",
-      __FUNCTION__,
+      __func__,
       VariableName
       ));
     Status = EFI_SUCCESS;
diff --git a/OvmfPkg/Library/SmbiosVersionLib/DetectSmbiosVersionLib.c b/OvmfPkg/Library/SmbiosVersionLib/DetectSmbiosVersionLib.c
index 69c2d3640037..5de3022086b7 100644
--- a/OvmfPkg/Library/SmbiosVersionLib/DetectSmbiosVersionLib.c
+++ b/OvmfPkg/Library/SmbiosVersionLib/DetectSmbiosVersionLib.c
@@ -98,7 +98,7 @@ DetectSmbiosVersion (
       DEBUG ((
         DEBUG_INFO,
         "%a: SMBIOS 3.x DocRev from QEMU: 0x%02x\n",
-        __FUNCTION__,
+        __func__,
         QemuAnchor.V3.DocRev
         ));
       PcdStatus = PcdSet8S (PcdSmbiosDocRev, QemuAnchor.V3.DocRev);
@@ -112,7 +112,7 @@ DetectSmbiosVersion (
   DEBUG ((
     DEBUG_INFO,
     "%a: SMBIOS version from QEMU: 0x%04x\n",
-    __FUNCTION__,
+    __func__,
     SmbiosVersion
     ));
   PcdStatus = PcdSet16S (PcdSmbiosVersion, SmbiosVersion);
diff --git a/OvmfPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c b/OvmfPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c
index a1dd10c9f23b..a009123dae88 100644
--- a/OvmfPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c
+++ b/OvmfPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c
@@ -220,7 +220,7 @@ InitCpuHotEjectData (
       RETURN_ERROR (SafeUintnAdd (Size, sizeof (*mCpuHotEjectData), &Size)) ||
       RETURN_ERROR (SafeUintnAdd (Size, sizeof (UINT64) - 1, &Size)))
   {
-    DEBUG ((DEBUG_ERROR, "%a: invalid CPU_HOT_EJECT_DATA\n", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a: invalid CPU_HOT_EJECT_DATA\n", __func__));
     goto Fatal;
   }
 
@@ -303,7 +303,7 @@ SmmCpuFeaturesSmmRelocationComplete (
     DEBUG ((
       DEBUG_ERROR,
       "%a: MemEncryptSevSetPageEncMask(): %r\n",
-      __FUNCTION__,
+      __func__,
       Status
       ));
     ASSERT (FALSE);
diff --git a/OvmfPkg/Library/TlsAuthConfigLib/TlsAuthConfigLib.c b/OvmfPkg/Library/TlsAuthConfigLib/TlsAuthConfigLib.c
index e22de4f5d48e..e4bec93fed1f 100644
--- a/OvmfPkg/Library/TlsAuthConfigLib/TlsAuthConfigLib.c
+++ b/OvmfPkg/Library/TlsAuthConfigLib/TlsAuthConfigLib.c
@@ -51,7 +51,7 @@ SetCaCerts (
       DEBUG_VERBOSE,
       "%a:%a: not touching CA cert list\n",
       gEfiCallerBaseName,
-      __FUNCTION__
+      __func__
       ));
     return;
   }
@@ -83,7 +83,7 @@ SetCaCerts (
       DEBUG_ERROR,
       "%a:%a: failed to delete %g:\"%s\"\n",
       gEfiCallerBaseName,
-      __FUNCTION__,
+      __func__,
       &gEfiTlsCaCertificateGuid,
       EFI_TLS_CA_CERTIFICATE_VARIABLE
       ));
@@ -96,7 +96,7 @@ SetCaCerts (
       DEBUG_VERBOSE,
       "%a:%a: applied empty CA cert list\n",
       gEfiCallerBaseName,
-      __FUNCTION__
+      __func__
       ));
     return;
   }
@@ -107,7 +107,7 @@ SetCaCerts (
       DEBUG_ERROR,
       "%a:%a: failed to allocate HttpsCaCerts\n",
       gEfiCallerBaseName,
-      __FUNCTION__
+      __func__
       ));
     return;
   }
@@ -127,7 +127,7 @@ SetCaCerts (
       DEBUG_ERROR,
       "%a:%a: failed to set %g:\"%s\": %r\n",
       gEfiCallerBaseName,
-      __FUNCTION__,
+      __func__,
       &gEfiTlsCaCertificateGuid,
       EFI_TLS_CA_CERTIFICATE_VARIABLE,
       Status
@@ -139,7 +139,7 @@ SetCaCerts (
     DEBUG_VERBOSE,
     "%a:%a: stored CA cert list (%Lu byte(s))\n",
     gEfiCallerBaseName,
-    __FUNCTION__,
+    __func__,
     (UINT64)HttpsCaCertsSize
     ));
 
@@ -176,7 +176,7 @@ SetCipherSuites (
       DEBUG_VERBOSE,
       "%a:%a: not touching cipher suites\n",
       gEfiCallerBaseName,
-      __FUNCTION__
+      __func__
       ));
     return;
   }
@@ -204,7 +204,7 @@ SetCipherSuites (
       DEBUG_ERROR,
       "%a:%a: failed to delete %g:\"%s\"\n",
       gEfiCallerBaseName,
-      __FUNCTION__,
+      __func__,
       &gEdkiiHttpTlsCipherListGuid,
       EDKII_HTTP_TLS_CIPHER_LIST_VARIABLE
       ));
@@ -216,7 +216,7 @@ SetCipherSuites (
       DEBUG_ERROR,
       "%a:%a: list of cipher suites must not be empty\n",
       gEfiCallerBaseName,
-      __FUNCTION__
+      __func__
       ));
     Status = EFI_INVALID_PARAMETER;
     goto Done;
@@ -228,7 +228,7 @@ SetCipherSuites (
       DEBUG_ERROR,
       "%a:%a: failed to allocate HttpsCiphers\n",
       gEfiCallerBaseName,
-      __FUNCTION__
+      __func__
       ));
     Status = EFI_OUT_OF_RESOURCES;
     goto Done;
@@ -249,7 +249,7 @@ SetCipherSuites (
       DEBUG_ERROR,
       "%a:%a: failed to set %g:\"%s\"\n",
       gEfiCallerBaseName,
-      __FUNCTION__,
+      __func__,
       &gEdkiiHttpTlsCipherListGuid,
       EDKII_HTTP_TLS_CIPHER_LIST_VARIABLE
       ));
@@ -260,7 +260,7 @@ SetCipherSuites (
     DEBUG_VERBOSE,
     "%a:%a: stored list of cipher suites (%Lu byte(s))\n",
     gEfiCallerBaseName,
-    __FUNCTION__,
+    __func__,
     (UINT64)HttpsCiphersSize
     ));
 
diff --git a/OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDevice.c b/OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDevice.c
index 831dc1736d28..fac3242257a2 100644
--- a/OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDevice.c
+++ b/OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDevice.c
@@ -85,7 +85,7 @@ VirtioMmioInit (
       DEBUG ((
         DEBUG_INFO,
         "%a virtio 0.9.5, id %d\n",
-        __FUNCTION__,
+        __func__,
         Device->VirtioDevice.SubSystemDeviceId
         ));
       Device->VirtioDevice.Revision = VIRTIO_SPEC_REVISION (0, 9, 5);
@@ -94,7 +94,7 @@ VirtioMmioInit (
       DEBUG ((
         DEBUG_INFO,
         "%a virtio 1.0, id %d\n",
-        __FUNCTION__,
+        __func__,
         Device->VirtioDevice.SubSystemDeviceId
         ));
       Device->VirtioDevice.Revision = VIRTIO_SPEC_REVISION (1, 0, 0);
diff --git a/OvmfPkg/Library/X86QemuLoadImageLib/X86QemuLoadImageLib.c b/OvmfPkg/Library/X86QemuLoadImageLib/X86QemuLoadImageLib.c
index 248a03e8db0b..a7ab43ca7415 100644
--- a/OvmfPkg/Library/X86QemuLoadImageLib/X86QemuLoadImageLib.c
+++ b/OvmfPkg/Library/X86QemuLoadImageLib/X86QemuLoadImageLib.c
@@ -394,7 +394,7 @@ QemuLoadKernelImage (
         DEBUG ((
           DEBUG_ERROR,
           "%a: QemuLoadLegacyImage(): %r\n",
-          __FUNCTION__,
+          __func__,
           Status
           ));
         return Status;
@@ -404,7 +404,7 @@ QemuLoadKernelImage (
       return EFI_SUCCESS;
 
     default:
-      DEBUG ((DEBUG_ERROR, "%a: LoadImage(): %r\n", __FUNCTION__, Status));
+      DEBUG ((DEBUG_ERROR, "%a: LoadImage(): %r\n", __func__, Status));
       return Status;
   }
 
@@ -443,7 +443,7 @@ QemuLoadKernelImage (
       DEBUG ((
         DEBUG_ERROR,
         "%a: kernel command line is not NUL-terminated\n",
-        __FUNCTION__
+        __func__
         ));
       Status = EFI_PROTOCOL_ERROR;
       goto FreeCommandLine;
@@ -492,7 +492,7 @@ QemuLoadKernelImage (
     DEBUG ((
       DEBUG_INFO,
       "%a: command line: \"%s\"\n",
-      __FUNCTION__,
+      __func__,
       (CHAR16 *)KernelLoadedImage->LoadOptions
       ));
   }
diff --git a/OvmfPkg/Library/XenIoMmioLib/XenIoMmioLib.c b/OvmfPkg/Library/XenIoMmioLib/XenIoMmioLib.c
index caf4a28e1f29..db4973406ad1 100644
--- a/OvmfPkg/Library/XenIoMmioLib/XenIoMmioLib.c
+++ b/OvmfPkg/Library/XenIoMmioLib/XenIoMmioLib.c
@@ -91,7 +91,7 @@ XenIoMmioInstall (
                        &mXenBusRootDevicePathTemplate
                        );
   if (!XenBusDevicePath) {
-    DEBUG ((DEBUG_ERROR, "%a: Out of memory\n", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a: Out of memory\n", __func__));
     Status = EFI_OUT_OF_RESOURCES;
     goto FreeXenIo;
   }
@@ -115,7 +115,7 @@ XenIoMmioInstall (
     DEBUG_ERROR,
     "%a: Failed to install the EFI_DEVICE_PATH and "
     "XENIO_PROTOCOL protocols on handle %p (Status == %r)\n",
-    __FUNCTION__,
+    __func__,
     OutHandle,
     Status
     ));
diff --git a/OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.c b/OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.c
index 40c464ce16b6..2edd92c7545c 100644
--- a/OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.c
+++ b/OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.c
@@ -204,7 +204,7 @@ CacheInitrdFile (
     DEBUG ((
       DEBUG_WARN,
       "%a: failed to read initrd file - %r 0x%lx 0x%lx\n",
-      __FUNCTION__,
+      __func__,
       Status,
       (UINT64)ReadSize,
       FileSize
diff --git a/OvmfPkg/LsiScsiDxe/LsiScsi.c b/OvmfPkg/LsiScsiDxe/LsiScsi.c
index 1f52b85ed24e..86c8c6612df6 100644
--- a/OvmfPkg/LsiScsiDxe/LsiScsi.c
+++ b/OvmfPkg/LsiScsiDxe/LsiScsi.c
@@ -512,7 +512,7 @@ LsiScsiProcessRequest (
   DEBUG ((
     DEBUG_VERBOSE,
     "%a: dstat: %02X, sist0: %02X, sist1: %02X\n",
-    __FUNCTION__,
+    __func__,
     DStat,
     SIst0,
     SIst1
@@ -800,7 +800,7 @@ LsiScsiExitBoot (
   LSI_SCSI_DEV  *Dev;
 
   Dev = Context;
-  DEBUG ((DEBUG_VERBOSE, "%a: Context=0x%p\n", __FUNCTION__, Context));
+  DEBUG ((DEBUG_VERBOSE, "%a: Context=0x%p\n", __func__, Context));
   LsiScsiReset (Dev);
 }
 
diff --git a/OvmfPkg/MptScsiDxe/MptScsi.c b/OvmfPkg/MptScsiDxe/MptScsi.c
index f64ccec24da8..348acafcf0dc 100644
--- a/OvmfPkg/MptScsiDxe/MptScsi.c
+++ b/OvmfPkg/MptScsiDxe/MptScsi.c
@@ -278,7 +278,7 @@ ReportHostAdapterError (
   OUT EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET  *Packet
   )
 {
-  DEBUG ((DEBUG_ERROR, "%a: fatal error in scsi request\n", __FUNCTION__));
+  DEBUG ((DEBUG_ERROR, "%a: fatal error in scsi request\n", __func__));
   Packet->InTransferLength  = 0;
   Packet->OutTransferLength = 0;
   Packet->SenseDataLength   = 0;
@@ -509,7 +509,7 @@ MptScsiHandleReply (
     Packet->HostAdapterStatus = EFI_EXT_SCSI_STATUS_HOST_ADAPTER_OK;
     Packet->TargetStatus      = EFI_EXT_SCSI_STATUS_TARGET_GOOD;
   } else if ((Reply & BIT31) != 0) {
-    DEBUG ((DEBUG_INFO, "%a: Full reply returned\n", __FUNCTION__));
+    DEBUG ((DEBUG_INFO, "%a: Full reply returned\n", __func__));
     //
     // When reply MSB is set, we got a full reply. Since we submitted only one
     // reply frame, we know it's IoReply.
@@ -549,7 +549,7 @@ MptScsiHandleReply (
         return EFI_DEVICE_ERROR;
     }
   } else {
-    DEBUG ((DEBUG_ERROR, "%a: unexpected reply (%x)\n", __FUNCTION__, Reply));
+    DEBUG ((DEBUG_ERROR, "%a: unexpected reply (%x)\n", __func__, Reply));
     return ReportHostAdapterError (Packet);
   }
 
@@ -785,7 +785,7 @@ MptScsiExitBoot (
   MPT_SCSI_DEV  *Dev;
 
   Dev = Context;
-  DEBUG ((DEBUG_VERBOSE, "%a: Context=0x%p\n", __FUNCTION__, Context));
+  DEBUG ((DEBUG_VERBOSE, "%a: Context=0x%p\n", __func__, Context));
   MptScsiReset (Dev);
 }
 
@@ -940,7 +940,7 @@ MptScsiControllerStart (
     DEBUG ((
       DEBUG_WARN,
       "%a: failed to enable 64-bit DMA addresses\n",
-      __FUNCTION__
+      __func__
       ));
   }
 
diff --git a/OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.c b/OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.c
index 3f9c84cf2b54..6b2b6797b3b6 100644
--- a/OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.c
+++ b/OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.c
@@ -572,7 +572,7 @@ GetResourcePadding (
   DEBUG ((
     DEBUG_VERBOSE,
     "%a: Address=%02x:%02x.%x DevicePath=%s\n",
-    __FUNCTION__,
+    __func__,
     Address->Bus,
     Address->Device,
     Address->Function,
@@ -613,11 +613,11 @@ GetResourcePadding (
       DEBUG_VERBOSE,
       "%a: BusNumbers=0x%x Io=0x%Lx NonPrefetchable32BitMmio=0x%x\n"
       "%a: Prefetchable32BitMmio=0x%x Prefetchable64BitMmio=0x%Lx\n",
-      __FUNCTION__,
+      __func__,
       ReservationHint.BusNumbers,
       ReservationHint.Io,
       ReservationHint.NonPrefetchable32BitMmio,
-      __FUNCTION__,
+      __func__,
       ReservationHint.Prefetchable32BitMmio,
       ReservationHint.Prefetchable64BitMmio
       ));
diff --git a/OvmfPkg/PlatformDxe/Platform.c b/OvmfPkg/PlatformDxe/Platform.c
index e58e75eb2203..cd3bfd554c98 100644
--- a/OvmfPkg/PlatformDxe/Platform.c
+++ b/OvmfPkg/PlatformDxe/Platform.c
@@ -239,7 +239,7 @@ ExtractConfig (
   UINTN            Size;
   BOOLEAN          AllocatedRequest;
 
-  DEBUG ((DEBUG_VERBOSE, "%a: Request=\"%s\"\n", __FUNCTION__, Request));
+  DEBUG ((DEBUG_VERBOSE, "%a: Request=\"%s\"\n", __func__, Request));
 
   if ((Progress == NULL) || (Results == NULL)) {
     return EFI_INVALID_PARAMETER;
@@ -321,12 +321,12 @@ ExtractConfig (
     DEBUG ((
       DEBUG_ERROR,
       "%a: BlockToConfig(): %r, Progress=\"%s\"\n",
-      __FUNCTION__,
+      __func__,
       Status,
       (Status == EFI_DEVICE_ERROR) ? NULL : *Progress
       ));
   } else {
-    DEBUG ((DEBUG_VERBOSE, "%a: Results=\"%s\"\n", __FUNCTION__, *Results));
+    DEBUG ((DEBUG_VERBOSE, "%a: Results=\"%s\"\n", __func__, *Results));
   }
 
   //
@@ -431,7 +431,7 @@ RouteConfig (
   DEBUG ((
     DEBUG_VERBOSE,
     "%a: Configuration=\"%s\"\n",
-    __FUNCTION__,
+    __func__,
     Configuration
     ));
 
@@ -481,7 +481,7 @@ RouteConfig (
     DEBUG ((
       DEBUG_ERROR,
       "%a: ConfigToBlock(): %r, Progress=\"%s\"\n",
-      __FUNCTION__,
+      __func__,
       Status,
       (Status == EFI_BUFFER_TOO_SMALL) ? NULL : *Progress
       ));
@@ -514,7 +514,7 @@ Callback (
   DEBUG ((
     DEBUG_VERBOSE,
     "%a: Action=0x%Lx QuestionId=%d Type=%d\n",
-    __FUNCTION__,
+    __func__,
     (UINT64)Action,
     QuestionId,
     Type
@@ -835,7 +835,7 @@ ExecutePlatformConfig (
     DEBUG ((
       (Status == EFI_NOT_FOUND) ? DEBUG_VERBOSE : DEBUG_ERROR,
       "%a: failed to load platform config: %r\n",
-      __FUNCTION__,
+      __func__,
       Status
       ));
     return Status;
diff --git a/OvmfPkg/PlatformPei/ClearCache.c b/OvmfPkg/PlatformPei/ClearCache.c
index 9f23f9a42847..9e59f31df7fd 100644
--- a/OvmfPkg/PlatformPei/ClearCache.c
+++ b/OvmfPkg/PlatformPei/ClearCache.c
@@ -59,7 +59,7 @@ ClearCacheOnMpServicesAvailable (
   EFI_PEI_MP_SERVICES_PPI  *MpServices;
   EFI_STATUS               Status;
 
-  DEBUG ((DEBUG_INFO, "%a: %a\n", gEfiCallerBaseName, __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a: %a\n", gEfiCallerBaseName, __func__));
 
   //
   // Clear cache on all the APs in parallel.
@@ -74,7 +74,7 @@ ClearCacheOnMpServicesAvailable (
                              NULL             // ProcedureArgument
                              );
   if (EFI_ERROR (Status) && (Status != EFI_NOT_STARTED)) {
-    DEBUG ((DEBUG_ERROR, "%a: StartupAllAps(): %r\n", __FUNCTION__, Status));
+    DEBUG ((DEBUG_ERROR, "%a: StartupAllAps(): %r\n", __func__, Status));
     return Status;
   }
 
@@ -108,7 +108,7 @@ InstallClearCacheCallback (
     DEBUG ((
       DEBUG_ERROR,
       "%a: failed to set up MP Services callback: %r\n",
-      __FUNCTION__,
+      __func__,
       Status
       ));
   }
diff --git a/OvmfPkg/PlatformPei/FeatureControl.c b/OvmfPkg/PlatformPei/FeatureControl.c
index d8a398cd5565..d2ec496b74a8 100644
--- a/OvmfPkg/PlatformPei/FeatureControl.c
+++ b/OvmfPkg/PlatformPei/FeatureControl.c
@@ -85,7 +85,7 @@ OnMpServicesAvailable (
 
   PlatformInfoHob = (EFI_HOB_PLATFORM_INFO *)GET_GUID_HOB_DATA (GuidHob);
 
-  DEBUG ((DEBUG_VERBOSE, "%a: %a\n", gEfiCallerBaseName, __FUNCTION__));
+  DEBUG ((DEBUG_VERBOSE, "%a: %a\n", gEfiCallerBaseName, __func__));
 
   //
   // Write the MSR on all the APs in parallel.
@@ -100,7 +100,7 @@ OnMpServicesAvailable (
                              PlatformInfoHob      // ProcedureArgument
                              );
   if (EFI_ERROR (Status) && (Status != EFI_NOT_STARTED)) {
-    DEBUG ((DEBUG_ERROR, "%a: StartupAllAps(): %r\n", __FUNCTION__, Status));
+    DEBUG ((DEBUG_ERROR, "%a: StartupAllAps(): %r\n", __func__, Status));
     return Status;
   }
 
@@ -154,7 +154,7 @@ InstallFeatureControlCallback (
     DEBUG ((
       DEBUG_ERROR,
       "%a: failed to set up MP Services callback: %r\n",
-      __FUNCTION__,
+      __func__,
       Status
       ));
   }
diff --git a/OvmfPkg/PlatformPei/MemDetect.c b/OvmfPkg/PlatformPei/MemDetect.c
index 41d186986ba8..0c755c4940bb 100644
--- a/OvmfPkg/PlatformPei/MemDetect.c
+++ b/OvmfPkg/PlatformPei/MemDetect.c
@@ -75,7 +75,7 @@ Q35TsegMbytesInitialization (
   DEBUG ((
     DEBUG_INFO,
     "%a: QEMU offers an extended TSEG (%d MB)\n",
-    __FUNCTION__,
+    __func__,
     ExtendedTsegMbytes
     ));
   PcdStatus = PcdSet16S (PcdQ35TsegMbytes, ExtendedTsegMbytes);
@@ -97,7 +97,7 @@ Q35SmramAtDefaultSmbaseInitialization (
     DEBUG ((
       DEBUG_INFO,
       "%a: SMRAM at default SMBASE not checked due to CSM\n",
-      __FUNCTION__
+      __func__
       ));
   } else {
     UINTN  CtlReg;
@@ -111,7 +111,7 @@ Q35SmramAtDefaultSmbaseInitialization (
     DEBUG ((
       DEBUG_INFO,
       "%a: SMRAM at default SMBASE %a\n",
-      __FUNCTION__,
+      __func__,
       PlatformInfoHob->Q35SmramAtDefaultSmbase ? "found" : "not found"
       ));
   }
@@ -152,7 +152,7 @@ AddressWidthInitialization (
       DEBUG ((
         DEBUG_INFO,
         "%a: disabling 64-bit PCI host aperture\n",
-        __FUNCTION__
+        __func__
         ));
       PcdStatus = PcdSet64S (PcdPciMmio64Size, 0);
       ASSERT_RETURN_ERROR (PcdStatus);
@@ -175,7 +175,7 @@ AddressWidthInitialization (
     DEBUG ((
       DEBUG_INFO,
       "%a: Pci64Base=0x%Lx Pci64Size=0x%Lx\n",
-      __FUNCTION__,
+      __func__,
       PlatformInfoHob->PcdPciMmio64Base,
       PlatformInfoHob->PcdPciMmio64Size
       ));
@@ -307,7 +307,7 @@ PublishPeiMemory (
     DEBUG ((
       DEBUG_INFO,
       "%a: PhysMemAddressWidth=%d PeiMemoryCap=%u KB\n",
-      __FUNCTION__,
+      __func__,
       PlatformInfoHob->PhysMemAddressWidth,
       PeiMemoryCap >> 10
       ));
diff --git a/OvmfPkg/PlatformPei/MemTypeInfo.c b/OvmfPkg/PlatformPei/MemTypeInfo.c
index eb37febb31ae..ea049b21cfc0 100644
--- a/OvmfPkg/PlatformPei/MemTypeInfo.c
+++ b/OvmfPkg/PlatformPei/MemTypeInfo.c
@@ -100,7 +100,7 @@ RefreshMemTypeInfo (
     // If the UEFI variable couldn't be read for some other reason, we
     // similarly can't use it for udpating mMemoryTypeInformation.
     //
-    DEBUG ((DEBUG_ERROR, "%a: GetVariable(): %r\n", __FUNCTION__, Status));
+    DEBUG ((DEBUG_ERROR, "%a: GetVariable(): %r\n", __func__, Status));
     return;
   }
 
@@ -111,7 +111,7 @@ RefreshMemTypeInfo (
     DEBUG ((
       DEBUG_ERROR,
       "%a: invalid UEFI variable size %Lu\n",
-      __FUNCTION__,
+      __func__,
       (UINT64)DataSize
       ));
     return;
@@ -151,7 +151,7 @@ RefreshMemTypeInfo (
       DEBUG ((
         DEBUG_VERBOSE,
         "%a: Type 0x%x: NumberOfPages 0x%x -> 0x%x\n",
-        __FUNCTION__,
+        __func__,
         HobRecord->Type,
         HobRecord->NumberOfPages,
         VariableRecord->NumberOfPages
@@ -183,7 +183,7 @@ OnReadOnlyVariable2Available (
   IN VOID                       *Ppi
   )
 {
-  DEBUG ((DEBUG_VERBOSE, "%a\n", __FUNCTION__));
+  DEBUG ((DEBUG_VERBOSE, "%a\n", __func__));
 
   RefreshMemTypeInfo (Ppi);
   BuildMemTypeInfoHob ();
@@ -222,7 +222,7 @@ MemTypeInfoInitialization (
     DEBUG ((
       DEBUG_ERROR,
       "%a: failed to set up R/O Variable 2 callback: %r\n",
-      __FUNCTION__,
+      __func__,
       Status
       ));
     ASSERT (FALSE);
diff --git a/OvmfPkg/PlatformPei/Platform.c b/OvmfPkg/PlatformPei/Platform.c
index 148240342b4b..cc9384ba5c4e 100644
--- a/OvmfPkg/PlatformPei/Platform.c
+++ b/OvmfPkg/PlatformPei/Platform.c
@@ -114,7 +114,7 @@ MicrovmInitialization (
 
   Status = QemuFwCfgFindFile ("etc/fdt", &FdtItem, &FdtSize);
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_INFO, "%a: no etc/fdt found in fw_cfg, using dummy\n", __FUNCTION__));
+    DEBUG ((DEBUG_INFO, "%a: no etc/fdt found in fw_cfg, using dummy\n", __func__));
     FdtItem = 0;
     FdtSize = sizeof (EmptyFdt);
   }
@@ -122,7 +122,7 @@ MicrovmInitialization (
   FdtPages = EFI_SIZE_TO_PAGES (FdtSize);
   NewBase  = AllocatePages (FdtPages);
   if (NewBase == NULL) {
-    DEBUG ((DEBUG_INFO, "%a: AllocatePages failed\n", __FUNCTION__));
+    DEBUG ((DEBUG_INFO, "%a: AllocatePages failed\n", __func__));
     return;
   }
 
@@ -135,14 +135,14 @@ MicrovmInitialization (
 
   FdtHobData = BuildGuidHob (&gFdtHobGuid, sizeof (*FdtHobData));
   if (FdtHobData == NULL) {
-    DEBUG ((DEBUG_INFO, "%a: BuildGuidHob failed\n", __FUNCTION__));
+    DEBUG ((DEBUG_INFO, "%a: BuildGuidHob failed\n", __func__));
     return;
   }
 
   DEBUG ((
     DEBUG_INFO,
     "%a: fdt at 0x%x (size %d)\n",
-    __FUNCTION__,
+    __func__,
     NewBase,
     FdtSize
     ));
@@ -158,7 +158,7 @@ MiscInitializationForMicrovm (
 
   ASSERT (PlatformInfoHob->HostBridgeDevId == 0xffff);
 
-  DEBUG ((DEBUG_INFO, "%a: microvm\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a: microvm\n", __func__));
   //
   // Disable A20 Mask
   //
@@ -240,17 +240,17 @@ S3Verification (
     DEBUG ((
       DEBUG_ERROR,
       "%a: S3Resume2Pei doesn't support X64 PEI + SMM yet.\n",
-      __FUNCTION__
+      __func__
       ));
     DEBUG ((
       DEBUG_ERROR,
       "%a: Please disable S3 on the QEMU command line (see the README),\n",
-      __FUNCTION__
+      __func__
       ));
     DEBUG ((
       DEBUG_ERROR,
       "%a: or build OVMF with \"OvmfPkgIa32X64.dsc\".\n",
-      __FUNCTION__
+      __func__
       ));
     ASSERT (FALSE);
     CpuDeadLoop ();
@@ -273,7 +273,7 @@ Q35BoardVerification (
     DEBUG_ERROR,
     "%a: no TSEG (SMRAM) on host bridge DID=0x%04x; "
     "only DID=0x%04x (Q35) is supported\n",
-    __FUNCTION__,
+    __func__,
     PlatformInfoHob->HostBridgeDevId,
     INTEL_Q35_MCH_DEVICE_ID
     ));
diff --git a/OvmfPkg/PvScsiDxe/PvScsi.c b/OvmfPkg/PvScsiDxe/PvScsi.c
index 47cc0ae59bf8..6ec5040f7ef2 100644
--- a/OvmfPkg/PvScsiDxe/PvScsi.c
+++ b/OvmfPkg/PvScsiDxe/PvScsi.c
@@ -904,7 +904,7 @@ PvScsiSetPciAttributes (
     DEBUG ((
       DEBUG_WARN,
       "%a: failed to enable 64-bit DMA addresses\n",
-      __FUNCTION__
+      __func__
       ));
   }
 
@@ -1279,7 +1279,7 @@ PvScsiExitBoot (
   PVSCSI_DEV  *Dev;
 
   Dev = Context;
-  DEBUG ((DEBUG_VERBOSE, "%a: Context=0x%p\n", __FUNCTION__, Context));
+  DEBUG ((DEBUG_VERBOSE, "%a: Context=0x%p\n", __func__, Context));
 
   //
   // Reset the device to stop device usage of the rings.
diff --git a/OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c b/OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c
index d4f3cd92255f..3c12085f6c1e 100644
--- a/OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c
+++ b/OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c
@@ -968,7 +968,7 @@ FetchBlob (
     DEBUG ((
       DEBUG_ERROR,
       "%a: failed to allocate %Ld bytes for \"%s\"\n",
-      __FUNCTION__,
+      __func__,
       (INT64)Blob->Size,
       Blob->Name
       ));
@@ -978,7 +978,7 @@ FetchBlob (
   DEBUG ((
     DEBUG_INFO,
     "%a: loading %Ld bytes for \"%s\"\n",
-    __FUNCTION__,
+    __func__,
     (INT64)Blob->Size,
     Blob->Name
     ));
@@ -1001,7 +1001,7 @@ FetchBlob (
       DEBUG ((
         DEBUG_VERBOSE,
         "%a: %Ld bytes remaining for \"%s\" (%d)\n",
-        __FUNCTION__,
+        __func__,
         (INT64)Left,
         Blob->Name,
         (INT32)Idx
@@ -1051,7 +1051,7 @@ QemuKernelLoaderFsDxeEntrypoint (
 
   Status = gRT->GetTime (&mInitTime, NULL /* Capabilities */);
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "%a: GetTime(): %r\n", __FUNCTION__, Status));
+    DEBUG ((DEBUG_ERROR, "%a: GetTime(): %r\n", __func__, Status));
     return Status;
   }
 
@@ -1101,7 +1101,7 @@ QemuKernelLoaderFsDxeEntrypoint (
     DEBUG ((
       DEBUG_ERROR,
       "%a: InstallMultipleProtocolInterfaces(): %r\n",
-      __FUNCTION__,
+      __func__,
       Status
       ));
     goto FreeBlobs;
@@ -1121,7 +1121,7 @@ QemuKernelLoaderFsDxeEntrypoint (
       DEBUG ((
         DEBUG_ERROR,
         "%a: InstallMultipleProtocolInterfaces(): %r\n",
-        __FUNCTION__,
+        __func__,
         Status
         ));
       goto UninstallFileSystemHandle;
diff --git a/OvmfPkg/QemuRamfbDxe/QemuRamfb.c b/OvmfPkg/QemuRamfbDxe/QemuRamfb.c
index f5113fbc78a6..5a1044f0dc7b 100644
--- a/OvmfPkg/QemuRamfbDxe/QemuRamfb.c
+++ b/OvmfPkg/QemuRamfbDxe/QemuRamfb.c
@@ -189,7 +189,7 @@ QemuRamfbGraphicsOutputSetMode (
     DEBUG ((
       DEBUG_WARN,
       "%a: clearing the screen failed: %r\n",
-      __FUNCTION__,
+      __func__,
       Status
       ));
   }
diff --git a/OvmfPkg/QemuVideoDxe/Gop.c b/OvmfPkg/QemuVideoDxe/Gop.c
index 7a9fe208c99c..b11eed7558bf 100644
--- a/OvmfPkg/QemuVideoDxe/Gop.c
+++ b/OvmfPkg/QemuVideoDxe/Gop.c
@@ -37,7 +37,7 @@ QemuVideoCompleteModeInfo (
     Info->PixelInformation.BlueMask     = 0;
     Info->PixelInformation.ReservedMask = 0;
   } else {
-    DEBUG ((DEBUG_ERROR, "%a: Invalid ColorDepth %u", __FUNCTION__, ModeData->ColorDepth));
+    DEBUG ((DEBUG_ERROR, "%a: Invalid ColorDepth %u", __func__, ModeData->ColorDepth));
     ASSERT (FALSE);
   }
 
diff --git a/OvmfPkg/QemuVideoDxe/Initialize.c b/OvmfPkg/QemuVideoDxe/Initialize.c
index 2a3cbc65c32a..050ae878ecde 100644
--- a/OvmfPkg/QemuVideoDxe/Initialize.c
+++ b/OvmfPkg/QemuVideoDxe/Initialize.c
@@ -310,7 +310,7 @@ QemuVideoBochsEdid (
     DEBUG ((
       DEBUG_INFO,
       "%a: mmio read failed\n",
-      __FUNCTION__
+      __func__
       ));
     return;
   }
@@ -321,7 +321,7 @@ QemuVideoBochsEdid (
     DEBUG ((
       DEBUG_INFO,
       "%a: magic check failed\n",
-      __FUNCTION__
+      __func__
       ));
     return;
   }
@@ -329,7 +329,7 @@ QemuVideoBochsEdid (
   DEBUG ((
     DEBUG_INFO,
     "%a: blob found (extensions: %d)\n",
-    __FUNCTION__,
+    __func__,
     Private->Edid[126]
     ));
 
@@ -339,7 +339,7 @@ QemuVideoBochsEdid (
     DEBUG ((
       DEBUG_INFO,
       "%a: no detailed timing descriptor\n",
-      __FUNCTION__
+      __func__
       ));
     return;
   }
@@ -349,7 +349,7 @@ QemuVideoBochsEdid (
   DEBUG ((
     DEBUG_INFO,
     "%a: default resolution: %dx%d\n",
-    __FUNCTION__,
+    __func__,
     *XRes,
     *YRes
     ));
@@ -436,7 +436,7 @@ QemuVideoBochsModeSetup (
         DEBUG_ERROR,
         "%a: can't read size of drawable buffer from QXL "
         "ROM\n",
-        __FUNCTION__
+        __func__
         ));
       return EFI_NOT_FOUND;
     }
@@ -448,7 +448,7 @@ QemuVideoBochsModeSetup (
   DEBUG ((
     DEBUG_INFO,
     "%a: AvailableFbSize=0x%x\n",
-    __FUNCTION__,
+    __func__,
     AvailableFbSize
     ));
 
diff --git a/OvmfPkg/QemuVideoDxe/VbeShim.c b/OvmfPkg/QemuVideoDxe/VbeShim.c
index 2a048211a823..8f151b96f9a5 100644
--- a/OvmfPkg/QemuVideoDxe/VbeShim.c
+++ b/OvmfPkg/QemuVideoDxe/VbeShim.c
@@ -73,12 +73,12 @@ InstallVbeShim (
     DEBUG ((
       DEBUG_WARN,
       "%a: page 0 protected, not installing VBE shim\n",
-      __FUNCTION__
+      __func__
       ));
     DEBUG ((
       DEBUG_WARN,
       "%a: page 0 protection prevents Windows 7 from booting anyway\n",
-      __FUNCTION__
+      __func__
       ));
     return;
   }
@@ -117,7 +117,7 @@ InstallVbeShim (
       DEBUG ((
         DEBUG_INFO,
         "%a: Video BIOS handler found at %04x:%04x\n",
-        __FUNCTION__,
+        __func__,
         Int0x10->Segment,
         Int0x10->Offset
         ));
@@ -131,7 +131,7 @@ InstallVbeShim (
     DEBUG ((
       DEBUG_INFO,
       "%a: failed to allocate page at zero: %r\n",
-      __FUNCTION__,
+      __func__,
       Segment0AllocationStatus
       ));
   } else {
@@ -162,7 +162,7 @@ InstallVbeShim (
       DEBUG ((
         DEBUG_ERROR,
         "%a: unknown host bridge device ID: 0x%04x\n",
-        __FUNCTION__,
+        __func__,
         HostBridgeDevId
         ));
       ASSERT (FALSE);
@@ -324,5 +324,5 @@ InstallVbeShim (
   Int0x10->Segment = (UINT16)((UINT32)SegmentC >> 4);
   Int0x10->Offset  = (UINT16)((UINTN)(VbeModeInfo + 1) - SegmentC);
 
-  DEBUG ((DEBUG_INFO, "%a: VBE shim installed\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a: VBE shim installed\n", __func__));
 }
diff --git a/OvmfPkg/RiscVVirt/Library/PlatformBootManagerLib/PlatformBm.c b/OvmfPkg/RiscVVirt/Library/PlatformBootManagerLib/PlatformBm.c
index 2559889638ad..be4316f320f9 100644
--- a/OvmfPkg/RiscVVirt/Library/PlatformBootManagerLib/PlatformBm.c
+++ b/OvmfPkg/RiscVVirt/Library/PlatformBootManagerLib/PlatformBm.c
@@ -193,7 +193,7 @@ FilterAndProcess (
     DEBUG ((
       DEBUG_VERBOSE,
       "%a: %g: %r\n",
-      __FUNCTION__,
+      __func__,
       ProtocolGuid,
       Status
       ));
@@ -264,7 +264,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;
   }
 
@@ -413,7 +413,7 @@ IsVirtioPciRng (
   return FALSE;
 
 PciError:
-  DEBUG ((DEBUG_ERROR, "%a: %s: %r\n", __FUNCTION__, ReportText, Status));
+  DEBUG ((DEBUG_ERROR, "%a: %s: %r\n", __func__, ReportText, Status));
   return FALSE;
 }
 
@@ -440,7 +440,7 @@ Connect (
   DEBUG ((
     EFI_ERROR (Status) ? DEBUG_ERROR : DEBUG_VERBOSE,
     "%a: %s: %r\n",
-    __FUNCTION__,
+    __func__,
     ReportText,
     Status
     ));
@@ -466,7 +466,7 @@ AddOutput (
     DEBUG ((
       DEBUG_ERROR,
       "%a: %s: handle %p: device path not found\n",
-      __FUNCTION__,
+      __func__,
       ReportText,
       Handle
       ));
@@ -478,7 +478,7 @@ AddOutput (
     DEBUG ((
       DEBUG_ERROR,
       "%a: %s: adding to ConOut: %r\n",
-      __FUNCTION__,
+      __func__,
       ReportText,
       Status
       ));
@@ -490,7 +490,7 @@ AddOutput (
     DEBUG ((
       DEBUG_ERROR,
       "%a: %s: adding to ErrOut: %r\n",
-      __FUNCTION__,
+      __func__,
       ReportText,
       Status
       ));
@@ -500,7 +500,7 @@ AddOutput (
   DEBUG ((
     DEBUG_VERBOSE,
     "%a: %s: added to ConOut and ErrOut\n",
-    __FUNCTION__,
+    __func__,
     ReportText
     ));
 }
@@ -701,7 +701,7 @@ RemoveStaleFvFileOptions (
     DEBUG ((
       EFI_ERROR (Status) ? DEBUG_WARN : DEBUG_VERBOSE,
       "%a: removing stale Boot#%04x %s: %r\n",
-      __FUNCTION__,
+      __func__,
       (UINT32)BootOptions[Index].OptionNumber,
       DevicePathString == NULL ? L"<unavailable>" : DevicePathString,
       Status
@@ -879,7 +879,7 @@ PlatformBootManagerBeforeConsole (
   DEBUG ((
     EFI_ERROR (Status) ? DEBUG_ERROR : DEBUG_VERBOSE,
     "%a: SetVariable(%s, %u): %r\n",
-    __FUNCTION__,
+    __func__,
     EFI_TIME_OUT_VARIABLE_NAME,
     FrontPageTimeout,
     Status
diff --git a/OvmfPkg/RiscVVirt/Library/PlatformBootManagerLib/QemuKernel.c b/OvmfPkg/RiscVVirt/Library/PlatformBootManagerLib/QemuKernel.c
index 736628174f4e..c1ed425da00b 100644
--- a/OvmfPkg/RiscVVirt/Library/PlatformBootManagerLib/QemuKernel.c
+++ b/OvmfPkg/RiscVVirt/Library/PlatformBootManagerLib/QemuKernel.c
@@ -66,7 +66,7 @@ TryRunningQemuKernel (
     DEBUG ((
       DEBUG_ERROR,
       "%a: QemuStartKernelImage(): %r\n",
-      __FUNCTION__,
+      __func__,
       Status
       ));
   }
diff --git a/OvmfPkg/RiscVVirt/Library/PrePiHobListPointerLib/PrePiHobListPointer.c b/OvmfPkg/RiscVVirt/Library/PrePiHobListPointerLib/PrePiHobListPointer.c
index a58b7aae6bee..4035ba8d850a 100644
--- a/OvmfPkg/RiscVVirt/Library/PrePiHobListPointerLib/PrePiHobListPointer.c
+++ b/OvmfPkg/RiscVVirt/Library/PrePiHobListPointerLib/PrePiHobListPointer.c
@@ -31,7 +31,7 @@ PrePeiGetHobList (
   GetFirmwareContextPointer (&FirmwareContext);
 
   if (FirmwareContext == NULL) {
-    DEBUG ((DEBUG_ERROR, "%a: Firmware Context is NULL\n", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a: Firmware Context is NULL\n", __func__));
     return NULL;
   }
 
@@ -56,7 +56,7 @@ PrePeiSetHobList (
   GetFirmwareContextPointer (&FirmwareContext);
 
   if (FirmwareContext == NULL) {
-    DEBUG ((DEBUG_ERROR, "%a: Firmware Context is NULL\n", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a: Firmware Context is NULL\n", __func__));
     return EFI_NOT_READY;
   }
 
diff --git a/OvmfPkg/RiscVVirt/Sec/Memory.c b/OvmfPkg/RiscVVirt/Sec/Memory.c
index f7a72c7bb4fb..0e2690c73687 100644
--- a/OvmfPkg/RiscVVirt/Sec/Memory.c
+++ b/OvmfPkg/RiscVVirt/Sec/Memory.c
@@ -97,7 +97,7 @@ InitMmu (
   // Set supervisor translation mode to Bare mode
   //
   RiscVSetSupervisorAddressTranslationRegister ((UINT64)SATP_MODE_OFF << 60);
-  DEBUG ((DEBUG_INFO, "%a: Set Supervisor address mode to bare-metal mode.\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a: Set Supervisor address mode to bare-metal mode.\n", __func__));
 }
 
 /**
@@ -276,13 +276,13 @@ MemoryPeimInitialization (
   GetFirmwareContextPointer (&FirmwareContext);
 
   if (FirmwareContext == NULL) {
-    DEBUG ((DEBUG_ERROR, "%a: Firmware Context is NULL\n", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a: Firmware Context is NULL\n", __func__));
     return EFI_UNSUPPORTED;
   }
 
   FdtPointer = (VOID *)FirmwareContext->FlattenedDeviceTree;
   if (FdtPointer == NULL) {
-    DEBUG ((DEBUG_ERROR, "%a: Invalid FDT pointer\n", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a: Invalid FDT pointer\n", __func__));
     return EFI_UNSUPPORTED;
   }
 
@@ -306,7 +306,7 @@ MemoryPeimInitialization (
         DEBUG ((
           DEBUG_INFO,
           "%a: System RAM @ 0x%lx - 0x%lx\n",
-          __FUNCTION__,
+          __func__,
           CurBase,
           CurBase + CurSize - 1
           ));
@@ -319,7 +319,7 @@ MemoryPeimInitialization (
         DEBUG ((
           DEBUG_ERROR,
           "%a: Failed to parse FDT memory node\n",
-          __FUNCTION__
+          __func__
           ));
       }
     }
diff --git a/OvmfPkg/RiscVVirt/Sec/Platform.c b/OvmfPkg/RiscVVirt/Sec/Platform.c
index e8fd126cf800..3645c27b0b12 100644
--- a/OvmfPkg/RiscVVirt/Sec/Platform.c
+++ b/OvmfPkg/RiscVVirt/Sec/Platform.c
@@ -43,20 +43,20 @@ PlatformPeimInitialization (
   GetFirmwareContextPointer (&FirmwareContext);
 
   if (FirmwareContext == NULL) {
-    DEBUG ((DEBUG_ERROR, "%a: Firmware Context is NULL\n", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a: Firmware Context is NULL\n", __func__));
     return EFI_UNSUPPORTED;
   }
 
   FdtPointer = (VOID *)FirmwareContext->FlattenedDeviceTree;
   if (FdtPointer == NULL) {
-    DEBUG ((DEBUG_ERROR, "%a: Invalid FDT pointer\n", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a: Invalid FDT pointer\n", __func__));
     return EFI_UNSUPPORTED;
   }
 
-  DEBUG ((DEBUG_INFO, "%a: Build FDT HOB - FDT at address: 0x%x \n", __FUNCTION__, FdtPointer));
+  DEBUG ((DEBUG_INFO, "%a: Build FDT HOB - FDT at address: 0x%x \n", __func__, FdtPointer));
   Base = FdtPointer;
   if (fdt_check_header (Base) != 0) {
-    DEBUG ((DEBUG_ERROR, "%a: Corrupted DTB\n", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a: Corrupted DTB\n", __func__));
     return EFI_UNSUPPORTED;
   }
 
@@ -64,7 +64,7 @@ PlatformPeimInitialization (
   FdtPages = EFI_SIZE_TO_PAGES (FdtSize);
   NewBase  = AllocatePages (FdtPages);
   if (NewBase == NULL) {
-    DEBUG ((DEBUG_ERROR, "%a: Could not allocate memory for DTB\n", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a: Could not allocate memory for DTB\n", __func__));
     return EFI_UNSUPPORTED;
   }
 
@@ -72,7 +72,7 @@ PlatformPeimInitialization (
 
   FdtHobData = BuildGuidHob (&gFdtHobGuid, sizeof *FdtHobData);
   if (FdtHobData == NULL) {
-    DEBUG ((DEBUG_ERROR, "%a: Could not build FDT Hob\n", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a: Could not build FDT Hob\n", __func__));
     return EFI_UNSUPPORTED;
   }
 
diff --git a/OvmfPkg/RiscVVirt/Sec/SecMain.c b/OvmfPkg/RiscVVirt/Sec/SecMain.c
index adf73f2eb66c..b0520481782e 100644
--- a/OvmfPkg/RiscVVirt/Sec/SecMain.c
+++ b/OvmfPkg/RiscVVirt/Sec/SecMain.c
@@ -63,7 +63,7 @@ SecStartup (
   DEBUG ((
     DEBUG_INFO,
     "%a() BootHartId: 0x%x, DeviceTreeAddress=0x%x\n",
-    __FUNCTION__,
+    __func__,
     BootHartId,
     DeviceTreeAddress
     ));
diff --git a/OvmfPkg/Sec/SecMain.c b/OvmfPkg/Sec/SecMain.c
index e96726d6eca8..31da5d0ace51 100644
--- a/OvmfPkg/Sec/SecMain.c
+++ b/OvmfPkg/Sec/SecMain.c
@@ -386,7 +386,7 @@ DecompressMemFvs (
     DEBUG_VERBOSE,
     "%a: OutputBuffer@%p+0x%x ScratchBuffer@%p+0x%x "
     "PcdOvmfDecompressionScratchEnd=0x%x\n",
-    __FUNCTION__,
+    __func__,
     OutputBuffer,
     OutputBufferSize,
     ScratchBuffer,
diff --git a/OvmfPkg/SmmAccess/SmmAccessPei.c b/OvmfPkg/SmmAccess/SmmAccessPei.c
index 4be5f2423e17..0e57b7804cb2 100644
--- a/OvmfPkg/SmmAccess/SmmAccessPei.c
+++ b/OvmfPkg/SmmAccess/SmmAccessPei.c
@@ -263,7 +263,7 @@ SmmAccessPeiEntryPoint (
       DEBUG_ERROR,
       "%a: no SMRAM with host bridge DID=0x%04x; only "
       "DID=0x%04x (Q35) is supported\n",
-      __FUNCTION__,
+      __func__,
       HostBridgeDevId,
       INTEL_Q35_MCH_DEVICE_ID
       ));
@@ -283,7 +283,7 @@ SmmAccessPeiEntryPoint (
     DEBUG ((
       DEBUG_ERROR,
       "%a: this Q35 implementation lacks SMRAM\n",
-      __FUNCTION__
+      __func__
       ));
     goto WrongConfig;
   }
@@ -378,7 +378,7 @@ SmmAccessPeiEntryPoint (
     DEBUG ((
       DEBUG_VERBOSE,
       "%a: SMRAM map follows, %d entries\n",
-      __FUNCTION__,
+      __func__,
       (INT32)Count
       ));
     DEBUG ((
diff --git a/OvmfPkg/SmmControl2Dxe/SmiFeatures.c b/OvmfPkg/SmmControl2Dxe/SmiFeatures.c
index daeb7195aee7..4bd24bf11903 100644
--- a/OvmfPkg/SmmControl2Dxe/SmiFeatures.c
+++ b/OvmfPkg/SmmControl2Dxe/SmiFeatures.c
@@ -113,7 +113,7 @@ NegotiateSmiFeatures (
     DEBUG ((
       DEBUG_INFO,
       "%a: SMI feature negotiation unavailable\n",
-      __FUNCTION__
+      __func__
       ));
     return FALSE;
   }
@@ -129,7 +129,7 @@ NegotiateSmiFeatures (
     DEBUG ((
       DEBUG_ERROR,
       "%a: size mismatch in feature negotiation\n",
-      __FUNCTION__
+      __func__
       ));
     goto FatalError;
   }
@@ -168,7 +168,7 @@ NegotiateSmiFeatures (
     DEBUG ((
       DEBUG_ERROR,
       "%a: negotiation failed for feature bitmap 0x%Lx\n",
-      __FUNCTION__,
+      __func__,
       mSmiFeatures
       ));
     goto FatalError;
@@ -179,7 +179,7 @@ NegotiateSmiFeatures (
     // If we can't get broadcast SMIs from QEMU, that's acceptable too,
     // although not optimal.
     //
-    DEBUG ((DEBUG_INFO, "%a: SMI broadcast unavailable\n", __FUNCTION__));
+    DEBUG ((DEBUG_INFO, "%a: SMI broadcast unavailable\n", __func__));
   } else {
     //
     // Configure the traditional AP sync / SMI delivery mode for
@@ -192,31 +192,31 @@ NegotiateSmiFeatures (
       DEBUG ((
         DEBUG_ERROR,
         "%a: PiSmmCpuDxeSmm PCD configuration failed\n",
-        __FUNCTION__
+        __func__
         ));
       goto FatalError;
     }
 
-    DEBUG ((DEBUG_INFO, "%a: using SMI broadcast\n", __FUNCTION__));
+    DEBUG ((DEBUG_INFO, "%a: using SMI broadcast\n", __func__));
   }
 
   if ((mSmiFeatures & ICH9_LPC_SMI_F_CPU_HOTPLUG) == 0) {
-    DEBUG ((DEBUG_INFO, "%a: CPU hotplug not negotiated\n", __FUNCTION__));
+    DEBUG ((DEBUG_INFO, "%a: CPU hotplug not negotiated\n", __func__));
   } else {
     DEBUG ((
       DEBUG_INFO,
       "%a: CPU hotplug with SMI negotiated\n",
-      __FUNCTION__
+      __func__
       ));
   }
 
   if ((mSmiFeatures & ICH9_LPC_SMI_F_CPU_HOT_UNPLUG) == 0) {
-    DEBUG ((DEBUG_INFO, "%a: CPU hot-unplug not negotiated\n", __FUNCTION__));
+    DEBUG ((DEBUG_INFO, "%a: CPU hot-unplug not negotiated\n", __func__));
   } else {
     DEBUG ((
       DEBUG_INFO,
       "%a: CPU hot-unplug with SMI negotiated\n",
-      __FUNCTION__
+      __func__
       ));
   }
 
@@ -292,7 +292,7 @@ AppendFwCfgBootScript (
   DEBUG ((
     DEBUG_VERBOSE,
     "%a: SMI feature negotiation boot script saved\n",
-    __FUNCTION__
+    __func__
     ));
   return;
 
diff --git a/OvmfPkg/SmmControl2Dxe/SmmControl2Dxe.c b/OvmfPkg/SmmControl2Dxe/SmmControl2Dxe.c
index edbf8ac431e4..e7438b18ddcb 100644
--- a/OvmfPkg/SmmControl2Dxe/SmmControl2Dxe.c
+++ b/OvmfPkg/SmmControl2Dxe/SmmControl2Dxe.c
@@ -205,7 +205,7 @@ SmmControl2DxeEntryPoint (
     DEBUG ((
       DEBUG_ERROR,
       "%a: this Q35 implementation lacks SMI\n",
-      __FUNCTION__
+      __func__
       ));
     goto FatalError;
   }
@@ -234,7 +234,7 @@ SmmControl2DxeEntryPoint (
     DEBUG ((
       DEBUG_ERROR,
       "%a: failed to lock down GBL_SMI_EN\n",
-      __FUNCTION__
+      __func__
       ));
     goto FatalError;
   }
@@ -260,7 +260,7 @@ SmmControl2DxeEntryPoint (
                     &mS3SaveStateInstalled
                     );
     if (EFI_ERROR (Status)) {
-      DEBUG ((DEBUG_ERROR, "%a: CreateEvent: %r\n", __FUNCTION__, Status));
+      DEBUG ((DEBUG_ERROR, "%a: CreateEvent: %r\n", __func__, Status));
       goto FatalError;
     }
 
@@ -273,7 +273,7 @@ SmmControl2DxeEntryPoint (
       DEBUG ((
         DEBUG_ERROR,
         "%a: RegisterProtocolNotify: %r\n",
-        __FUNCTION__,
+        __func__,
         Status
         ));
       goto ReleaseEvent;
@@ -284,7 +284,7 @@ SmmControl2DxeEntryPoint (
     //
     Status = gBS->SignalEvent (mS3SaveStateInstalled);
     if (EFI_ERROR (Status)) {
-      DEBUG ((DEBUG_ERROR, "%a: SignalEvent: %r\n", __FUNCTION__, Status));
+      DEBUG ((DEBUG_ERROR, "%a: SignalEvent: %r\n", __func__, Status));
       goto ReleaseEvent;
     }
   }
@@ -303,7 +303,7 @@ SmmControl2DxeEntryPoint (
     DEBUG ((
       DEBUG_ERROR,
       "%a: InstallMultipleProtocolInterfaces: %r\n",
-      __FUNCTION__,
+      __func__,
       Status
       ));
     goto ReleaseEvent;
@@ -376,7 +376,7 @@ OnS3SaveStateInstalled (
     DEBUG ((
       DEBUG_ERROR,
       "%a: EFI_BOOT_SCRIPT_IO_READ_WRITE_OPCODE: %r\n",
-      __FUNCTION__,
+      __func__,
       Status
       ));
     ASSERT (FALSE);
@@ -400,14 +400,14 @@ OnS3SaveStateInstalled (
     DEBUG ((
       DEBUG_ERROR,
       "%a: EFI_BOOT_SCRIPT_PCI_CONFIG_READ_WRITE_OPCODE: %r\n",
-      __FUNCTION__,
+      __func__,
       Status
       ));
     ASSERT (FALSE);
     CpuDeadLoop ();
   }
 
-  DEBUG ((DEBUG_VERBOSE, "%a: chipset boot script saved\n", __FUNCTION__));
+  DEBUG ((DEBUG_VERBOSE, "%a: chipset boot script saved\n", __func__));
 
   //
   // Append a boot script fragment that re-selects the negotiated SMI features.
diff --git a/OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPeim.c b/OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPeim.c
index 96771b193595..65bb1a92684e 100644
--- a/OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPeim.c
+++ b/OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPeim.c
@@ -49,11 +49,11 @@ Tcg2ConfigPeimEntryPoint (
   UINTN       Size;
   EFI_STATUS  Status;
 
-  DEBUG ((DEBUG_INFO, "%a\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a\n", __func__));
 
   Status = InternalTpm12Detect ();
   if (!EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_INFO, "%a: TPM1.2 detected\n", __FUNCTION__));
+    DEBUG ((DEBUG_INFO, "%a: TPM1.2 detected\n", __func__));
     Size   = sizeof (gEfiTpmDeviceInstanceTpm12Guid);
     Status = PcdSetPtrS (
                PcdTpmInstanceGuid,
@@ -64,7 +64,7 @@ Tcg2ConfigPeimEntryPoint (
   } else {
     Status = Tpm2RequestUseTpm ();
     if (!EFI_ERROR (Status)) {
-      DEBUG ((DEBUG_INFO, "%a: TPM2 detected\n", __FUNCTION__));
+      DEBUG ((DEBUG_INFO, "%a: TPM2 detected\n", __func__));
       Size   = sizeof (gEfiTpmDeviceInstanceTpm20DtpmGuid);
       Status = PcdSetPtrS (
                  PcdTpmInstanceGuid,
@@ -73,7 +73,7 @@ Tcg2ConfigPeimEntryPoint (
                  );
       ASSERT_EFI_ERROR (Status);
     } else {
-      DEBUG ((DEBUG_INFO, "%a: no TPM detected\n", __FUNCTION__));
+      DEBUG ((DEBUG_INFO, "%a: no TPM detected\n", __func__));
       //
       // If no TPM2 was detected, we still need to install
       // TpmInitializationDonePpi. Namely, Tcg2Pei will exit early upon seeing
diff --git a/OvmfPkg/Tcg/TpmMmioSevDecryptPei/TpmMmioSevDecryptPeim.c b/OvmfPkg/Tcg/TpmMmioSevDecryptPei/TpmMmioSevDecryptPeim.c
index 88bb9e8e042b..c671aa21ea6c 100644
--- a/OvmfPkg/Tcg/TpmMmioSevDecryptPei/TpmMmioSevDecryptPeim.c
+++ b/OvmfPkg/Tcg/TpmMmioSevDecryptPei/TpmMmioSevDecryptPeim.c
@@ -38,7 +38,7 @@ TpmMmioSevDecryptPeimEntryPoint (
   RETURN_STATUS  DecryptStatus;
   EFI_STATUS     Status;
 
-  DEBUG ((DEBUG_INFO, "%a\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a\n", __func__));
 
   //
   // If SEV is active, MMIO succeeds against an encrypted physical address
@@ -60,7 +60,7 @@ TpmMmioSevDecryptPeimEntryPoint (
     DEBUG ((
       DEBUG_INFO,
       "%a: mapping TPM MMIO address range unencrypted\n",
-      __FUNCTION__
+      __func__
       ));
 
     DecryptStatus = MemEncryptSevClearMmioPageEncMask (
@@ -73,7 +73,7 @@ TpmMmioSevDecryptPeimEntryPoint (
       DEBUG ((
         DEBUG_ERROR,
         "%a: failed to map TPM MMIO address range unencrypted\n",
-        __FUNCTION__
+        __func__
         ));
       ASSERT_RETURN_ERROR (DecryptStatus);
     }
diff --git a/OvmfPkg/TdxDxe/TdxAcpiTable.c b/OvmfPkg/TdxDxe/TdxAcpiTable.c
index 8a1abe8b1d89..5dc27e23ad71 100644
--- a/OvmfPkg/TdxDxe/TdxAcpiTable.c
+++ b/OvmfPkg/TdxDxe/TdxAcpiTable.c
@@ -175,7 +175,7 @@ AlterAcpiTable (
       NewMadtTableLength = Table->Length + sizeof (EFI_ACPI_6_4_MULTIPROCESSOR_WAKEUP_STRUCTURE);
       NewMadtTable       = AllocatePool (NewMadtTableLength);
       if (NewMadtTable == NULL) {
-        DEBUG ((DEBUG_ERROR, "%a: OUT_OF_SOURCES error.\n", __FUNCTION__));
+        DEBUG ((DEBUG_ERROR, "%a: OUT_OF_SOURCES error.\n", __func__));
         break;
       }
 
diff --git a/OvmfPkg/VirtNorFlashDxe/VirtNorFlashDxe.c b/OvmfPkg/VirtNorFlashDxe/VirtNorFlashDxe.c
index f9a41f6aab0f..6b9ef261335e 100644
--- a/OvmfPkg/VirtNorFlashDxe/VirtNorFlashDxe.c
+++ b/OvmfPkg/VirtNorFlashDxe/VirtNorFlashDxe.c
@@ -422,11 +422,11 @@ NorFlashFvbInitialize (
   // Install the Default FVB header if required
   if (EFI_ERROR (Status)) {
     // There is no valid header, so time to install one.
-    DEBUG ((DEBUG_INFO, "%a: The FVB Header is not valid.\n", __FUNCTION__));
+    DEBUG ((DEBUG_INFO, "%a: The FVB Header is not valid.\n", __func__));
     DEBUG ((
       DEBUG_INFO,
       "%a: Installing a correct one for this volume.\n",
-      __FUNCTION__
+      __func__
       ));
 
     // Erase all the NorFlash that is reserved for variable storage
diff --git a/OvmfPkg/VirtNorFlashDxe/VirtNorFlashFvb.c b/OvmfPkg/VirtNorFlashDxe/VirtNorFlashFvb.c
index cc5eefaaf352..5ee98e9b595a 100644
--- a/OvmfPkg/VirtNorFlashDxe/VirtNorFlashFvb.c
+++ b/OvmfPkg/VirtNorFlashDxe/VirtNorFlashFvb.c
@@ -74,7 +74,7 @@ InitializeFvAndVariableStoreHeaders (
     DEBUG ((
       DEBUG_ERROR,
       "%a: NvStorageFtwWorkingBase is not contiguous with NvStorageVariableBase region\n",
-      __FUNCTION__
+      __func__
       ));
     return EFI_INVALID_PARAMETER;
   }
@@ -83,7 +83,7 @@ InitializeFvAndVariableStoreHeaders (
     DEBUG ((
       DEBUG_ERROR,
       "%a: NvStorageFtwSpareBase is not contiguous with NvStorageFtwWorkingBase region\n",
-      __FUNCTION__
+      __func__
       ));
     return EFI_INVALID_PARAMETER;
   }
@@ -93,7 +93,7 @@ InitializeFvAndVariableStoreHeaders (
     DEBUG ((
       DEBUG_ERROR,
       "%a: NvStorageVariableSize is 0x%x, should be atleast one block size\n",
-      __FUNCTION__,
+      __func__,
       NvStorageVariableSize
       ));
     return EFI_INVALID_PARAMETER;
@@ -103,7 +103,7 @@ InitializeFvAndVariableStoreHeaders (
     DEBUG ((
       DEBUG_ERROR,
       "%a: NvStorageFtwWorkingSize is 0x%x, should be atleast one block size\n",
-      __FUNCTION__,
+      __func__,
       NvStorageFtwWorkingSize
       ));
     return EFI_INVALID_PARAMETER;
@@ -113,7 +113,7 @@ InitializeFvAndVariableStoreHeaders (
     DEBUG ((
       DEBUG_ERROR,
       "%a: NvStorageFtwSpareSize is 0x%x, should be atleast one block size\n",
-      __FUNCTION__,
+      __func__,
       NvStorageFtwSpareSize
       ));
     return EFI_INVALID_PARAMETER;
@@ -124,7 +124,7 @@ InitializeFvAndVariableStoreHeaders (
       (NvStorageFtwWorkingBase % Instance->BlockSize != 0) ||
       (NvStorageFtwSpareBase % Instance->BlockSize != 0))
   {
-    DEBUG ((DEBUG_ERROR, "%a: NvStorage Base addresses must be aligned to block size boundaries", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a: NvStorage Base addresses must be aligned to block size boundaries", __func__));
     return EFI_INVALID_PARAMETER;
   }
 
@@ -209,7 +209,7 @@ ValidateFvHeader (
     DEBUG ((
       DEBUG_INFO,
       "%a: No Firmware Volume header present\n",
-      __FUNCTION__
+      __func__
       ));
     return EFI_NOT_FOUND;
   }
@@ -219,7 +219,7 @@ ValidateFvHeader (
     DEBUG ((
       DEBUG_INFO,
       "%a: Firmware Volume Guid non-compatible\n",
-      __FUNCTION__
+      __func__
       ));
     return EFI_NOT_FOUND;
   }
@@ -230,7 +230,7 @@ ValidateFvHeader (
     DEBUG ((
       DEBUG_INFO,
       "%a: FV checksum is invalid (Checksum:0x%X)\n",
-      __FUNCTION__,
+      __func__,
       Checksum
       ));
     return EFI_NOT_FOUND;
@@ -245,7 +245,7 @@ ValidateFvHeader (
     DEBUG ((
       DEBUG_INFO,
       "%a: Variable Store Guid non-compatible\n",
-      __FUNCTION__
+      __func__
       ));
     return EFI_NOT_FOUND;
   }
@@ -255,7 +255,7 @@ ValidateFvHeader (
     DEBUG ((
       DEBUG_INFO,
       "%a: Variable Store Length does not match\n",
-      __FUNCTION__
+      __func__
       ));
     return EFI_NOT_FOUND;
   }
diff --git a/OvmfPkg/VirtioBlkDxe/VirtioBlk.c b/OvmfPkg/VirtioBlkDxe/VirtioBlk.c
index cc094cc4ddb8..74ed52f9da69 100644
--- a/OvmfPkg/VirtioBlkDxe/VirtioBlk.c
+++ b/OvmfPkg/VirtioBlkDxe/VirtioBlk.c
@@ -943,7 +943,7 @@ VirtioBlkInit (
   DEBUG ((
     DEBUG_INFO,
     "%a: LbaSize=0x%x[B] NumBlocks=0x%Lx[Lba]\n",
-    __FUNCTION__,
+    __func__,
     Dev->BlockIoMedia.BlockSize,
     Dev->BlockIoMedia.LastBlock + 1
     ));
@@ -958,14 +958,14 @@ VirtioBlkInit (
     DEBUG ((
       DEBUG_INFO,
       "%a: FirstAligned=0x%Lx[Lba] PhysBlkSize=0x%x[Lba]\n",
-      __FUNCTION__,
+      __func__,
       Dev->BlockIoMedia.LowestAlignedLba,
       Dev->BlockIoMedia.LogicalBlocksPerPhysicalBlock
       ));
     DEBUG ((
       DEBUG_INFO,
       "%a: OptimalTransferLengthGranularity=0x%x[Lba]\n",
-      __FUNCTION__,
+      __func__,
       Dev->BlockIoMedia.OptimalTransferLengthGranularity
       ));
   }
@@ -1037,7 +1037,7 @@ VirtioBlkExitBoot (
 {
   VBLK_DEV  *Dev;
 
-  DEBUG ((DEBUG_VERBOSE, "%a: Context=0x%p\n", __FUNCTION__, Context));
+  DEBUG ((DEBUG_VERBOSE, "%a: Context=0x%p\n", __func__, Context));
   //
   // Reset the device. This causes the hypervisor to forget about the virtio
   // ring.
diff --git a/OvmfPkg/VirtioFsDxe/FuseFlush.c b/OvmfPkg/VirtioFsDxe/FuseFlush.c
index ff5d6f3f5a88..26cc12087bd6 100644
--- a/OvmfPkg/VirtioFsDxe/FuseFlush.c
+++ b/OvmfPkg/VirtioFsDxe/FuseFlush.c
@@ -111,7 +111,7 @@ VirtioFsFuseFlush (
       DEBUG_ERROR,
       "%a: Label=\"%s\" NodeId=%Lu FuseHandle=%Lu "
       "Errno=%d\n",
-      __FUNCTION__,
+      __func__,
       VirtioFs->Label,
       NodeId,
       FuseHandle,
diff --git a/OvmfPkg/VirtioFsDxe/FuseFsync.c b/OvmfPkg/VirtioFsDxe/FuseFsync.c
index c537b064e60e..11a4ab4e7786 100644
--- a/OvmfPkg/VirtioFsDxe/FuseFsync.c
+++ b/OvmfPkg/VirtioFsDxe/FuseFsync.c
@@ -116,7 +116,7 @@ VirtioFsFuseFsyncFileOrDir (
       DEBUG_ERROR,
       "%a: Label=\"%s\" NodeId=%Lu FuseHandle=%Lu "
       "IsDir=%d Errno=%d\n",
-      __FUNCTION__,
+      __func__,
       VirtioFs->Label,
       NodeId,
       FuseHandle,
diff --git a/OvmfPkg/VirtioFsDxe/FuseGetAttr.c b/OvmfPkg/VirtioFsDxe/FuseGetAttr.c
index 1dc0349a55be..6f6e89c4fdc8 100644
--- a/OvmfPkg/VirtioFsDxe/FuseGetAttr.c
+++ b/OvmfPkg/VirtioFsDxe/FuseGetAttr.c
@@ -116,7 +116,7 @@ VirtioFsFuseGetAttr (
     DEBUG ((
       DEBUG_ERROR,
       "%a: Label=\"%s\" NodeId=%Lu Errno=%d\n",
-      __FUNCTION__,
+      __func__,
       VirtioFs->Label,
       NodeId,
       CommonResp.Error
diff --git a/OvmfPkg/VirtioFsDxe/FuseInit.c b/OvmfPkg/VirtioFsDxe/FuseInit.c
index d34fc05a50dd..590ef441ef3f 100644
--- a/OvmfPkg/VirtioFsDxe/FuseInit.c
+++ b/OvmfPkg/VirtioFsDxe/FuseInit.c
@@ -125,7 +125,7 @@ VirtioFsFuseInitSession (
       DEBUG ((
         DEBUG_ERROR,
         "%a: Label=\"%s\" Errno=%d\n",
-        __FUNCTION__,
+        __func__,
         VirtioFs->Label,
         CommonResp.Error
         ));
diff --git a/OvmfPkg/VirtioFsDxe/FuseLookup.c b/OvmfPkg/VirtioFsDxe/FuseLookup.c
index f2bda8a547ff..277a19fb1fda 100644
--- a/OvmfPkg/VirtioFsDxe/FuseLookup.c
+++ b/OvmfPkg/VirtioFsDxe/FuseLookup.c
@@ -128,7 +128,7 @@ VirtioFsFuseLookup (
          DEBUG_VERBOSE :
          DEBUG_ERROR),
         "%a: Label=\"%s\" DirNodeId=%Lu Name=\"%a\" Errno=%d\n",
-        __FUNCTION__,
+        __func__,
         VirtioFs->Label,
         DirNodeId,
         Name,
diff --git a/OvmfPkg/VirtioFsDxe/FuseMkDir.c b/OvmfPkg/VirtioFsDxe/FuseMkDir.c
index 409e09a41895..847d0c079870 100644
--- a/OvmfPkg/VirtioFsDxe/FuseMkDir.c
+++ b/OvmfPkg/VirtioFsDxe/FuseMkDir.c
@@ -127,7 +127,7 @@ VirtioFsFuseMkDir (
         DEBUG_ERROR,
         "%a: Label=\"%s\" ParentNodeId=%Lu Name=\"%a\" "
         "Errno=%d\n",
-        __FUNCTION__,
+        __func__,
         VirtioFs->Label,
         ParentNodeId,
         Name,
diff --git a/OvmfPkg/VirtioFsDxe/FuseOpen.c b/OvmfPkg/VirtioFsDxe/FuseOpen.c
index 64015bb6cc7f..99ea5f3b71b5 100644
--- a/OvmfPkg/VirtioFsDxe/FuseOpen.c
+++ b/OvmfPkg/VirtioFsDxe/FuseOpen.c
@@ -119,7 +119,7 @@ VirtioFsFuseOpen (
         DEBUG_ERROR,
         "%a: Label=\"%s\" NodeId=%Lu ReadWrite=%d "
         "Errno=%d\n",
-        __FUNCTION__,
+        __func__,
         VirtioFs->Label,
         NodeId,
         ReadWrite,
diff --git a/OvmfPkg/VirtioFsDxe/FuseOpenDir.c b/OvmfPkg/VirtioFsDxe/FuseOpenDir.c
index e49c046b9d47..11249ef0a83e 100644
--- a/OvmfPkg/VirtioFsDxe/FuseOpenDir.c
+++ b/OvmfPkg/VirtioFsDxe/FuseOpenDir.c
@@ -113,7 +113,7 @@ VirtioFsFuseOpenDir (
       DEBUG ((
         DEBUG_ERROR,
         "%a: Label=\"%s\" NodeId=%Lu Errno=%d\n",
-        __FUNCTION__,
+        __func__,
         VirtioFs->Label,
         NodeId,
         CommonResp.Error
diff --git a/OvmfPkg/VirtioFsDxe/FuseOpenOrCreate.c b/OvmfPkg/VirtioFsDxe/FuseOpenOrCreate.c
index 4d9846ab3b05..db586dc76d9b 100644
--- a/OvmfPkg/VirtioFsDxe/FuseOpenOrCreate.c
+++ b/OvmfPkg/VirtioFsDxe/FuseOpenOrCreate.c
@@ -146,7 +146,7 @@ VirtioFsFuseOpenOrCreate (
         DEBUG_ERROR,
         "%a: Label=\"%s\" ParentNodeId=%Lu Name=\"%a\" "
         "Errno=%d\n",
-        __FUNCTION__,
+        __func__,
         VirtioFs->Label,
         ParentNodeId,
         Name,
diff --git a/OvmfPkg/VirtioFsDxe/FuseRead.c b/OvmfPkg/VirtioFsDxe/FuseRead.c
index 013dac7e52f3..882d43304597 100644
--- a/OvmfPkg/VirtioFsDxe/FuseRead.c
+++ b/OvmfPkg/VirtioFsDxe/FuseRead.c
@@ -178,7 +178,7 @@ VirtioFsFuseReadFileOrDir (
         DEBUG_ERROR,
         "%a: Label=\"%s\" NodeId=%Lu FuseHandle=%Lu "
         "IsDir=%d Offset=0x%Lx Size=0x%x Data@%p Errno=%d\n",
-        __FUNCTION__,
+        __func__,
         VirtioFs->Label,
         NodeId,
         FuseHandle,
diff --git a/OvmfPkg/VirtioFsDxe/FuseRelease.c b/OvmfPkg/VirtioFsDxe/FuseRelease.c
index c8363158f5e7..75bb171a139e 100644
--- a/OvmfPkg/VirtioFsDxe/FuseRelease.c
+++ b/OvmfPkg/VirtioFsDxe/FuseRelease.c
@@ -116,7 +116,7 @@ VirtioFsFuseReleaseFileOrDir (
       DEBUG_ERROR,
       "%a: Label=\"%s\" NodeId=%Lu FuseHandle=%Lu "
       "IsDir=%d Errno=%d\n",
-      __FUNCTION__,
+      __func__,
       VirtioFs->Label,
       NodeId,
       FuseHandle,
diff --git a/OvmfPkg/VirtioFsDxe/FuseRename.c b/OvmfPkg/VirtioFsDxe/FuseRename.c
index a3a105050600..3ec536303776 100644
--- a/OvmfPkg/VirtioFsDxe/FuseRename.c
+++ b/OvmfPkg/VirtioFsDxe/FuseRename.c
@@ -130,7 +130,7 @@ VirtioFsFuseRename (
       DEBUG_ERROR,
       "%a: Label=\"%s\" OldParentNodeId=%Lu OldName=\"%a\" "
       "NewParentNodeId=%Lu NewName=\"%a\" Errno=%d\n",
-      __FUNCTION__,
+      __func__,
       VirtioFs->Label,
       OldParentNodeId,
       OldName,
diff --git a/OvmfPkg/VirtioFsDxe/FuseSetAttr.c b/OvmfPkg/VirtioFsDxe/FuseSetAttr.c
index 9d0ea93fd957..719584fa322a 100644
--- a/OvmfPkg/VirtioFsDxe/FuseSetAttr.c
+++ b/OvmfPkg/VirtioFsDxe/FuseSetAttr.c
@@ -164,7 +164,7 @@ VirtioFsFuseSetAttr (
     DEBUG ((
       DEBUG_ERROR,
       "%a: Label=\"%s\" NodeId=%Lu",
-      __FUNCTION__,
+      __func__,
       VirtioFs->Label,
       NodeId
       ));
diff --git a/OvmfPkg/VirtioFsDxe/FuseStatFs.c b/OvmfPkg/VirtioFsDxe/FuseStatFs.c
index d93a62080e47..55b4edc5b938 100644
--- a/OvmfPkg/VirtioFsDxe/FuseStatFs.c
+++ b/OvmfPkg/VirtioFsDxe/FuseStatFs.c
@@ -102,7 +102,7 @@ VirtioFsFuseStatFs (
     DEBUG ((
       DEBUG_ERROR,
       "%a: Label=\"%s\" NodeId=%Lu Errno=%d\n",
-      __FUNCTION__,
+      __func__,
       VirtioFs->Label,
       NodeId,
       CommonResp.Error
diff --git a/OvmfPkg/VirtioFsDxe/FuseUnlink.c b/OvmfPkg/VirtioFsDxe/FuseUnlink.c
index 14cbdec5f5b2..d83a175dc674 100644
--- a/OvmfPkg/VirtioFsDxe/FuseUnlink.c
+++ b/OvmfPkg/VirtioFsDxe/FuseUnlink.c
@@ -109,7 +109,7 @@ VirtioFsFuseRemoveFileOrDir (
       DEBUG_ERROR,
       "%a: Label=\"%s\" ParentNodeId=%Lu Name=\"%a\" "
       "IsDir=%d Errno=%d\n",
-      __FUNCTION__,
+      __func__,
       VirtioFs->Label,
       ParentNodeId,
       Name,
diff --git a/OvmfPkg/VirtioFsDxe/FuseWrite.c b/OvmfPkg/VirtioFsDxe/FuseWrite.c
index fe65c0bdbe41..98dbd6deccc3 100644
--- a/OvmfPkg/VirtioFsDxe/FuseWrite.c
+++ b/OvmfPkg/VirtioFsDxe/FuseWrite.c
@@ -147,7 +147,7 @@ VirtioFsFuseWrite (
         DEBUG_ERROR,
         "%a: Label=\"%s\" NodeId=%Lu FuseHandle=%Lu "
         "Offset=0x%Lx Size=0x%x Data@%p Errno=%d\n",
-        __FUNCTION__,
+        __func__,
         VirtioFs->Label,
         NodeId,
         FuseHandle,
diff --git a/OvmfPkg/VirtioFsDxe/Helpers.c b/OvmfPkg/VirtioFsDxe/Helpers.c
index f32fb1d48a3e..bc3c58cf41f9 100644
--- a/OvmfPkg/VirtioFsDxe/Helpers.c
+++ b/OvmfPkg/VirtioFsDxe/Helpers.c
@@ -320,7 +320,7 @@ VirtioFsExitBoot (
   DEBUG ((
     DEBUG_VERBOSE,
     "%a: VirtioFs=0x%p Label=\"%s\"\n",
-    __FUNCTION__,
+    __func__,
     VirtioFsAsVoid,
     VirtioFs->Label
     ));
diff --git a/OvmfPkg/VirtioFsDxe/SimpleFsOpen.c b/OvmfPkg/VirtioFsDxe/SimpleFsOpen.c
index d479f76f5bc3..a13d4f6a1e2d 100644
--- a/OvmfPkg/VirtioFsDxe/SimpleFsOpen.c
+++ b/OvmfPkg/VirtioFsDxe/SimpleFsOpen.c
@@ -378,7 +378,7 @@ VirtioFsSimpleFileOpen (
         ("%a: Label=\"%s\" CanonicalPathname=\"%a\" FileName=\"%s\" "
          "OpenMode=0x%Lx Attributes=0x%Lx: nonsensical request to possibly "
          "create a file marked read-only, for read-write access\n"),
-        __FUNCTION__,
+        __func__,
         VirtioFs->Label,
         VirtioFsFile->CanonicalPathname,
         FileName,
@@ -403,7 +403,7 @@ VirtioFsSimpleFileOpen (
       ("%a: Label=\"%s\" CanonicalPathname=\"%a\" FileName=\"%s\": "
        "nonsensical request to open a file or directory relative to a regular "
        "file\n"),
-      __FUNCTION__,
+      __func__,
       VirtioFs->Label,
       VirtioFsFile->CanonicalPathname,
       FileName
diff --git a/OvmfPkg/VirtioGpuDxe/Commands.c b/OvmfPkg/VirtioGpuDxe/Commands.c
index 4318d3d771c5..df79a5f8aff5 100644
--- a/OvmfPkg/VirtioGpuDxe/Commands.c
+++ b/OvmfPkg/VirtioGpuDxe/Commands.c
@@ -354,7 +354,7 @@ VirtioGpuExitBoot (
 {
   VGPU_DEV  *VgpuDev;
 
-  DEBUG ((DEBUG_VERBOSE, "%a: Context=0x%p\n", __FUNCTION__, Context));
+  DEBUG ((DEBUG_VERBOSE, "%a: Context=0x%p\n", __func__, Context));
   VgpuDev = Context;
   VgpuDev->VirtIo->SetDeviceStatus (VgpuDev->VirtIo, 0);
 }
@@ -516,7 +516,7 @@ VirtioGpuSendCommandWithReply (
     DEBUG ((
       DEBUG_ERROR,
       "%a: malformed response to Request=0x%x\n",
-      __FUNCTION__,
+      __func__,
       (UINT32)RequestType
       ));
     Status = EFI_PROTOCOL_ERROR;
@@ -548,7 +548,7 @@ VirtioGpuSendCommandWithReply (
   DEBUG ((
     DEBUG_ERROR,
     "%a: Request=0x%x Response=0x%x (expected 0x%x)\n",
-    __FUNCTION__,
+    __func__,
     (UINT32)RequestType,
     Response->Type,
     ResponseType
diff --git a/OvmfPkg/VirtioGpuDxe/DriverBinding.c b/OvmfPkg/VirtioGpuDxe/DriverBinding.c
index 21bf2babc8ef..80eac08f901b 100644
--- a/OvmfPkg/VirtioGpuDxe/DriverBinding.c
+++ b/OvmfPkg/VirtioGpuDxe/DriverBinding.c
@@ -816,7 +816,7 @@ VirtioGpuDriverBindingStart (
       DEBUG ((
         DEBUG_INFO,
         "%a: bound VirtIo=%p without producing GOP\n",
-        __FUNCTION__,
+        __func__,
         (VOID *)VgpuDev->VirtIo
         ));
       return EFI_SUCCESS;
@@ -848,7 +848,7 @@ VirtioGpuDriverBindingStart (
   DEBUG ((
     DEBUG_INFO,
     "%a: produced GOP %a VirtIo=%p\n",
-    __FUNCTION__,
+    __func__,
     VirtIoBoundJustNow ? "while binding" : "for pre-bound",
     (VOID *)VgpuDev->VirtIo
     ));
@@ -952,7 +952,7 @@ VirtioGpuDriverBindingStop (
       DEBUG ((
         DEBUG_INFO,
         "%a: unbinding GOP-less VirtIo=%p\n",
-        __FUNCTION__,
+        __func__,
         (VOID *)VgpuDev->VirtIo
         ));
 
@@ -1010,7 +1010,7 @@ VirtioGpuDriverBindingStop (
       DEBUG ((
         DEBUG_INFO,
         "%a: destroying GOP under VirtIo=%p\n",
-        __FUNCTION__,
+        __func__,
         (VOID *)VgpuDev->VirtIo
         ));
       UninitVgpuGop (VgpuDev, ControllerHandle, This->DriverBindingHandle);
diff --git a/OvmfPkg/VirtioGpuDxe/Gop.c b/OvmfPkg/VirtioGpuDxe/Gop.c
index 16e92830d411..f64dfce5f400 100644
--- a/OvmfPkg/VirtioGpuDxe/Gop.c
+++ b/OvmfPkg/VirtioGpuDxe/Gop.c
@@ -222,7 +222,7 @@ GopNativeResolution (
     DEBUG ((
       DEBUG_INFO,
       "%a: #%d: %dx%d\n",
-      __FUNCTION__,
+      __func__,
       Index,
       DisplayInfo.Pmodes[Index].Rectangle.Width,
       DisplayInfo.Pmodes[Index].Rectangle.Height
diff --git a/OvmfPkg/VirtioNetDxe/Events.c b/OvmfPkg/VirtioNetDxe/Events.c
index 4c93607a38cc..75a9644f749c 100644
--- a/OvmfPkg/VirtioNetDxe/Events.c
+++ b/OvmfPkg/VirtioNetDxe/Events.c
@@ -77,7 +77,7 @@ VirtioNetExitBoot (
   //
   VNET_DEV  *Dev;
 
-  DEBUG ((DEBUG_VERBOSE, "%a: Context=0x%p\n", __FUNCTION__, Context));
+  DEBUG ((DEBUG_VERBOSE, "%a: Context=0x%p\n", __func__, Context));
   Dev = Context;
   if (Dev->Snm.State == EfiSimpleNetworkInitialized) {
     Dev->VirtIo->SetDeviceStatus (Dev->VirtIo, 0);
diff --git a/OvmfPkg/VirtioRngDxe/VirtioRng.c b/OvmfPkg/VirtioRngDxe/VirtioRng.c
index aabc7230ab67..069aed148af1 100644
--- a/OvmfPkg/VirtioRngDxe/VirtioRng.c
+++ b/OvmfPkg/VirtioRngDxe/VirtioRng.c
@@ -435,7 +435,7 @@ VirtioRngExitBoot (
 {
   VIRTIO_RNG_DEV  *Dev;
 
-  DEBUG ((DEBUG_VERBOSE, "%a: Context=0x%p\n", __FUNCTION__, Context));
+  DEBUG ((DEBUG_VERBOSE, "%a: Context=0x%p\n", __func__, Context));
   //
   // Reset the device. This causes the hypervisor to forget about the virtio
   // ring.
diff --git a/OvmfPkg/VirtioScsiDxe/VirtioScsi.c b/OvmfPkg/VirtioScsiDxe/VirtioScsi.c
index d44f9ebca7db..3705f5fc14d5 100644
--- a/OvmfPkg/VirtioScsiDxe/VirtioScsi.c
+++ b/OvmfPkg/VirtioScsiDxe/VirtioScsi.c
@@ -1235,7 +1235,7 @@ VirtioScsiExitBoot (
 {
   VSCSI_DEV  *Dev;
 
-  DEBUG ((DEBUG_VERBOSE, "%a: Context=0x%p\n", __FUNCTION__, Context));
+  DEBUG ((DEBUG_VERBOSE, "%a: Context=0x%p\n", __func__, Context));
   //
   // Reset the device. This causes the hypervisor to forget about the virtio
   // ring.
diff --git a/OvmfPkg/XenAcpiPlatformDxe/Xen.c b/OvmfPkg/XenAcpiPlatformDxe/Xen.c
index cc2fa2cdcf8c..a80a24628c08 100644
--- a/OvmfPkg/XenAcpiPlatformDxe/Xen.c
+++ b/OvmfPkg/XenAcpiPlatformDxe/Xen.c
@@ -299,7 +299,7 @@ InstallXenTables (
   // then we're out of sync with the hypervisor, and cannot continue.
   //
   if (DsdtTable == NULL) {
-    DEBUG ((DEBUG_ERROR, "%a: no DSDT found\n", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a: no DSDT found\n", __func__));
     ASSERT (FALSE);
     CpuDeadLoop ();
   }
diff --git a/OvmfPkg/XenPlatformPei/ClearCache.c b/OvmfPkg/XenPlatformPei/ClearCache.c
index 71e63ab86871..a37d1d0c0a8e 100644
--- a/OvmfPkg/XenPlatformPei/ClearCache.c
+++ b/OvmfPkg/XenPlatformPei/ClearCache.c
@@ -60,7 +60,7 @@ ClearCacheOnMpServicesAvailable (
   EFI_PEI_MP_SERVICES_PPI  *MpServices;
   EFI_STATUS               Status;
 
-  DEBUG ((DEBUG_INFO, "%a: %a\n", gEfiCallerBaseName, __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a: %a\n", gEfiCallerBaseName, __func__));
 
   //
   // Clear cache on all the APs in parallel.
@@ -75,7 +75,7 @@ ClearCacheOnMpServicesAvailable (
                              NULL             // ProcedureArgument
                              );
   if (EFI_ERROR (Status) && (Status != EFI_NOT_STARTED)) {
-    DEBUG ((DEBUG_ERROR, "%a: StartupAllAps(): %r\n", __FUNCTION__, Status));
+    DEBUG ((DEBUG_ERROR, "%a: StartupAllAps(): %r\n", __func__, Status));
     return Status;
   }
 
@@ -109,7 +109,7 @@ InstallClearCacheCallback (
     DEBUG ((
       DEBUG_ERROR,
       "%a: failed to set up MP Services callback: %r\n",
-      __FUNCTION__,
+      __func__,
       Status
       ));
   }
diff --git a/OvmfPkg/XenPlatformPei/MemDetect.c b/OvmfPkg/XenPlatformPei/MemDetect.c
index d412d1f4db6f..e552e7a55e4f 100644
--- a/OvmfPkg/XenPlatformPei/MemDetect.c
+++ b/OvmfPkg/XenPlatformPei/MemDetect.c
@@ -54,7 +54,7 @@ Q35TsegMbytesInitialization (
       DEBUG_ERROR,
       "%a: no TSEG (SMRAM) on host bridge DID=0x%04x; "
       "only DID=0x%04x (Q35) is supported\n",
-      __FUNCTION__,
+      __func__,
       mHostBridgeDevId,
       INTEL_Q35_MCH_DEVICE_ID
       ));
@@ -88,7 +88,7 @@ Q35TsegMbytesInitialization (
   DEBUG ((
     DEBUG_INFO,
     "%a: QEMU offers an extended TSEG (%d MB)\n",
-    __FUNCTION__,
+    __func__,
     ExtendedTsegMbytes
     ));
   PcdStatus = PcdSet16S (PcdQ35TsegMbytes, ExtendedTsegMbytes);
@@ -291,7 +291,7 @@ PublishPeiMemory (
     DEBUG ((
       DEBUG_INFO,
       "%a: mPhysMemAddressWidth=%d PeiMemoryCap=%u KB\n",
-      __FUNCTION__,
+      __func__,
       mPhysMemAddressWidth,
       PeiMemoryCap >> 10
       ));
diff --git a/OvmfPkg/XenPlatformPei/Platform.c b/OvmfPkg/XenPlatformPei/Platform.c
index 6c1886c158b5..c3fdf3d0b8a6 100644
--- a/OvmfPkg/XenPlatformPei/Platform.c
+++ b/OvmfPkg/XenPlatformPei/Platform.c
@@ -292,7 +292,7 @@ MiscInitialization (
       DEBUG ((
         DEBUG_ERROR,
         "%a: Unknown Host Bridge Device ID: 0x%04x\n",
-        __FUNCTION__,
+        __func__,
         mHostBridgeDevId
         ));
       ASSERT (FALSE);
diff --git a/OvmfPkg/XenPvBlkDxe/BlockFront.c b/OvmfPkg/XenPvBlkDxe/BlockFront.c
index 1827cc58e390..5a3ad5e4e579 100644
--- a/OvmfPkg/XenPvBlkDxe/BlockFront.c
+++ b/OvmfPkg/XenPvBlkDxe/BlockFront.c
@@ -187,13 +187,13 @@ XenPvBlockFrontInitialization (
   if (Dev->MediaInfo.CdRom) {
     Status = XenBusIo->XsBackendRead (XenBusIo, XST_NIL, "params", (VOID **)&Params);
     if (Status != XENSTORE_STATUS_SUCCESS) {
-      DEBUG ((DEBUG_ERROR, "%a: Failed to read params (%d)\n", __FUNCTION__, Status));
+      DEBUG ((DEBUG_ERROR, "%a: Failed to read params (%d)\n", __func__, Status));
       goto Error;
     }
 
     if ((AsciiStrLen (Params) == 0) || (AsciiStrCmp (Params, "aio:") == 0)) {
       FreePool (Params);
-      DEBUG ((DEBUG_INFO, "%a: Empty cdrom\n", __FUNCTION__));
+      DEBUG ((DEBUG_INFO, "%a: Empty cdrom\n", __func__));
       goto Error;
     }
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 05/18] MdeModulePkg: Update code to be more C11 compliant by using __func__
  2023-04-06 22:23 [PATCH 00/18] Replace pre-standard macro __FUNCTION__ with C99 __func__ throughout edk2 Rebecca Cran
                   ` (3 preceding siblings ...)
  2023-04-06 22:23 ` [PATCH 04/18] OvmfPkg: " Rebecca Cran
@ 2023-04-06 22:23 ` Rebecca Cran
  2023-04-06 22:23 ` [PATCH 06/18] SecurityPkg: " Rebecca Cran
                   ` (15 subsequent siblings)
  20 siblings, 0 replies; 34+ messages in thread
From: Rebecca Cran @ 2023-04-06 22:23 UTC (permalink / raw)
  To: devel, Liming Gao, Michael D Kinney, Guomin Jiang, Wei6 Xu,
	Guo Dong, Ray Ni, Sean Rhodes, James Lu, Gua Guo, Andrew Fish,
	Hao A Wu, Maciej Rabeda, Siyuan Fu, Jiewen Yao, Jian J Wang,
	Xiaoyu Lu, Ard Biesheuvel, Sami Mujawar, Supreeth Venkatesh,
	Michael Kubacki, Nate DeSimone, Sean Brogan
  Cc: Rebecca Cran, Leif Lindholm, Abner Chang, Nickle Wang,
	Igor Kulchytskyy, Daniel Schaefer, Min Xu, Jordan Justen,
	Gerd Hoffmann, Peter Grehan, Erdem Aktas, James Bottomley,
	Tom Lendacky, Michael Roth, Sunil V L, Andrei Warkentin

__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.

Visual Studio versions before VS 2015 don't support __func__ and so
will fail to compile. A workaround is to define __func__ as
__FUNCTION__ :

  #define __func__ __FUNCTION__

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
---
 MdeModulePkg/Bus/Ata/AhciPei/AhciMode.c                                       | 38 ++++++++++----------
 MdeModulePkg/Bus/Ata/AhciPei/AhciPei.c                                        | 18 +++++-----
 MdeModulePkg/Bus/Ata/AhciPei/AhciPeiBlockIo.c                                 |  2 +-
 MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c                                           |  2 +-
 MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.c                                      |  4 +--
 MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceIo.c |  2 +-
 MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressBlockIo.c                        |  8 ++---
 MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPei.c                            | 36 +++++++++----------
 MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPeiBlockIo.c                     |  6 ++--
 MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPeiHci.c                         | 34 +++++++++---------
 MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPeiPassThru.c                    | 24 ++++++-------
 MdeModulePkg/Bus/Pci/PciBusDxe/PciCommand.c                                   |  2 +-
 MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridge.c                         | 14 ++++----
 MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c                            |  6 ++--
 MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c                              | 12 +++----
 MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c                                           |  2 +-
 MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c                                      |  4 +--
 MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c                                  |  6 ++--
 MdeModulePkg/Core/Dxe/Dispatcher/Dispatcher.c                                 |  2 +-
 MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c                                       |  2 +-
 MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c                                 |  6 ++--
 MdeModulePkg/Core/Dxe/SectionExtraction/CoreSectionExtraction.c               |  2 +-
 MdeModulePkg/Core/DxeIplPeim/Ia32/DxeLoadFunc.c                               |  4 +--
 MdeModulePkg/Core/DxeIplPeim/RiscV64/DxeLoadFunc.c                            |  4 +--
 MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c                                 |  2 +-
 MdeModulePkg/Core/Pei/FwVol/FwVol.c                                           |  2 +-
 MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleReportLib.c                   |  2 +-
 MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c                    |  2 +-
 MdeModulePkg/Library/ResetUtilityLib/ResetUtility.c                           |  2 +-
 MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c                              |  2 +-
 MdeModulePkg/Library/UefiBootManagerLib/BmDriverHealth.c                      |  2 +-
 MdeModulePkg/Library/VarCheckPolicyLib/VarCheckPolicyLib.c                    | 22 ++++++------
 MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLib.c                    |  6 ++--
 MdeModulePkg/Universal/CapsulePei/UefiCapsule.c                               |  8 ++---
 MdeModulePkg/Universal/CapsulePei/X64/X64Entry.c                              |  2 +-
 MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c                                | 10 +++---
 MdeModulePkg/Universal/Disk/UdfDxe/File.c                                     |  2 +-
 MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c                     |  2 +-
 MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWrite.c             |  6 ++--
 MdeModulePkg/Universal/FaultTolerantWriteDxe/FtwMisc.c                        |  2 +-
 MdeModulePkg/Universal/PCD/Dxe/Service.c                                      |  2 +-
 MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.c                                  |  4 +--
 MdeModulePkg/Universal/Variable/RuntimeDxe/TcgMorLockDxe.c                    |  6 ++--
 MdeModulePkg/Universal/Variable/RuntimeDxe/TcgMorLockSmm.c                    |  6 ++--
 MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c                         |  6 ++--
 MdeModulePkg/Universal/Variable/RuntimeDxe/VariableLockRequestToLock.c        |  4 +--
 MdeModulePkg/Universal/Variable/RuntimeDxe/VariablePolicySmmDxe.c             | 20 +++++------
 47 files changed, 181 insertions(+), 181 deletions(-)

diff --git a/MdeModulePkg/Bus/Ata/AhciPei/AhciMode.c b/MdeModulePkg/Bus/Ata/AhciPei/AhciMode.c
index 0f0198d3085b..92fb30638ec9 100644
--- a/MdeModulePkg/Bus/Ata/AhciPei/AhciMode.c
+++ b/MdeModulePkg/Bus/Ata/AhciPei/AhciMode.c
@@ -759,7 +759,7 @@ AhciPioTransfer (
       DEBUG_ERROR,
       "%a: Driver only support a maximum of 0x%x PRDT entries, "
       "current number of data byte 0x%x is too large, maximum allowed is 0x%x.\n",
-      __FUNCTION__,
+      __func__,
       AHCI_MAX_PRDT_NUMBER,
       DataCount,
       AHCI_MAX_PRDT_NUMBER * AHCI_MAX_DATA_PER_PRDT
@@ -778,7 +778,7 @@ AhciPioTransfer (
                 &MapData
                 );
   if (EFI_ERROR (Status) || (MapLength != DataCount)) {
-    DEBUG ((DEBUG_ERROR, "%a: Fail to map data buffer.\n", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a: Fail to map data buffer.\n", __func__));
     return EFI_OUT_OF_RESOURCES;
   }
 
@@ -860,7 +860,7 @@ AhciPioTransfer (
       Offset         = FisBaseAddr + AHCI_PIO_FIS_OFFSET;
       Status         = AhciCheckMemSet (Offset, AHCI_FIS_TYPE_MASK, AHCI_FIS_PIO_SETUP);
       if (!EFI_ERROR (Status)) {
-        DEBUG ((DEBUG_INFO, "%a: PioFisReceived.\n", __FUNCTION__));
+        DEBUG ((DEBUG_INFO, "%a: PioFisReceived.\n", __func__));
         PioFisReceived = TRUE;
       }
 
@@ -874,7 +874,7 @@ AhciPioTransfer (
       Offset = FisBaseAddr + AHCI_D2H_FIS_OFFSET;
       Status = AhciCheckMemSet (Offset, AHCI_FIS_TYPE_MASK, AHCI_FIS_REGISTER_D2H);
       if (!EFI_ERROR (Status)) {
-        DEBUG ((DEBUG_INFO, "%a: D2hFisReceived.\n", __FUNCTION__));
+        DEBUG ((DEBUG_INFO, "%a: D2hFisReceived.\n", __func__));
         D2hFisReceived = TRUE;
       }
 
@@ -918,7 +918,7 @@ AhciPioTransfer (
                Timeout
                );
     if (EFI_ERROR (Status)) {
-      DEBUG ((DEBUG_ERROR, "%a: AhciWaitMemSet (%r)\n", __FUNCTION__, Status));
+      DEBUG ((DEBUG_ERROR, "%a: AhciWaitMemSet (%r)\n", __func__, Status));
       goto Exit;
     }
 
@@ -1479,7 +1479,7 @@ IdentifyAtaDevice (
     DEBUG ((
       DEBUG_ERROR,
       "%a: Not a hard disk device on Port 0x%x PortMultiplierPort 0x%x\n",
-      __FUNCTION__,
+      __func__,
       DeviceData->Port,
       DeviceData->PortMultiplier
       ));
@@ -1489,7 +1489,7 @@ IdentifyAtaDevice (
   DEBUG ((
     DEBUG_INFO,
     "%a: Identify Device: Port 0x%x PortMultiplierPort 0x%x\n",
-    __FUNCTION__,
+    __func__,
     DeviceData->Port,
     DeviceData->PortMultiplier
     ));
@@ -1518,7 +1518,7 @@ IdentifyAtaDevice (
   }
 
   if (Capacity == 0) {
-    DEBUG ((DEBUG_ERROR, "%a: Invalid Capacity (0) for ATA device.\n", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a: Invalid Capacity (0) for ATA device.\n", __func__));
     return EFI_UNSUPPORTED;
   }
 
@@ -1532,7 +1532,7 @@ IdentifyAtaDevice (
   DEBUG ((
     DEBUG_INFO,
     "%a: PhyLogicSectorSupport = 0x%x\n",
-    __FUNCTION__,
+    __func__,
     PhyLogicSectorSupport
     ));
   if ((PhyLogicSectorSupport & (BIT14 | BIT15)) == BIT14) {
@@ -1550,20 +1550,20 @@ IdentifyAtaDevice (
   //
   MaxSectorCount = mMaxTransferBlockNumber[DeviceData->Lba48Bit];
   if ((Media->BlockSize == 0) || (Media->BlockSize > MAX_UINT32 / MaxSectorCount)) {
-    DEBUG ((DEBUG_ERROR, "%a: Invalid BlockSize (0x%x).\n", __FUNCTION__, Media->BlockSize));
+    DEBUG ((DEBUG_ERROR, "%a: Invalid BlockSize (0x%x).\n", __func__, Media->BlockSize));
     return EFI_UNSUPPORTED;
   }
 
   DEBUG ((
     DEBUG_INFO,
     "%a: BlockSize = 0x%x, LastBlock = 0x%lx\n",
-    __FUNCTION__,
+    __func__,
     Media->BlockSize,
     Media->LastBlock
     ));
 
   if ((IdentifyData->trusted_computing_support & BIT0) != 0) {
-    DEBUG ((DEBUG_INFO, "%a: Found Trust Computing feature support.\n", __FUNCTION__));
+    DEBUG ((DEBUG_INFO, "%a: Found Trust Computing feature support.\n", __func__));
     DeviceData->TrustComputing = TRUE;
   }
 
@@ -1686,7 +1686,7 @@ AhciModeInitialization (
 
   Status = AhciReset (AhciBar, AHCI_PEI_RESET_TIMEOUT);
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "%a: AHCI HBA reset failed with %r.\n", __FUNCTION__, Status));
+    DEBUG ((DEBUG_ERROR, "%a: AHCI HBA reset failed with %r.\n", __func__, Status));
     return EFI_DEVICE_ERROR;
   }
 
@@ -1708,7 +1708,7 @@ AhciModeInitialization (
     DEBUG ((
       DEBUG_ERROR,
       "%a: Transfer-related data allocation failed with %r.\n",
-      __FUNCTION__,
+      __func__,
       Status
       ));
     return EFI_OUT_OF_RESOURCES;
@@ -1814,7 +1814,7 @@ AhciModeInitialization (
         //
         Offset = AHCI_PORT_START + Port * AHCI_PORT_REG_WIDTH + AHCI_PORT_CMD;
         AhciAndReg (AhciBar, Offset, (UINT32) ~(AHCI_PORT_CMD_SUD));
-        DEBUG ((DEBUG_ERROR, "%a: No device detected at Port %d.\n", __FUNCTION__, Port));
+        DEBUG ((DEBUG_ERROR, "%a: No device detected at Port %d.\n", __func__, Port));
         continue;
       }
 
@@ -1844,7 +1844,7 @@ AhciModeInitialization (
         DEBUG ((
           DEBUG_ERROR,
           "%a: Port %d device presence detected but phy not ready (TFD=0x%x).\n",
-          __FUNCTION__,
+          __func__,
           Port,
           Data
           ));
@@ -1866,7 +1866,7 @@ AhciModeInitialization (
         DEBUG ((
           DEBUG_ERROR,
           "%a: Error occurred when waiting for the first D2H register FIS - %r\n",
-          __FUNCTION__,
+          __func__,
           Status
           ));
         continue;
@@ -1876,11 +1876,11 @@ AhciModeInitialization (
       if ((Data & AHCI_ATAPI_SIG_MASK) == AHCI_ATA_DEVICE_SIG) {
         Status = AhciIdentify (Private, Port, 0, PortIndex - 1, &IdentifyData);
         if (EFI_ERROR (Status)) {
-          DEBUG ((DEBUG_ERROR, "%a: AhciIdentify() failed with %r\n", __FUNCTION__, Status));
+          DEBUG ((DEBUG_ERROR, "%a: AhciIdentify() failed with %r\n", __func__, Status));
           continue;
         }
 
-        DEBUG ((DEBUG_INFO, "%a: ATA hard disk found on Port %d.\n", __FUNCTION__, Port));
+        DEBUG ((DEBUG_INFO, "%a: ATA hard disk found on Port %d.\n", __func__, Port));
       } else {
         continue;
       }
diff --git a/MdeModulePkg/Bus/Ata/AhciPei/AhciPei.c b/MdeModulePkg/Bus/Ata/AhciPei/AhciPei.c
index e33d863d2acf..7ea36afa2540 100644
--- a/MdeModulePkg/Bus/Ata/AhciPei/AhciPei.c
+++ b/MdeModulePkg/Bus/Ata/AhciPei/AhciPei.c
@@ -156,7 +156,7 @@ AtaAhciInitPrivateData (
   //
   Status = PeiServicesGetBootMode (&BootMode);
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "%a: Fail to get the current boot mode.\n", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a: Fail to get the current boot mode.\n", __func__));
     return Status;
   }
 
@@ -168,7 +168,7 @@ AtaAhciInitPrivateData (
     DEBUG ((
       DEBUG_ERROR,
       "%a: The device path is invalid.\n",
-      __FUNCTION__
+      __func__
       ));
     return Status;
   }
@@ -196,7 +196,7 @@ AtaAhciInitPrivateData (
     DEBUG ((
       DEBUG_ERROR,
       "%a: Fail to allocate private data.\n",
-      __FUNCTION__
+      __func__
       ));
     return EFI_OUT_OF_RESOURCES;
   }
@@ -260,7 +260,7 @@ AtaAhciInitPrivateData (
     DEBUG ((
       DEBUG_INFO,
       "%a: Security Security Command PPI will be produced.\n",
-      __FUNCTION__
+      __func__
       ));
     Private->StorageSecurityPpi.Revision           = EDKII_STORAGE_SECURITY_PPI_REVISION;
     Private->StorageSecurityPpi.GetNumberofDevices = AhciStorageSecurityGetDeviceNo;
@@ -329,7 +329,7 @@ AtaAhciInitPrivateDataFromHostControllerPpi (
       DEBUG ((
         DEBUG_ERROR,
         "%a: Fail to allocate get the device path for Controller %d.\n",
-        __FUNCTION__,
+        __func__,
         Controller
         ));
       return Status;
@@ -340,7 +340,7 @@ AtaAhciInitPrivateDataFromHostControllerPpi (
       DEBUG ((
         DEBUG_ERROR,
         "%a: Controller initialization fail for Controller %d with Status - %r.\n",
-        __FUNCTION__,
+        __func__,
         Controller,
         Status
         ));
@@ -348,7 +348,7 @@ AtaAhciInitPrivateDataFromHostControllerPpi (
       DEBUG ((
         DEBUG_INFO,
         "%a: Controller %d has been successfully initialized.\n",
-        __FUNCTION__,
+        __func__,
         Controller
         ));
     }
@@ -471,7 +471,7 @@ AtaAhciInitPrivateDataFromPciDevice (
     DEBUG ((
       DEBUG_INFO,
       "%a: Failed to init controller, with Status - %r\n",
-      __FUNCTION__,
+      __func__,
       Status
       ));
   }
@@ -522,7 +522,7 @@ AtaAhciPeimEntry (
   IN CONST EFI_PEI_SERVICES  **PeiServices
   )
 {
-  DEBUG ((DEBUG_INFO, "%a: Enters.\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a: Enters.\n", __func__));
 
   PeiServicesNotifyPpi (&mAtaAhciHostControllerNotify);
 
diff --git a/MdeModulePkg/Bus/Ata/AhciPei/AhciPeiBlockIo.c b/MdeModulePkg/Bus/Ata/AhciPei/AhciPeiBlockIo.c
index c5d1f3fffb6d..5eb2a9ce8294 100644
--- a/MdeModulePkg/Bus/Ata/AhciPei/AhciPeiBlockIo.c
+++ b/MdeModulePkg/Bus/Ata/AhciPei/AhciPeiBlockIo.c
@@ -101,7 +101,7 @@ AccessAtaDevice (
     DEBUG ((
       DEBUG_BLKIO,
       "%a: Blocking AccessAtaDevice, TransferBlockNumber = %x; StartLba = %x\n",
-      __FUNCTION__,
+      __func__,
       TransferBlockNumber,
       StartLba
       ));
diff --git a/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c b/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c
index e903593b0198..b4f1a5079914 100644
--- a/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c
+++ b/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c
@@ -1863,7 +1863,7 @@ EhcDriverBindingStart (
       DEBUG ((
         DEBUG_WARN,
         "%a: failed to enable 64-bit DMA on 64-bit capable controller @ %p (%r)\n",
-        __FUNCTION__,
+        __func__,
         Controller,
         Status
         ));
diff --git a/MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.c b/MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.c
index 6967aabceb78..59bbe9fc2318 100644
--- a/MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.c
+++ b/MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.c
@@ -836,7 +836,7 @@ EhciInsertAsyncIntTransfer (
   Data = AllocatePool (DataLen);
 
   if (Data == NULL) {
-    DEBUG ((DEBUG_ERROR, "%a: failed to allocate buffer\n", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a: failed to allocate buffer\n", __func__));
     return NULL;
   }
 
@@ -858,7 +858,7 @@ EhciInsertAsyncIntTransfer (
           );
 
   if (Urb == NULL) {
-    DEBUG ((DEBUG_ERROR, "%a: failed to create URB\n", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a: failed to create URB\n", __func__));
     gBS->FreePool (Data);
     return NULL;
   }
diff --git a/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceIo.c b/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceIo.c
index 2fb78d8f9687..e31c38deed6c 100644
--- a/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceIo.c
+++ b/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceIo.c
@@ -1843,7 +1843,7 @@ InitializePciIoProtocol (
       DEBUG ((
         DEBUG_ERROR,
         "%a: resource count exceeds number of emulated BARs\n",
-        __FUNCTION__
+        __func__
         ));
       ASSERT (FALSE);
       break;
diff --git a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressBlockIo.c b/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressBlockIo.c
index b33c90341255..b6ed7f7031b3 100644
--- a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressBlockIo.c
+++ b/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressBlockIo.c
@@ -216,7 +216,7 @@ NvmeRead (
     DEBUG_BLKIO,
     "%a: Lba = 0x%08Lx, Original = 0x%08Lx, "
     "Remaining = 0x%08Lx, BlockSize = 0x%x, Status = %r\n",
-    __FUNCTION__,
+    __func__,
     Lba,
     (UINT64)OrginalBlocks,
     (UINT64)Blocks,
@@ -302,7 +302,7 @@ NvmeWrite (
     DEBUG_BLKIO,
     "%a: Lba = 0x%08Lx, Original = 0x%08Lx, "
     "Remaining = 0x%08Lx, BlockSize = 0x%x, Status = %r\n",
-    __FUNCTION__,
+    __func__,
     Lba,
     (UINT64)OrginalBlocks,
     (UINT64)Blocks,
@@ -817,7 +817,7 @@ NvmeAsyncRead (
     DEBUG_BLKIO,
     "%a: Lba = 0x%08Lx, Original = 0x%08Lx, "
     "Remaining = 0x%08Lx, BlockSize = 0x%x, Status = %r\n",
-    __FUNCTION__,
+    __func__,
     Lba,
     (UINT64)OrginalBlocks,
     (UINT64)Blocks,
@@ -945,7 +945,7 @@ NvmeAsyncWrite (
     DEBUG_BLKIO,
     "%a: Lba = 0x%08Lx, Original = 0x%08Lx, "
     "Remaining = 0x%08Lx, BlockSize = 0x%x, Status = %r\n",
-    __FUNCTION__,
+    __func__,
     Lba,
     (UINT64)OrginalBlocks,
     (UINT64)Blocks,
diff --git a/MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPei.c b/MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPei.c
index 3e6f75345d98..38f86487e25a 100644
--- a/MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPei.c
+++ b/MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPei.c
@@ -91,7 +91,7 @@ EnumerateNvmeDevNamespace (
              NamespaceData
              );
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "%a: NvmeIdentifyNamespace fail, Status - %r\n", __FUNCTION__, Status));
+    DEBUG ((DEBUG_ERROR, "%a: NvmeIdentifyNamespace fail, Status - %r\n", __func__, Status));
     goto Exit;
   }
 
@@ -99,7 +99,7 @@ EnumerateNvmeDevNamespace (
   // Validate Namespace
   //
   if (NamespaceData->Ncap == 0) {
-    DEBUG ((DEBUG_INFO, "%a: Namespace ID %d is an inactive one.\n", __FUNCTION__, NamespaceId));
+    DEBUG ((DEBUG_INFO, "%a: Namespace ID %d is an inactive one.\n", __func__, NamespaceId));
     Status = EFI_DEVICE_ERROR;
     goto Exit;
   }
@@ -142,7 +142,7 @@ EnumerateNvmeDevNamespace (
   DEBUG ((
     DEBUG_INFO,
     "%a: Namespace ID %d - BlockSize = 0x%x, LastBlock = 0x%lx\n",
-    __FUNCTION__,
+    __func__,
     NamespaceId,
     NamespaceInfo->Media.BlockSize,
     NamespaceInfo->Media.LastBlock
@@ -246,14 +246,14 @@ NvmeInitPrivateData (
   PEI_NVME_CONTROLLER_PRIVATE_DATA  *Private;
   EFI_PHYSICAL_ADDRESS              DeviceAddress;
 
-  DEBUG ((DEBUG_INFO, "%a: Enters.\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a: Enters.\n", __func__));
 
   //
   // Get the current boot mode.
   //
   Status = PeiServicesGetBootMode (&BootMode);
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "%a: Fail to get the current boot mode.\n", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a: Fail to get the current boot mode.\n", __func__));
     return Status;
   }
 
@@ -265,7 +265,7 @@ NvmeInitPrivateData (
     DEBUG ((
       DEBUG_ERROR,
       "%a: The device path is invalid.\n",
-      __FUNCTION__
+      __func__
       ));
     return Status;
   }
@@ -282,7 +282,7 @@ NvmeInitPrivateData (
     DEBUG ((
       DEBUG_ERROR,
       "%a: skipped during S3.\n",
-      __FUNCTION__
+      __func__
       ));
     return EFI_SUCCESS;
   }
@@ -295,7 +295,7 @@ NvmeInitPrivateData (
     DEBUG ((
       DEBUG_ERROR,
       "%a: Fail to allocate private data.\n",
-      __FUNCTION__
+      __func__
       ));
     return EFI_OUT_OF_RESOURCES;
   }
@@ -313,13 +313,13 @@ NvmeInitPrivateData (
     DEBUG ((
       DEBUG_ERROR,
       "%a: Fail to allocate DMA buffers.\n",
-      __FUNCTION__
+      __func__
       ));
     return Status;
   }
 
   ASSERT (DeviceAddress == ((EFI_PHYSICAL_ADDRESS)(UINTN)Private->Buffer));
-  DEBUG ((DEBUG_INFO, "%a: DMA buffer base at 0x%x\n", __FUNCTION__, Private->Buffer));
+  DEBUG ((DEBUG_INFO, "%a: DMA buffer base at 0x%x\n", __func__, Private->Buffer));
 
   //
   // Initialize controller private data
@@ -337,7 +337,7 @@ NvmeInitPrivateData (
     DEBUG ((
       DEBUG_ERROR,
       "%a: Controller initialization fail with Status - %r.\n",
-      __FUNCTION__,
+      __func__,
       Status
       ));
     NvmeFreeDmaResource (Private);
@@ -355,7 +355,7 @@ NvmeInitPrivateData (
     DEBUG ((
       DEBUG_ERROR,
       "%a: Namespaces discovery fail with Status - %r.\n",
-      __FUNCTION__,
+      __func__,
       Status
       ));
     NvmeFreeDmaResource (Private);
@@ -414,7 +414,7 @@ NvmeInitPrivateData (
     DEBUG ((
       DEBUG_INFO,
       "%a: Security Security Command PPI will be produced.\n",
-      __FUNCTION__
+      __func__
       ));
     Private->StorageSecurityPpi.Revision           = EDKII_STORAGE_SECURITY_PPI_REVISION;
     Private->StorageSecurityPpi.GetNumberofDevices = NvmeStorageSecurityGetDeviceNo;
@@ -557,7 +557,7 @@ NvmeInitControllerDataFromPciDevice (
     DEBUG ((
       DEBUG_INFO,
       "%a: Failed to init controller, with Status - %r\n",
-      __FUNCTION__,
+      __func__,
       Status
       ));
   }
@@ -635,7 +635,7 @@ NvmeInitControllerFromHostControllerPpi (
       DEBUG ((
         DEBUG_ERROR,
         "%a: Fail to allocate get the device path for Controller %d.\n",
-        __FUNCTION__,
+        __func__,
         Controller
         ));
       return Status;
@@ -646,7 +646,7 @@ NvmeInitControllerFromHostControllerPpi (
       DEBUG ((
         DEBUG_ERROR,
         "%a: Controller initialization fail for Controller %d with Status - %r.\n",
-        __FUNCTION__,
+        __func__,
         Controller,
         Status
         ));
@@ -654,7 +654,7 @@ NvmeInitControllerFromHostControllerPpi (
       DEBUG ((
         DEBUG_INFO,
         "%a: Controller %d has been successfully initialized.\n",
-        __FUNCTION__,
+        __func__,
         Controller
         ));
     }
@@ -712,7 +712,7 @@ NvmExpressPeimEntry (
   IN CONST EFI_PEI_SERVICES  **PeiServices
   )
 {
-  DEBUG ((DEBUG_INFO, "%a: Enters.\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a: Enters.\n", __func__));
 
   PeiServicesNotifyPpi (&mNvmeHostControllerNotify);
 
diff --git a/MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPeiBlockIo.c b/MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPeiBlockIo.c
index 576481dcee2a..a61238086cdf 100644
--- a/MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPeiBlockIo.c
+++ b/MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPeiBlockIo.c
@@ -125,14 +125,14 @@ NvmeRead (
       MaxTransferBlocks = MaxTransferBlocks >> 1;
 
       if ((Retries > NVME_READ_MAX_RETRY) || (MaxTransferBlocks < 1)) {
-        DEBUG ((DEBUG_ERROR, "%a: ReadSectors fail, Status - %r\n", __FUNCTION__, Status));
+        DEBUG ((DEBUG_ERROR, "%a: ReadSectors fail, Status - %r\n", __func__, Status));
         break;
       }
 
       DEBUG ((
         DEBUG_BLKIO,
         "%a: ReadSectors fail, retry with smaller transfer block number - 0x%x\n",
-        __FUNCTION__,
+        __func__,
         MaxTransferBlocks
         ));
       continue;
@@ -151,7 +151,7 @@ NvmeRead (
     DEBUG_BLKIO,
     "%a: Lba = 0x%08Lx, Original = 0x%08Lx, "
     "Remaining = 0x%08Lx, BlockSize = 0x%x, Status = %r\n",
-    __FUNCTION__,
+    __func__,
     Lba,
     (UINT64)OrginalBlocks,
     (UINT64)Blocks,
diff --git a/MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPeiHci.c b/MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPeiHci.c
index bff5cfd0d5fe..fc7b684940d9 100644
--- a/MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPeiHci.c
+++ b/MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPeiHci.c
@@ -138,7 +138,7 @@ NvmeBaseMemPageOffset (
   PageSizeList[4] = NVME_PRP_SIZE; /* PRPs */
 
   if (BaseMemIndex > MAX_BASEMEM_COUNT) {
-    DEBUG ((DEBUG_ERROR, "%a: The input BaseMem index is invalid.\n", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a: The input BaseMem index is invalid.\n", __func__));
     ASSERT (FALSE);
     return 0;
   }
@@ -191,7 +191,7 @@ NvmeWaitController (
     //
     Status = NVME_GET_CSTS (Private, &Csts);
     if (EFI_ERROR (Status)) {
-      DEBUG ((DEBUG_ERROR, "%a: NVME_GET_CSTS fail, Status - %r\n", __FUNCTION__, Status));
+      DEBUG ((DEBUG_ERROR, "%a: NVME_GET_CSTS fail, Status - %r\n", __func__, Status));
       return Status;
     }
 
@@ -232,7 +232,7 @@ NvmeDisableController (
   //
   Status = NVME_GET_CC (Private, &Cc);
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "%a: NVME_GET_CC fail, Status - %r\n", __FUNCTION__, Status));
+    DEBUG ((DEBUG_ERROR, "%a: NVME_GET_CC fail, Status - %r\n", __func__, Status));
     goto ErrorExit;
   }
 
@@ -243,21 +243,21 @@ NvmeDisableController (
     //
     Status = NVME_SET_CC (Private, &Cc);
     if (EFI_ERROR (Status)) {
-      DEBUG ((DEBUG_ERROR, "%a: NVME_SET_CC fail, Status - %r\n", __FUNCTION__, Status));
+      DEBUG ((DEBUG_ERROR, "%a: NVME_SET_CC fail, Status - %r\n", __func__, Status));
       goto ErrorExit;
     }
   }
 
   Status = NvmeWaitController (Private, FALSE);
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "%a: NvmeWaitController fail, Status - %r\n", __FUNCTION__, Status));
+    DEBUG ((DEBUG_ERROR, "%a: NvmeWaitController fail, Status - %r\n", __func__, Status));
     goto ErrorExit;
   }
 
   return EFI_SUCCESS;
 
 ErrorExit:
-  DEBUG ((DEBUG_ERROR, "%a fail, Status - %r\n", __FUNCTION__, Status));
+  DEBUG ((DEBUG_ERROR, "%a fail, Status - %r\n", __func__, Status));
   return Status;
 }
 
@@ -289,20 +289,20 @@ NvmeEnableController (
   Cc.Iocqes = 4;
   Status    = NVME_SET_CC (Private, &Cc);
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "%a: NVME_SET_CC fail, Status - %r\n", __FUNCTION__, Status));
+    DEBUG ((DEBUG_ERROR, "%a: NVME_SET_CC fail, Status - %r\n", __func__, Status));
     goto ErrorExit;
   }
 
   Status = NvmeWaitController (Private, TRUE);
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "%a: NvmeWaitController fail, Status - %r\n", __FUNCTION__, Status));
+    DEBUG ((DEBUG_ERROR, "%a: NvmeWaitController fail, Status - %r\n", __func__, Status));
     goto ErrorExit;
   }
 
   return EFI_SUCCESS;
 
 ErrorExit:
-  DEBUG ((DEBUG_ERROR, "%a fail, Status: %r\n", __FUNCTION__, Status));
+  DEBUG ((DEBUG_ERROR, "%a fail, Status: %r\n", __func__, Status));
   return Status;
 }
 
@@ -572,7 +572,7 @@ NvmeControllerInit (
   //
   NVME_GET_CAP (Private, &Private->Cap);
   if ((Private->Cap.Css & BIT0) == 0) {
-    DEBUG ((DEBUG_ERROR, "%a: The NVME controller doesn't support NVMe command set.\n", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a: The NVME controller doesn't support NVMe command set.\n", __func__));
     return EFI_UNSUPPORTED;
   }
 
@@ -580,7 +580,7 @@ NvmeControllerInit (
   // Currently, the driver only supports 4k page size
   //
   if ((Private->Cap.Mpsmin + 12) > EFI_PAGE_SHIFT) {
-    DEBUG ((DEBUG_ERROR, "%a: The driver doesn't support page size other than 4K.\n", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a: The driver doesn't support page size other than 4K.\n", __func__));
     ASSERT (FALSE);
     return EFI_UNSUPPORTED;
   }
@@ -599,7 +599,7 @@ NvmeControllerInit (
   //
   Status = NvmeDisableController (Private);
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "%a: NvmeDisableController fail, Status - %r\n", __FUNCTION__, Status));
+    DEBUG ((DEBUG_ERROR, "%a: NvmeDisableController fail, Status - %r\n", __func__, Status));
     return Status;
   }
 
@@ -647,7 +647,7 @@ NvmeControllerInit (
   //
   Status = NvmeEnableController (Private);
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "%a: NvmeEnableController fail, Status - %r\n", __FUNCTION__, Status));
+    DEBUG ((DEBUG_ERROR, "%a: NvmeEnableController fail, Status - %r\n", __func__, Status));
     return Status;
   }
 
@@ -663,7 +663,7 @@ NvmeControllerInit (
 
   Status = NvmeIdentifyController (Private, Private->ControllerData);
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "%a: NvmeIdentifyController fail, Status - %r\n", __FUNCTION__, Status));
+    DEBUG ((DEBUG_ERROR, "%a: NvmeIdentifyController fail, Status - %r\n", __func__, Status));
     return Status;
   }
 
@@ -676,7 +676,7 @@ NvmeControllerInit (
     DEBUG ((
       DEBUG_ERROR,
       "%a: Number of Namespaces field in Identify Controller data not supported by the driver.\n",
-      __FUNCTION__
+      __func__
       ));
     return EFI_UNSUPPORTED;
   }
@@ -686,13 +686,13 @@ NvmeControllerInit (
   //
   Status = NvmeCreateIoCompletionQueue (Private);
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "%a: Create IO completion queue fail, Status - %r\n", __FUNCTION__, Status));
+    DEBUG ((DEBUG_ERROR, "%a: Create IO completion queue fail, Status - %r\n", __func__, Status));
     return Status;
   }
 
   Status = NvmeCreateIoSubmissionQueue (Private);
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "%a: Create IO submission queue fail, Status - %r\n", __FUNCTION__, Status));
+    DEBUG ((DEBUG_ERROR, "%a: Create IO submission queue fail, Status - %r\n", __func__, Status));
   }
 
   return Status;
diff --git a/MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPeiPassThru.c b/MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPeiPassThru.c
index dc280ec4e35f..5081b53cd5e8 100644
--- a/MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPeiPassThru.c
+++ b/MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPeiPassThru.c
@@ -57,7 +57,7 @@ NvmeCreatePrpList (
       DEBUG_ERROR,
       "%a: The implementation only supports PrpList number up to 4."
       " But %d are needed here.\n",
-      __FUNCTION__,
+      __func__,
       PrpListNo
       ));
     return 0;
@@ -365,7 +365,7 @@ NvmePassThruExecute (
     DEBUG ((
       DEBUG_ERROR,
       "%a, Invalid parameter: Packet(%lx)\n",
-      __FUNCTION__,
+      __func__,
       (UINTN)Packet
       ));
     return EFI_INVALID_PARAMETER;
@@ -375,7 +375,7 @@ NvmePassThruExecute (
     DEBUG ((
       DEBUG_ERROR,
       "%a, Invalid parameter: NvmeCmd (%lx)/NvmeCompletion(%lx)\n",
-      __FUNCTION__,
+      __func__,
       (UINTN)Packet->NvmeCmd,
       (UINTN)Packet->NvmeCompletion
       ));
@@ -386,7 +386,7 @@ NvmePassThruExecute (
     DEBUG ((
       DEBUG_ERROR,
       "%a, Invalid parameter: QueueId(%lx)\n",
-      __FUNCTION__,
+      __func__,
       (UINTN)Packet->QueueType
       ));
     return EFI_INVALID_PARAMETER;
@@ -407,7 +407,7 @@ NvmePassThruExecute (
     DEBUG ((
       DEBUG_ERROR,
       "%a: Nsid mismatch (%x, %x)\n",
-      __FUNCTION__,
+      __func__,
       Packet->NvmeCmd->Nsid,
       NamespaceId
       ));
@@ -425,7 +425,7 @@ NvmePassThruExecute (
   //
   ASSERT (Sq->Psdt == 0);
   if (Sq->Psdt != 0) {
-    DEBUG ((DEBUG_ERROR, "%a: Does not support SGL mechanism.\n", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a: Does not support SGL mechanism.\n", __func__));
     return EFI_UNSUPPORTED;
   }
 
@@ -458,7 +458,7 @@ NvmePassThruExecute (
         DEBUG ((
           DEBUG_ERROR,
           "%a: Does not support external IO queues creation request.\n",
-          __FUNCTION__
+          __func__
           ));
         return EFI_UNSUPPORTED;
       }
@@ -480,7 +480,7 @@ NvmePassThruExecute (
                       );
         if (EFI_ERROR (Status) || (MapLength != Packet->TransferLength)) {
           Status = EFI_OUT_OF_RESOURCES;
-          DEBUG ((DEBUG_ERROR, "%a: Fail to map data buffer.\n", __FUNCTION__));
+          DEBUG ((DEBUG_ERROR, "%a: Fail to map data buffer.\n", __func__));
           goto Exit;
         }
 
@@ -498,7 +498,7 @@ NvmePassThruExecute (
                       );
         if (EFI_ERROR (Status) || (MapLength != Packet->MetadataLength)) {
           Status = EFI_OUT_OF_RESOURCES;
-          DEBUG ((DEBUG_ERROR, "%a: Fail to map meta data buffer.\n", __FUNCTION__));
+          DEBUG ((DEBUG_ERROR, "%a: Fail to map meta data buffer.\n", __func__));
           goto Exit;
         }
 
@@ -526,7 +526,7 @@ NvmePassThruExecute (
                    );
     if (Sq->Prp[1] == 0) {
       Status = EFI_OUT_OF_RESOURCES;
-      DEBUG ((DEBUG_ERROR, "%a: Create PRP list fail, Status - %r\n", __FUNCTION__, Status));
+      DEBUG ((DEBUG_ERROR, "%a: Create PRP list fail, Status - %r\n", __func__, Status));
       goto Exit;
     }
   } else if ((Offset + Bytes) > EFI_PAGE_SIZE) {
@@ -568,7 +568,7 @@ NvmePassThruExecute (
   Data32 = ReadUnaligned32 ((UINT32 *)&Private->SqTdbl[QueueId]);
   Status = NVME_SET_SQTDBL (Private, QueueId, &Data32);
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "%a: NVME_SET_SQTDBL fail, Status - %r\n", __FUNCTION__, Status));
+    DEBUG ((DEBUG_ERROR, "%a: NVME_SET_SQTDBL fail, Status - %r\n", __func__, Status));
     goto Exit;
   }
 
@@ -591,7 +591,7 @@ NvmePassThruExecute (
     //
     // Timeout occurs for an NVMe command, reset the controller to abort the outstanding command
     //
-    DEBUG ((DEBUG_ERROR, "%a: Timeout occurs for the PassThru command.\n", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a: Timeout occurs for the PassThru command.\n", __func__));
     Status = NvmeControllerInit (Private);
     if (EFI_ERROR (Status)) {
       Status = EFI_DEVICE_ERROR;
diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciCommand.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciCommand.c
index ba4b099bc5c1..75c9b344eed2 100644
--- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciCommand.c
+++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciCommand.c
@@ -237,7 +237,7 @@ LocatePciExpressCapabilityRegBlock (
       DEBUG ((
         DEBUG_WARN,
         "%a: [%02x|%02x|%02x] failed to access config space at offset 0x%x\n",
-        __FUNCTION__,
+        __func__,
         PciIoDevice->BusNumber,
         PciIoDevice->DeviceNumber,
         PciIoDevice->FunctionNumber,
diff --git a/MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridge.c b/MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridge.c
index b20bcd310ad5..d573e532bac8 100644
--- a/MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridge.c
+++ b/MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridge.c
@@ -128,7 +128,7 @@ IntersectIoDescriptor (
       EFI_ERROR (Status) ? DEBUG_ERROR : DEBUG_VERBOSE,
       "%a: %a: add [%Lx, %Lx): %r\n",
       gEfiCallerBaseName,
-      __FUNCTION__,
+      __func__,
       IntersectionBase,
       IntersectionEnd,
       Status
@@ -141,7 +141,7 @@ IntersectIoDescriptor (
     "%a: %a: desc [%Lx, %Lx) type %u conflicts with "
     "aperture [%Lx, %Lx)\n",
     gEfiCallerBaseName,
-    __FUNCTION__,
+    __func__,
     Descriptor->BaseAddress,
     Descriptor->BaseAddress + Descriptor->Length,
     (UINT32)Descriptor->GcdIoType,
@@ -178,7 +178,7 @@ AddIoSpace (
       DEBUG_ERROR,
       "%a: %a: GetIoSpaceMap(): %r\n",
       gEfiCallerBaseName,
-      __FUNCTION__,
+      __func__,
       Status
       ));
     return Status;
@@ -299,7 +299,7 @@ IntersectMemoryDescriptor (
       EFI_ERROR (Status) ? DEBUG_ERROR : DEBUG_VERBOSE,
       "%a: %a: add [%Lx, %Lx): %r\n",
       gEfiCallerBaseName,
-      __FUNCTION__,
+      __func__,
       IntersectionBase,
       IntersectionEnd,
       Status
@@ -312,7 +312,7 @@ IntersectMemoryDescriptor (
     "%a: %a: desc [%Lx, %Lx) type %u cap %Lx conflicts "
     "with aperture [%Lx, %Lx) cap %Lx\n",
     gEfiCallerBaseName,
-    __FUNCTION__,
+    __func__,
     Descriptor->BaseAddress,
     Descriptor->BaseAddress + Descriptor->Length,
     (UINT32)Descriptor->GcdMemoryType,
@@ -353,7 +353,7 @@ AddMemoryMappedIoSpace (
       DEBUG_ERROR,
       "%a: %a: GetMemorySpaceMap(): %r\n",
       gEfiCallerBaseName,
-      __FUNCTION__,
+      __func__,
       Status
       ));
     return Status;
@@ -955,7 +955,7 @@ NotifyPhase (
               DEBUG ((
                 DEBUG_ERROR,
                 "[%a:%d] Translation %lx is not aligned to %lx!\n",
-                __FUNCTION__,
+                __func__,
                 DEBUG_LINE_NUMBER,
                 Translation,
                 Alignment
diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c
index ab2becdd19e7..8496ce472768 100644
--- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c
+++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c
@@ -641,7 +641,7 @@ SdMmcPciHcDriverBindingStart (
       DEBUG ((
         DEBUG_INFO,
         "%a: found SD/MMC override protocol\n",
-        __FUNCTION__
+        __func__
         ));
     }
   }
@@ -676,7 +676,7 @@ SdMmcPciHcDriverBindingStart (
           DEBUG ((
             DEBUG_WARN,
             "%a: Failed to override capability - %r\n",
-            __FUNCTION__,
+            __func__,
             Status
             ));
           continue;
@@ -691,7 +691,7 @@ SdMmcPciHcDriverBindingStart (
                               (VOID *)&Private->Slot[Slot].OperatingParameters
                               );
         if (EFI_ERROR (Status)) {
-          DEBUG ((DEBUG_WARN, "%a: Failed to get operating parameters, using defaults\n", __FUNCTION__));
+          DEBUG ((DEBUG_WARN, "%a: Failed to get operating parameters, using defaults\n", __func__));
         }
       }
     }
diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c
index dd45167a009e..aab68153283e 100644
--- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c
+++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c
@@ -498,7 +498,7 @@ SdMmcHcReset (
       DEBUG ((
         DEBUG_WARN,
         "%a: SD/MMC pre reset notifier callback failed - %r\n",
-        __FUNCTION__,
+        __func__,
         Status
         ));
       return Status;
@@ -556,7 +556,7 @@ SdMmcHcReset (
       DEBUG ((
         DEBUG_WARN,
         "%a: SD/MMC post reset notifier callback failed - %r\n",
-        __FUNCTION__,
+        __func__,
         Status
         ));
     }
@@ -942,7 +942,7 @@ SdMmcHcClockSupply (
       DEBUG ((
         DEBUG_ERROR,
         "%a: SD/MMC switch clock freq post notifier callback failed - %r\n",
-        __FUNCTION__,
+        __func__,
         Status
         ));
       return Status;
@@ -1234,7 +1234,7 @@ SdMmcHcInitHost (
       DEBUG ((
         DEBUG_WARN,
         "%a: SD/MMC pre init notifier callback failed - %r\n",
-        __FUNCTION__,
+        __func__,
         Status
         ));
       return Status;
@@ -1286,7 +1286,7 @@ SdMmcHcInitHost (
       DEBUG ((
         DEBUG_WARN,
         "%a: SD/MMC post init notifier callback failed - %r\n",
-        __FUNCTION__,
+        __func__,
         Status
         ));
     }
@@ -1375,7 +1375,7 @@ SdMmcHcUhsSignaling (
       DEBUG ((
         DEBUG_ERROR,
         "%a: SD/MMC uhs signaling notifier callback failed - %r\n",
-        __FUNCTION__,
+        __func__,
         Status
         ));
       return Status;
diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c
index d8fa41f68f55..62682dd27c47 100644
--- a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c
+++ b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c
@@ -2059,7 +2059,7 @@ XhcDriverBindingStart (
       DEBUG ((
         DEBUG_WARN,
         "%a: failed to enable 64-bit DMA on 64-bit capable controller @ %p (%r)\n",
-        __FUNCTION__,
+        __func__,
         Controller,
         Status
         ));
diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c
index 4b7462704a81..298fb88b811e 100644
--- a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c
+++ b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c
@@ -1495,7 +1495,7 @@ XhciInsertAsyncIntTransfer (
 
   Data = AllocateZeroPool (DataLen);
   if (Data == NULL) {
-    DEBUG ((DEBUG_ERROR, "%a: failed to allocate buffer\n", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a: failed to allocate buffer\n", __func__));
     return NULL;
   }
 
@@ -1513,7 +1513,7 @@ XhciInsertAsyncIntTransfer (
           Context
           );
   if (Urb == NULL) {
-    DEBUG ((DEBUG_ERROR, "%a: failed to create URB\n", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a: failed to create URB\n", __func__));
     FreePool (Data);
     return NULL;
   }
diff --git a/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c b/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c
index 873581d817ce..670f70caf41f 100644
--- a/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c
+++ b/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c
@@ -2593,7 +2593,7 @@ ScsiDiskInquiryDevice (
           DEBUG ((
             DEBUG_WARN,
             "%a: invalid PageLength (%u) in Supported VPD Pages page\n",
-            __FUNCTION__,
+            __func__,
             (UINT32)PageLength
             ));
           PageLength = 0;
@@ -2606,7 +2606,7 @@ ScsiDiskInquiryDevice (
           DEBUG ((
             DEBUG_WARN,
             "%a: Supported VPD Pages page doesn't start with code 0x%02x\n",
-            __FUNCTION__,
+            __func__,
             EFI_SCSI_PAGE_CODE_SUPPORTED_VPD
             ));
           PageLength = 0;
@@ -2626,7 +2626,7 @@ ScsiDiskInquiryDevice (
             DEBUG ((
               DEBUG_WARN,
               "%a: non-ascending code in Supported VPD Pages page @ %u\n",
-              __FUNCTION__,
+              __func__,
               Index
               ));
             Index      = 0;
diff --git a/MdeModulePkg/Core/Dxe/Dispatcher/Dispatcher.c b/MdeModulePkg/Core/Dxe/Dispatcher/Dispatcher.c
index fb9ae3ce78da..cf9d55687766 100644
--- a/MdeModulePkg/Core/Dxe/Dispatcher/Dispatcher.c
+++ b/MdeModulePkg/Core/Dxe/Dispatcher/Dispatcher.c
@@ -1095,7 +1095,7 @@ CoreProcessFvImageFile (
         DEBUG ((
           DEBUG_INFO,
           "%a() FV at 0x%x, FvAlignment required is 0x%x\n",
-          __FUNCTION__,
+          __func__,
           FvHeader,
           FvAlignment
           ));
diff --git a/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c b/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c
index 4683016ed758..0e0f9769b99d 100644
--- a/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c
+++ b/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c
@@ -315,7 +315,7 @@ DxeMain (
   DEBUG ((
     DEBUG_INFO,
     "%a: MemoryBaseAddress=0x%Lx MemoryLength=0x%Lx\n",
-    __FUNCTION__,
+    __func__,
     MemoryBaseAddress,
     MemoryLength
     ));
diff --git a/MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c b/MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c
index b89ab046fa73..7cc829b17402 100644
--- a/MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c
+++ b/MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c
@@ -838,7 +838,7 @@ InitializeDxeNxMemoryProtectionPolicy (
         DEBUG ((
           DEBUG_INFO,
           "%a: StackBase = 0x%016lx  StackSize = 0x%016lx\n",
-          __FUNCTION__,
+          __func__,
           MemoryHob->AllocDescriptor.MemoryBaseAddress,
           MemoryHob->AllocDescriptor.MemoryLength
           ));
@@ -864,7 +864,7 @@ InitializeDxeNxMemoryProtectionPolicy (
   DEBUG ((
     DEBUG_INFO,
     "%a: applying strict permissions to active memory regions\n",
-    __FUNCTION__
+    __func__
     ));
 
   MergeMemoryMapForProtectionPolicy (MemoryMap, &MemoryMapSize, DescriptorSize);
@@ -926,7 +926,7 @@ InitializeDxeNxMemoryProtectionPolicy (
     DEBUG ((
       DEBUG_INFO,
       "%a: applying strict permissions to inactive memory regions\n",
-      __FUNCTION__
+      __func__
       ));
 
     CoreAcquireGcdMemoryLock ();
diff --git a/MdeModulePkg/Core/Dxe/SectionExtraction/CoreSectionExtraction.c b/MdeModulePkg/Core/Dxe/SectionExtraction/CoreSectionExtraction.c
index b8d4184b5064..2152833ff639 100644
--- a/MdeModulePkg/Core/Dxe/SectionExtraction/CoreSectionExtraction.c
+++ b/MdeModulePkg/Core/Dxe/SectionExtraction/CoreSectionExtraction.c
@@ -1304,7 +1304,7 @@ GetSection (
         DEBUG ((
           DEBUG_ERROR,
           "%a: recursion aborted due to nesting depth\n",
-          __FUNCTION__
+          __func__
           ));
         //
         // Map "aborted" to "not found".
diff --git a/MdeModulePkg/Core/DxeIplPeim/Ia32/DxeLoadFunc.c b/MdeModulePkg/Core/DxeIplPeim/Ia32/DxeLoadFunc.c
index fdeaaa39d88e..4bc7b749b0fc 100644
--- a/MdeModulePkg/Core/DxeIplPeim/Ia32/DxeLoadFunc.c
+++ b/MdeModulePkg/Core/DxeIplPeim/Ia32/DxeLoadFunc.c
@@ -369,7 +369,7 @@ HandOffToDxeCore (
     DEBUG ((
       DEBUG_INFO,
       "%a() Stack Base: 0x%lx, Stack Size: 0x%x\n",
-      __FUNCTION__,
+      __func__,
       BaseOfStack,
       STACK_SIZE
       ));
@@ -457,7 +457,7 @@ HandOffToDxeCore (
     DEBUG ((
       DEBUG_INFO,
       "%a() Stack Base: 0x%lx, Stack Size: 0x%x\n",
-      __FUNCTION__,
+      __func__,
       BaseOfStack,
       STACK_SIZE
       ));
diff --git a/MdeModulePkg/Core/DxeIplPeim/RiscV64/DxeLoadFunc.c b/MdeModulePkg/Core/DxeIplPeim/RiscV64/DxeLoadFunc.c
index f7b57df1c49e..b3567d88f734 100644
--- a/MdeModulePkg/Core/DxeIplPeim/RiscV64/DxeLoadFunc.c
+++ b/MdeModulePkg/Core/DxeIplPeim/RiscV64/DxeLoadFunc.c
@@ -36,7 +36,7 @@ HandOffToDxeCore (
   //
   BaseOfStack = AllocatePages (EFI_SIZE_TO_PAGES (STACK_SIZE));
   if (BaseOfStack == NULL) {
-    DEBUG ((DEBUG_ERROR, "%a: Can't allocate memory for stack.", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a: Can't allocate memory for stack.", __func__));
     ASSERT (FALSE);
   }
 
@@ -52,7 +52,7 @@ HandOffToDxeCore (
   //
   Status = PeiServicesInstallPpi (&gEndOfPeiSignalPpi);
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "%a: Fail to signal End of PEI event.", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a: Fail to signal End of PEI event.", __func__));
     ASSERT (FALSE);
   }
 
diff --git a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
index 3552feda8f1b..d8284f9f4f34 100644
--- a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
+++ b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
@@ -101,7 +101,7 @@ DiscoverPeimsAndOrderWithApriori (
   DEBUG ((
     DEBUG_INFO,
     "%a(): Found 0x%x PEI FFS files in the %dth FV\n",
-    __FUNCTION__,
+    __func__,
     PeimCount,
     Private->CurrentPeimFvCount
     ));
diff --git a/MdeModulePkg/Core/Pei/FwVol/FwVol.c b/MdeModulePkg/Core/Pei/FwVol/FwVol.c
index 60bbe57332b7..f7cc94c6ebd0 100644
--- a/MdeModulePkg/Core/Pei/FwVol/FwVol.c
+++ b/MdeModulePkg/Core/Pei/FwVol/FwVol.c
@@ -1494,7 +1494,7 @@ ProcessFvFile (
       DEBUG ((
         DEBUG_INFO,
         "%a() FV at 0x%x, FvAlignment required is 0x%x\n",
-        __FUNCTION__,
+        __func__,
         FvHeader,
         FvAlignment
         ));
diff --git a/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleReportLib.c b/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleReportLib.c
index efc6b4ce2661..a1523428cdaa 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 8c7b58b2f960..a6af2e848562 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 50131a431f97..4ca8425705f8 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 bde22fa6590e..c3763c4483c7 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 46a2fa201627..46a8b780e337 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 da90f4fc6ac9..5de46133bb26 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 82dae67ef50f..214f76ab9626 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;
 }
 
diff --git a/MdeModulePkg/Universal/CapsulePei/UefiCapsule.c b/MdeModulePkg/Universal/CapsulePei/UefiCapsule.c
index cdeffa911311..8e26a7d7959e 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 05941f9f8d56..4085f371abad 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 098e4fec663b..6e10defe59c0 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 6cd197046f40..ca2f3e076610 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 2998c3369cc9..86020de6e092 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 53f9aefb2dbb..10a67767ebc5 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 f1335870e797..508184f7a048 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 5ade8d988bac..1ae06a639c43 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 dd077bb0cf19..1a86e69d3c21 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 88984c31ab4f..114d0693fe77 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 296afd2ec414..da1105ff073e 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 3eb7d935b4d2..7a1331255b81 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 d849ee9ce292..f6bb7284f060 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 b2094fbcd6ea..6151a2ba0b18 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;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 06/18] SecurityPkg: Update code to be more C11 compliant by using __func__
  2023-04-06 22:23 [PATCH 00/18] Replace pre-standard macro __FUNCTION__ with C99 __func__ throughout edk2 Rebecca Cran
                   ` (4 preceding siblings ...)
  2023-04-06 22:23 ` [PATCH 05/18] MdeModulePkg: " Rebecca Cran
@ 2023-04-06 22:23 ` Rebecca Cran
  2023-04-06 22:23 ` [PATCH 07/18] EmbeddedPkg: " Rebecca Cran
                   ` (14 subsequent siblings)
  20 siblings, 0 replies; 34+ messages in thread
From: Rebecca Cran @ 2023-04-06 22:23 UTC (permalink / raw)
  To: devel, Liming Gao, Michael D Kinney, Guomin Jiang, Wei6 Xu,
	Guo Dong, Ray Ni, Sean Rhodes, James Lu, Gua Guo, Andrew Fish,
	Hao A Wu, Maciej Rabeda, Siyuan Fu, Jiewen Yao, Jian J Wang,
	Xiaoyu Lu, Ard Biesheuvel, Sami Mujawar, Supreeth Venkatesh,
	Michael Kubacki, Nate DeSimone, Sean Brogan
  Cc: Rebecca Cran, Leif Lindholm, Abner Chang, Nickle Wang,
	Igor Kulchytskyy, Daniel Schaefer, Min Xu, Jordan Justen,
	Gerd Hoffmann, Peter Grehan, Erdem Aktas, James Bottomley,
	Tom Lendacky, Michael Roth, Sunil V L, Andrei Warkentin

__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
SecurityPkg.

Visual Studio versions before VS 2015 don't support __func__ and so
will fail to compile. A workaround is to define __func__ as
__FUNCTION__ :

  #define __func__ __FUNCTION__

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
---
 SecurityPkg/HddPassword/HddPasswordDxe.c                                                | 44 ++++++++++----------
 SecurityPkg/HddPassword/HddPasswordPei.c                                                | 10 ++---
 SecurityPkg/Library/AuthVariableLib/AuthService.c                                       |  4 +-
 SecurityPkg/Library/PeiDxeTpmPlatformHierarchyLib/PeiDxeTpmPlatformHierarchyLib.c       |  6 +--
 SecurityPkg/Library/PlatformPKProtectionLibVarPolicy/PlatformPKProtectionLibVarPolicy.c |  2 +-
 SecurityPkg/Library/SecureBootVariableLib/SecureBootVariableLib.c                       | 38 ++++++++---------
 SecurityPkg/Library/SecureBootVariableLib/UnitTest/SecureBootVariableLibUnitTest.c      |  4 +-
 SecurityPkg/Library/SecureBootVariableProvisionLib/SecureBootVariableProvisionLib.c     |  2 +-
 SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c                                          | 24 +++++------
 SecurityPkg/Tcg/Opal/OpalPassword/OpalHii.c                                             |  8 ++--
 SecurityPkg/Tcg/Opal/OpalPassword/OpalPasswordPei.c                                     | 10 ++---
 SecurityPkg/Tcg/Tcg2Acpi/Tcg2Acpi.c                                                     | 12 +++---
 SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c                                                       | 10 ++---
 SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c                                                       | 22 +++++-----
 SecurityPkg/Tcg/TdTcg2Dxe/TdTcg2Dxe.c                                                   |  6 +--
 SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.c            |  2 +-
 SecurityPkg/VariableAuthenticated/SecureBootDefaultKeysDxe/SecureBootDefaultKeysDxe.c   | 14 +++----
 17 files changed, 109 insertions(+), 109 deletions(-)

diff --git a/SecurityPkg/HddPassword/HddPasswordDxe.c b/SecurityPkg/HddPassword/HddPasswordDxe.c
index a1a63b67a494..55dfb25886fc 100644
--- a/SecurityPkg/HddPassword/HddPasswordDxe.c
+++ b/SecurityPkg/HddPassword/HddPasswordDxe.c
@@ -314,7 +314,7 @@ FreezeLockDevice (
 
   FreeAlignedPages (Asb, EFI_SIZE_TO_PAGES (sizeof (EFI_ATA_STATUS_BLOCK)));
 
-  DEBUG ((DEBUG_INFO, "%a() - %r\n", __FUNCTION__, Status));
+  DEBUG ((DEBUG_INFO, "%a() - %r\n", __func__, Status));
   return Status;
 }
 
@@ -449,7 +449,7 @@ HddPasswordEndOfDxeEventNotify (
   EFI_STATUS                      Status;
   ATA_IDENTIFY_DATA               IdentifyData;
 
-  DEBUG ((DEBUG_INFO, "%a() - enter\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a() - enter\n", __func__));
 
   mHddPasswordEndOfDxe = TRUE;
 
@@ -503,7 +503,7 @@ HddPasswordEndOfDxeEventNotify (
     }
   }
 
-  DEBUG ((DEBUG_INFO, "%a() - exit\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a() - exit\n", __func__));
 
   gBS->CloseEvent (Event);
 }
@@ -620,7 +620,7 @@ SaveHddPasswordVariable (
   UINT8                  HashData[SHA256_DIGEST_SIZE];
   UINT8                  SaltData[PASSWORD_SALT_SIZE];
 
-  DEBUG ((DEBUG_INFO, "%a() - enter\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a() - enter\n", __func__));
 
   Delete = FALSE;
   if (!PasswordIsFullZero (Password)) {
@@ -765,7 +765,7 @@ SaveHddPasswordVariable (
     FreePool (Variable);
   }
 
-  DEBUG ((DEBUG_INFO, "%a() - exit\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a() - exit\n", __func__));
 }
 
 /**
@@ -791,7 +791,7 @@ GetSavedHddPasswordVariable (
   UINTN                  VariableSize;
   BOOLEAN                Found;
 
-  DEBUG ((DEBUG_INFO, "%a() - enter\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a() - enter\n", __func__));
 
   Variable     = NULL;
   VariableSize = 0;
@@ -835,7 +835,7 @@ GetSavedHddPasswordVariable (
     DEBUG ((DEBUG_INFO, "The variable node for the HDD password device is not found\n"));
   }
 
-  DEBUG ((DEBUG_INFO, "%a() - exit\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a() - exit\n", __func__));
 
   return Found;
 }
@@ -864,7 +864,7 @@ ValidateHddPassword (
   BOOLEAN                HashOk;
   UINT8                  HashData[SHA256_DIGEST_SIZE];
 
-  DEBUG ((DEBUG_INFO, "%a() - enter\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a() - enter\n", __func__));
 
   if (!GetSavedHddPasswordVariable (ConfigFormEntry, &HddPasswordVariable)) {
     DEBUG ((DEBUG_INFO, "GetSavedHddPasswordVariable failed\n"));
@@ -884,7 +884,7 @@ ValidateHddPassword (
     Status = EFI_SUCCESS;
   }
 
-  DEBUG ((DEBUG_INFO, "%a() - exit (%r)\n", __FUNCTION__, Status));
+  DEBUG ((DEBUG_INFO, "%a() - exit (%r)\n", __func__, Status));
   return Status;
 }
 
@@ -982,7 +982,7 @@ UnlockHddPassword (
 
   ZeroMem (Buffer, sizeof (Buffer));
 
-  DEBUG ((DEBUG_INFO, "%a() - %r\n", __FUNCTION__, Status));
+  DEBUG ((DEBUG_INFO, "%a() - %r\n", __func__, Status));
   return Status;
 }
 
@@ -1080,7 +1080,7 @@ DisableHddPassword (
 
   ZeroMem (Buffer, sizeof (Buffer));
 
-  DEBUG ((DEBUG_INFO, "%a() - %r\n", __FUNCTION__, Status));
+  DEBUG ((DEBUG_INFO, "%a() - %r\n", __func__, Status));
   return Status;
 }
 
@@ -1185,7 +1185,7 @@ SetHddPassword (
 
   ZeroMem (Buffer, sizeof (Buffer));
 
-  DEBUG ((DEBUG_INFO, "%a() - %r\n", __FUNCTION__, Status));
+  DEBUG ((DEBUG_INFO, "%a() - %r\n", __func__, Status));
   return Status;
 }
 
@@ -1357,7 +1357,7 @@ HddPasswordRequestPassword (
 
   RetryCount = 0;
 
-  DEBUG ((DEBUG_INFO, "%a()\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a()\n", __func__));
 
   UnicodeSPrint (PopUpString, sizeof (PopUpString), L"Unlock: %s", ConfigFormEntry->HddString);
 
@@ -1541,7 +1541,7 @@ ProcessHddPasswordRequestSetUserPwd (
 
   RetryCount = 0;
 
-  DEBUG ((DEBUG_INFO, "%a()\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a()\n", __func__));
 
   if (ConfigFormEntry->IfrData.SecurityStatus.Frozen) {
     DEBUG ((DEBUG_INFO, "%s is frozen, do nothing\n", ConfigFormEntry->HddString));
@@ -1685,7 +1685,7 @@ ProcessHddPasswordRequestSetMasterPwd (
 
   RetryCount = 0;
 
-  DEBUG ((DEBUG_INFO, "%a()\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a()\n", __func__));
 
   if (ConfigFormEntry->IfrData.SecurityStatus.Frozen) {
     DEBUG ((DEBUG_INFO, "%s is frozen, do nothing\n", ConfigFormEntry->HddString));
@@ -1812,7 +1812,7 @@ ProcessHddPasswordRequest (
   HDD_PASSWORD_REQUEST_VARIABLE  *Variable;
   UINTN                          VariableSize;
 
-  DEBUG ((DEBUG_INFO, "%a() - enter\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a() - enter\n", __func__));
 
   if (mHddPasswordRequestVariable == NULL) {
     Status = GetVariable2 (
@@ -1873,7 +1873,7 @@ ProcessHddPasswordRequest (
     TempVariable += 1;
   }
 
-  DEBUG ((DEBUG_INFO, "%a() - exit\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a() - exit\n", __func__));
 }
 
 /**
@@ -1892,7 +1892,7 @@ GetSavedHddPasswordRequest (
   HDD_PASSWORD_REQUEST_VARIABLE  *Variable;
   UINTN                          VariableSize;
 
-  DEBUG ((DEBUG_INFO, "%a() - enter\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a() - enter\n", __func__));
 
   Variable     = NULL;
   VariableSize = 0;
@@ -1934,7 +1934,7 @@ GetSavedHddPasswordRequest (
 
   FreePool (Variable);
 
-  DEBUG ((DEBUG_INFO, "%a() - exit\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a() - exit\n", __func__));
 }
 
 /**
@@ -1956,7 +1956,7 @@ SaveHddPasswordRequest (
   HDD_PASSWORD_REQUEST_VARIABLE  *NewVariable;
   UINTN                          NewVariableSize;
 
-  DEBUG ((DEBUG_INFO, "%a() - enter\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a() - enter\n", __func__));
 
   DEBUG ((
     DEBUG_INFO,
@@ -2047,7 +2047,7 @@ SaveHddPasswordRequest (
     FreePool (Variable);
   }
 
-  DEBUG ((DEBUG_INFO, "%a() - exit\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a() - exit\n", __func__));
 }
 
 /**
@@ -2865,7 +2865,7 @@ HddPasswordDxeInit (
                              HDD_PASSWORD_VARIABLE_NAME,
                              &mHddPasswordVendorGuid
                              );
-    DEBUG ((DEBUG_INFO, "%a(): Lock %s variable (%r)\n", __FUNCTION__, HDD_PASSWORD_VARIABLE_NAME, Status));
+    DEBUG ((DEBUG_INFO, "%a(): Lock %s variable (%r)\n", __func__, HDD_PASSWORD_VARIABLE_NAME, Status));
     ASSERT_EFI_ERROR (Status);
   }
 
diff --git a/SecurityPkg/HddPassword/HddPasswordPei.c b/SecurityPkg/HddPassword/HddPasswordPei.c
index a1c881599fa0..c56c00c685ac 100644
--- a/SecurityPkg/HddPassword/HddPasswordPei.c
+++ b/SecurityPkg/HddPassword/HddPasswordPei.c
@@ -103,7 +103,7 @@ UnlockDevice (
 
   ZeroMem (Buffer, sizeof (Buffer));
 
-  DEBUG ((DEBUG_INFO, "%a() - %r\n", __FUNCTION__, Status));
+  DEBUG ((DEBUG_INFO, "%a() - %r\n", __func__, Status));
   return Status;
 }
 
@@ -186,7 +186,7 @@ FreezeLockDevice (
 
   FreeAlignedPages (Asb, EFI_SIZE_TO_PAGES (sizeof (EFI_ATA_STATUS_BLOCK)));
 
-  DEBUG ((DEBUG_INFO, "%a() - %r\n", __FUNCTION__, Status));
+  DEBUG ((DEBUG_INFO, "%a() - %r\n", __func__, Status));
   return Status;
 }
 
@@ -321,11 +321,11 @@ HddPasswordAtaPassThruNotify (
   IN VOID                       *Ppi
   )
 {
-  DEBUG ((DEBUG_INFO, "%a() - enter at S3 resume\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a() - enter at S3 resume\n", __func__));
 
   UnlockHddPassword ((EDKII_PEI_ATA_PASS_THRU_PPI *)Ppi);
 
-  DEBUG ((DEBUG_INFO, "%a() - exit at S3 resume\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a() - exit at S3 resume\n", __func__));
 
   return EFI_SUCCESS;
 }
@@ -360,7 +360,7 @@ HddPasswordPeiInit (
     return EFI_UNSUPPORTED;
   }
 
-  DEBUG ((DEBUG_INFO, "%a: Enters in S3 path.\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a: Enters in S3 path.\n", __func__));
 
   Status = PeiServicesNotifyPpi (&mHddPasswordAtaPassThruPpiNotifyDesc);
   ASSERT_EFI_ERROR (Status);
diff --git a/SecurityPkg/Library/AuthVariableLib/AuthService.c b/SecurityPkg/Library/AuthVariableLib/AuthService.c
index 452ed491eaac..d81c581d7885 100644
--- a/SecurityPkg/Library/AuthVariableLib/AuthService.c
+++ b/SecurityPkg/Library/AuthVariableLib/AuthService.c
@@ -1126,7 +1126,7 @@ CalculatePrivAuthVarSignChainSHA256Digest (
   //
   Status = X509GetCommonName (SignerCert, SignerCertSize, CertCommonName, &CertCommonNameSize);
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_INFO, "%a Get SignerCert CommonName failed with status %x\n", __FUNCTION__, Status));
+    DEBUG ((DEBUG_INFO, "%a Get SignerCert CommonName failed with status %x\n", __func__, Status));
     return EFI_ABORTED;
   }
 
@@ -1134,7 +1134,7 @@ CalculatePrivAuthVarSignChainSHA256Digest (
   // Get TopLevelCert tbsCertificate
   //
   if (!X509GetTBSCert (TopLevelCert, TopLevelCertSize, &TbsCert, &TbsCertSize)) {
-    DEBUG ((DEBUG_INFO, "%a Get Top-level Cert tbsCertificate failed!\n", __FUNCTION__));
+    DEBUG ((DEBUG_INFO, "%a Get Top-level Cert tbsCertificate failed!\n", __func__));
     return EFI_ABORTED;
   }
 
diff --git a/SecurityPkg/Library/PeiDxeTpmPlatformHierarchyLib/PeiDxeTpmPlatformHierarchyLib.c b/SecurityPkg/Library/PeiDxeTpmPlatformHierarchyLib/PeiDxeTpmPlatformHierarchyLib.c
index b8838766bc45..cdb5248aff74 100644
--- a/SecurityPkg/Library/PeiDxeTpmPlatformHierarchyLib/PeiDxeTpmPlatformHierarchyLib.c
+++ b/SecurityPkg/Library/PeiDxeTpmPlatformHierarchyLib/PeiDxeTpmPlatformHierarchyLib.c
@@ -205,7 +205,7 @@ DisableTpmPlatformHierarchy (
   // Make sure that we have use of the TPM.
   Status = Tpm2RequestUseTpm ();
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "%a:%a() - Tpm2RequestUseTpm Failed! %r\n", gEfiCallerBaseName, __FUNCTION__, Status));
+    DEBUG ((DEBUG_ERROR, "%a:%a() - Tpm2RequestUseTpm Failed! %r\n", gEfiCallerBaseName, __func__, Status));
     ASSERT_EFI_ERROR (Status);
     return Status;
   }
@@ -224,9 +224,9 @@ DisableTpmPlatformHierarchy (
               TPM_RH_PLATFORM,     // Hierarchy
               NO                   // State
               );
-  DEBUG ((DEBUG_VERBOSE, "%a:%a() -  Disable PH = %r\n", gEfiCallerBaseName, __FUNCTION__, Status));
+  DEBUG ((DEBUG_VERBOSE, "%a:%a() -  Disable PH = %r\n", gEfiCallerBaseName, __func__, Status));
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "%a:%a() -  Disable PH Failed! %r\n", gEfiCallerBaseName, __FUNCTION__, Status));
+    DEBUG ((DEBUG_ERROR, "%a:%a() -  Disable PH Failed! %r\n", gEfiCallerBaseName, __func__, Status));
     ASSERT_EFI_ERROR (Status);
   }
 
diff --git a/SecurityPkg/Library/PlatformPKProtectionLibVarPolicy/PlatformPKProtectionLibVarPolicy.c b/SecurityPkg/Library/PlatformPKProtectionLibVarPolicy/PlatformPKProtectionLibVarPolicy.c
index a2649242246f..ac18fcd7026f 100644
--- a/SecurityPkg/Library/PlatformPKProtectionLibVarPolicy/PlatformPKProtectionLibVarPolicy.c
+++ b/SecurityPkg/Library/PlatformPKProtectionLibVarPolicy/PlatformPKProtectionLibVarPolicy.c
@@ -33,7 +33,7 @@ DisablePKProtection (
   EFI_STATUS                      Status;
   EDKII_VARIABLE_POLICY_PROTOCOL  *VariablePolicy;
 
-  DEBUG ((DEBUG_INFO, "%a() Entry...\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a() Entry...\n", __func__));
 
   // IMPORTANT NOTE: This operation is sticky and leaves variable protections disabled.
   //                  The system *MUST* be reset after performing this operation.
diff --git a/SecurityPkg/Library/SecureBootVariableLib/SecureBootVariableLib.c b/SecurityPkg/Library/SecureBootVariableLib/SecureBootVariableLib.c
index abca249c6504..24599c7a0ba3 100644
--- a/SecurityPkg/Library/SecureBootVariableLib/SecureBootVariableLib.c
+++ b/SecurityPkg/Library/SecureBootVariableLib/SecureBootVariableLib.c
@@ -276,7 +276,7 @@ CreateTimeBasedPayload (
   UINTN                          DescriptorSize;
 
   if ((Data == NULL) || (DataSize == NULL) || (Time == NULL)) {
-    DEBUG ((DEBUG_ERROR, "%a(), invalid arg\n", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a(), invalid arg\n", __func__));
     return EFI_INVALID_PARAMETER;
   }
 
@@ -292,7 +292,7 @@ CreateTimeBasedPayload (
   DescriptorSize = OFFSET_OF (EFI_VARIABLE_AUTHENTICATION_2, AuthInfo) + OFFSET_OF (WIN_CERTIFICATE_UEFI_GUID, CertData);
   NewData        = (UINT8 *)AllocateZeroPool (DescriptorSize + PayloadSize);
   if (NewData == NULL) {
-    DEBUG ((DEBUG_ERROR, "%a() Out of resources.\n", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a() Out of resources.\n", __func__));
     return EFI_OUT_OF_RESOURCES;
   }
 
@@ -603,13 +603,13 @@ DeleteSecureBootVariables (
 {
   EFI_STATUS  Status, TempStatus;
 
-  DEBUG ((DEBUG_INFO, "%a - Attempting to delete the Secure Boot variables.\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a - Attempting to delete the Secure Boot variables.\n", __func__));
 
   //
   // Step 1: Notify that a PK update is coming shortly...
   Status = DisablePKProtection ();
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "%a - Failed to signal PK update start! %r\n", __FUNCTION__, Status));
+    DEBUG ((DEBUG_ERROR, "%a - Failed to signal PK update start! %r\n", __func__, Status));
     // Classify this as a PK deletion error.
     Status = EFI_ABORTED;
   }
@@ -619,7 +619,7 @@ DeleteSecureBootVariables (
   // Let's try to nuke the PK, why not...
   if (!EFI_ERROR (Status)) {
     Status = DeletePlatformKey ();
-    DEBUG ((DEBUG_INFO, "%a - PK Delete = %r\n", __FUNCTION__, Status));
+    DEBUG ((DEBUG_INFO, "%a - PK Delete = %r\n", __func__, Status));
     // If the PK is not found, then our work here is done.
     if (Status == EFI_NOT_FOUND) {
       Status = EFI_SUCCESS;
@@ -646,25 +646,25 @@ DeleteSecureBootVariables (
     // the variables anyway.
     //
     TempStatus = DeleteKEK ();
-    DEBUG ((DEBUG_INFO, "%a - KEK Delete = %r\n", __FUNCTION__, TempStatus));
+    DEBUG ((DEBUG_INFO, "%a - KEK Delete = %r\n", __func__, TempStatus));
     if (EFI_ERROR (TempStatus) && (TempStatus != EFI_NOT_FOUND)) {
       Status = EFI_ACCESS_DENIED;
     }
 
     TempStatus = DeleteDb ();
-    DEBUG ((DEBUG_INFO, "%a - db Delete = %r\n", __FUNCTION__, TempStatus));
+    DEBUG ((DEBUG_INFO, "%a - db Delete = %r\n", __func__, TempStatus));
     if (EFI_ERROR (TempStatus) && (TempStatus != EFI_NOT_FOUND)) {
       Status = EFI_ACCESS_DENIED;
     }
 
     TempStatus = DeleteDbx ();
-    DEBUG ((DEBUG_INFO, "%a - dbx Delete = %r\n", __FUNCTION__, TempStatus));
+    DEBUG ((DEBUG_INFO, "%a - dbx Delete = %r\n", __func__, TempStatus));
     if (EFI_ERROR (TempStatus) && (TempStatus != EFI_NOT_FOUND)) {
       Status = EFI_ACCESS_DENIED;
     }
 
     TempStatus = DeleteDbt ();
-    DEBUG ((DEBUG_INFO, "%a - dbt Delete = %r\n", __FUNCTION__, TempStatus));
+    DEBUG ((DEBUG_INFO, "%a - dbt Delete = %r\n", __func__, TempStatus));
     if (EFI_ERROR (TempStatus) && (TempStatus != EFI_NOT_FOUND)) {
       Status = EFI_ACCESS_DENIED;
     }
@@ -752,7 +752,7 @@ EnrollFromInput (
     DEBUG ((
       DEBUG_ERROR,
       "error: %a (\"%s\", %g): %r\n",
-      __FUNCTION__,
+      __func__,
       VariableName,
       VendorGuid,
       Status
@@ -795,21 +795,21 @@ SetSecureBootVariablesToDefault (
   UINT8       *Data;
   UINTN       DataSize;
 
-  DEBUG ((DEBUG_INFO, "%a() Entry\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a() Entry\n", __func__));
 
   if (SecureBootPayload == NULL) {
-    DEBUG ((DEBUG_ERROR, "%a - Invalid SecureBoot payload is supplied!\n", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a - Invalid SecureBoot payload is supplied!\n", __func__));
     return EFI_INVALID_PARAMETER;
   }
 
   //
   // Right off the bat, if SecureBoot is currently enabled, bail.
   if (IsSecureBootEnabled ()) {
-    DEBUG ((DEBUG_ERROR, "%a - Cannot set default keys while SecureBoot is enabled!\n", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a - Cannot set default keys while SecureBoot is enabled!\n", __func__));
     return EFI_ABORTED;
   }
 
-  DEBUG ((DEBUG_INFO, "%a - Setting up key %s!\n", __FUNCTION__, SecureBootPayload->SecureBootKeyName));
+  DEBUG ((DEBUG_INFO, "%a - Setting up key %s!\n", __func__, SecureBootPayload->SecureBootKeyName));
 
   //
   // Start running down the list, creating variables in our wake.
@@ -834,10 +834,10 @@ SetSecureBootVariablesToDefault (
                  Data
                  );
     if (EFI_ERROR (Status)) {
-      DEBUG ((DEBUG_ERROR, "%a - Failed to enroll DB %r!\n", __FUNCTION__, Status));
+      DEBUG ((DEBUG_ERROR, "%a - Failed to enroll DB %r!\n", __func__, Status));
     }
   } else {
-    DEBUG ((DEBUG_ERROR, "%a - Failed to enroll DBX %r!\n", __FUNCTION__, Status));
+    DEBUG ((DEBUG_ERROR, "%a - Failed to enroll DBX %r!\n", __func__, Status));
   }
 
   // Keep it going. Keep it going. dbt if supplied...
@@ -851,7 +851,7 @@ SetSecureBootVariablesToDefault (
                  Data
                  );
     if (EFI_ERROR (Status)) {
-      DEBUG ((DEBUG_ERROR, "%a - Failed to enroll DBT %r!\n", __FUNCTION__, Status));
+      DEBUG ((DEBUG_ERROR, "%a - Failed to enroll DBT %r!\n", __func__, Status));
     }
   }
 
@@ -866,7 +866,7 @@ SetSecureBootVariablesToDefault (
                  Data
                  );
     if (EFI_ERROR (Status)) {
-      DEBUG ((DEBUG_ERROR, "%a - Failed to enroll KEK %r!\n", __FUNCTION__, Status));
+      DEBUG ((DEBUG_ERROR, "%a - Failed to enroll KEK %r!\n", __func__, Status));
     }
   }
 
@@ -889,7 +889,7 @@ SetSecureBootVariablesToDefault (
     //
     // Report PK creation errors.
     if (EFI_ERROR (Status)) {
-      DEBUG ((DEBUG_ERROR, "%a - Failed to update the PK! - %r\n", __FUNCTION__, Status));
+      DEBUG ((DEBUG_ERROR, "%a - Failed to update the PK! - %r\n", __func__, Status));
       Status = EFI_SECURITY_VIOLATION;
     }
   }
diff --git a/SecurityPkg/Library/SecureBootVariableLib/UnitTest/SecureBootVariableLibUnitTest.c b/SecurityPkg/Library/SecureBootVariableLib/UnitTest/SecureBootVariableLibUnitTest.c
index a23135dfb016..bff288295b00 100644
--- a/SecurityPkg/Library/SecureBootVariableLib/UnitTest/SecureBootVariableLibUnitTest.c
+++ b/SecurityPkg/Library/SecureBootVariableLib/UnitTest/SecureBootVariableLibUnitTest.c
@@ -82,7 +82,7 @@ MockSetVariable (
   DEBUG ((
     DEBUG_INFO,
     "%a %s %g %x %x %p\n",
-    __FUNCTION__,
+    __func__,
     VariableName,
     VendorGuid,
     Attributes,
@@ -139,7 +139,7 @@ MockGetVariable (
   DEBUG ((
     DEBUG_INFO,
     "%a %s %g %p %x %p\n",
-    __FUNCTION__,
+    __func__,
     VariableName,
     VendorGuid,
     Attributes,
diff --git a/SecurityPkg/Library/SecureBootVariableProvisionLib/SecureBootVariableProvisionLib.c b/SecurityPkg/Library/SecureBootVariableProvisionLib/SecureBootVariableProvisionLib.c
index bed1fe86205d..d6046c85d247 100644
--- a/SecurityPkg/Library/SecureBootVariableProvisionLib/SecureBootVariableProvisionLib.c
+++ b/SecurityPkg/Library/SecureBootVariableProvisionLib/SecureBootVariableProvisionLib.c
@@ -81,7 +81,7 @@ SecureBootFetchData (
     if (Status == EFI_SUCCESS) {
       RsaPubKey = NULL;
       if (RsaGetPublicKeyFromX509 (Buffer, Size, &RsaPubKey) == FALSE) {
-        DEBUG ((DEBUG_ERROR, "%a: Invalid key format: %d\n", __FUNCTION__, KeyIndex));
+        DEBUG ((DEBUG_ERROR, "%a: Invalid key format: %d\n", __func__, KeyIndex));
         if (EfiSig != NULL) {
           FreePool (EfiSig);
         }
diff --git a/SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c b/SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c
index f127757ad9f0..e2e77cbc247a 100644
--- a/SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c
+++ b/SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c
@@ -491,7 +491,7 @@ OpalEndOfDxeEventNotify (
 {
   OPAL_DRIVER_DEVICE  *TmpDev;
 
-  DEBUG ((DEBUG_INFO, "%a() - enter\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a() - enter\n", __func__));
 
   mOpalEndOfDxe = TRUE;
 
@@ -529,7 +529,7 @@ OpalEndOfDxeEventNotify (
   //
   SendBlockSidCommand ();
 
-  DEBUG ((DEBUG_INFO, "%a() - exit\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a() - exit\n", __func__));
 
   gBS->CloseEvent (Event);
 }
@@ -888,7 +888,7 @@ OpalDriverRequestPassword (
     return;
   }
 
-  DEBUG ((DEBUG_INFO, "%a()\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a()\n", __func__));
 
   PopUpString = OpalGetPopUpString (Dev, RequestString);
 
@@ -1074,7 +1074,7 @@ ProcessOpalRequestEnableFeature (
     return;
   }
 
-  DEBUG ((DEBUG_INFO, "%a()\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a()\n", __func__));
 
   PopUpString = OpalGetPopUpString (Dev, RequestString);
 
@@ -1223,7 +1223,7 @@ ProcessOpalRequestDisableUser (
     return;
   }
 
-  DEBUG ((DEBUG_INFO, "%a()\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a()\n", __func__));
 
   PopUpString = OpalGetPopUpString (Dev, RequestString);
 
@@ -1339,7 +1339,7 @@ ProcessOpalRequestPsidRevert (
     return;
   }
 
-  DEBUG ((DEBUG_INFO, "%a()\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a()\n", __func__));
 
   PopUpString = OpalGetPopUpString (Dev, RequestString);
 
@@ -1478,7 +1478,7 @@ ProcessOpalRequestRevert (
     return;
   }
 
-  DEBUG ((DEBUG_INFO, "%a()\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a()\n", __func__));
 
   PopUpString = OpalGetPopUpString (Dev, RequestString);
 
@@ -1646,7 +1646,7 @@ ProcessOpalRequestSecureErase (
     return;
   }
 
-  DEBUG ((DEBUG_INFO, "%a()\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a()\n", __func__));
 
   PopUpString = OpalGetPopUpString (Dev, RequestString);
 
@@ -1784,7 +1784,7 @@ ProcessOpalRequestSetUserPwd (
     return;
   }
 
-  DEBUG ((DEBUG_INFO, "%a()\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a()\n", __func__));
 
   PopUpString = OpalGetPopUpString (Dev, RequestString);
 
@@ -1990,7 +1990,7 @@ ProcessOpalRequestSetAdminPwd (
     return;
   }
 
-  DEBUG ((DEBUG_INFO, "%a()\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a()\n", __func__));
 
   PopUpString = OpalGetPopUpString (Dev, RequestString);
 
@@ -2182,7 +2182,7 @@ ProcessOpalRequest (
   UINTN                     DevicePathSize;
   BOOLEAN                   KeepUserData;
 
-  DEBUG ((DEBUG_INFO, "%a() - enter\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a() - enter\n", __func__));
 
   if (mOpalRequestVariable == NULL) {
     Status = GetVariable2 (
@@ -2278,7 +2278,7 @@ ProcessOpalRequest (
     TempVariable  = (OPAL_REQUEST_VARIABLE *)((UINTN)TempVariable + TempVariable->Length);
   }
 
-  DEBUG ((DEBUG_INFO, "%a() - exit\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a() - exit\n", __func__));
 }
 
 /**
diff --git a/SecurityPkg/Tcg/Opal/OpalPassword/OpalHii.c b/SecurityPkg/Tcg/Opal/OpalPassword/OpalHii.c
index c4f96bee8a3e..8035f44ebebb 100644
--- a/SecurityPkg/Tcg/Opal/OpalPassword/OpalHii.c
+++ b/SecurityPkg/Tcg/Opal/OpalPassword/OpalHii.c
@@ -95,7 +95,7 @@ GetSavedOpalRequest (
   EFI_DEVICE_PATH_PROTOCOL  *DevicePath;
   UINTN                     DevicePathSize;
 
-  DEBUG ((DEBUG_INFO, "%a() - enter\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a() - enter\n", __func__));
 
   Variable     = NULL;
   VariableSize = 0;
@@ -141,7 +141,7 @@ GetSavedOpalRequest (
 
   FreePool (Variable);
 
-  DEBUG ((DEBUG_INFO, "%a() - exit\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a() - exit\n", __func__));
 }
 
 /**
@@ -169,7 +169,7 @@ SaveOpalRequest (
   EFI_DEVICE_PATH_PROTOCOL  *DevicePath;
   UINTN                     DevicePathSize;
 
-  DEBUG ((DEBUG_INFO, "%a() - enter\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a() - enter\n", __func__));
 
   DEBUG ((
     DEBUG_INFO,
@@ -264,7 +264,7 @@ SaveOpalRequest (
     FreePool (Variable);
   }
 
-  DEBUG ((DEBUG_INFO, "%a() - exit\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a() - exit\n", __func__));
 }
 
 /**
diff --git a/SecurityPkg/Tcg/Opal/OpalPassword/OpalPasswordPei.c b/SecurityPkg/Tcg/Opal/OpalPassword/OpalPasswordPei.c
index c998b50be5e8..0fb6b1bf41d5 100644
--- a/SecurityPkg/Tcg/Opal/OpalPassword/OpalPasswordPei.c
+++ b/SecurityPkg/Tcg/Opal/OpalPassword/OpalPasswordPei.c
@@ -280,7 +280,7 @@ UnlockOpalPassword (
     DEBUG ((
       DEBUG_INFO,
       "%a() OpalUtilUpdateGlobalLockingRange() Result = 0x%x\n",
-      __FUNCTION__,
+      __func__,
       Result
       ));
   }
@@ -302,7 +302,7 @@ UnlockOpalPassword (
     DEBUG ((
       DEBUG_INFO,
       "%a() OpalBlockSid() Result = 0x%x\n",
-      __FUNCTION__,
+      __func__,
       Result
       ));
   }
@@ -427,11 +427,11 @@ OpalPasswordStorageSecurityPpiNotify (
   IN VOID                       *Ppi
   )
 {
-  DEBUG ((DEBUG_INFO, "%a entered at S3 resume!\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a entered at S3 resume!\n", __func__));
 
   UnlockOpalPasswordDevices ((EDKII_PEI_STORAGE_SECURITY_CMD_PPI *)Ppi);
 
-  DEBUG ((DEBUG_INFO, "%a exit at S3 resume!\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a exit at S3 resume!\n", __func__));
 
   return EFI_SUCCESS;
 }
@@ -466,7 +466,7 @@ OpalPasswordPeiInit (
     return EFI_UNSUPPORTED;
   }
 
-  DEBUG ((DEBUG_INFO, "%a: Enters in S3 path.\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a: Enters in S3 path.\n", __func__));
 
   Status = PeiServicesNotifyPpi (&mOpalPasswordStorageSecurityPpiNotifyDesc);
   ASSERT_EFI_ERROR (Status);
diff --git a/SecurityPkg/Tcg/Tcg2Acpi/Tcg2Acpi.c b/SecurityPkg/Tcg/Tcg2Acpi/Tcg2Acpi.c
index e8822cbeb015..76123fc51a53 100644
--- a/SecurityPkg/Tcg/Tcg2Acpi/Tcg2Acpi.c
+++ b/SecurityPkg/Tcg/Tcg2Acpi/Tcg2Acpi.c
@@ -188,14 +188,14 @@ ExchangeCommonBuffer (
 
   // Step 0: Sanity check for input argument
   if (TcgNvs == NULL) {
-    DEBUG ((DEBUG_ERROR, "%a - Input argument is NULL!\n", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a - Input argument is NULL!\n", __func__));
     return EFI_INVALID_PARAMETER;
   }
 
   // Step 1: Grab the common buffer header
   Status = EfiGetSystemConfigurationTable (&gEdkiiPiSmmCommunicationRegionTableGuid, (VOID **)&PiSmmCommunicationRegionTable);
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "%a - Failed to locate SMM communciation common buffer - %r!\n", __FUNCTION__, Status));
+    DEBUG ((DEBUG_ERROR, "%a - Failed to locate SMM communciation common buffer - %r!\n", __func__, Status));
     return Status;
   }
 
@@ -215,7 +215,7 @@ ExchangeCommonBuffer (
 
   if (Index >= PiSmmCommunicationRegionTable->NumberOfEntries) {
     // Could not find one that meets our goal...
-    DEBUG ((DEBUG_ERROR, "%a - Could not find a common buffer that is big enough for NVS!\n", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a - Could not find a common buffer that is big enough for NVS!\n", __func__));
     return EFI_OUT_OF_RESOURCES;
   }
 
@@ -236,9 +236,9 @@ ExchangeCommonBuffer (
   Status = gBS->LocateProtocol (&gEfiMmCommunicationProtocolGuid, NULL, (VOID **)&MmCommunication);
   if (!EFI_ERROR (Status)) {
     Status = MmCommunication->Communicate (MmCommunication, CommHeader, &CommBufferSize);
-    DEBUG ((DEBUG_INFO, "%a - Communicate() = %r\n", __FUNCTION__, Status));
+    DEBUG ((DEBUG_INFO, "%a - Communicate() = %r\n", __func__, Status));
   } else {
-    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));
     return Status;
   }
 
@@ -250,7 +250,7 @@ ExchangeCommonBuffer (
     DEBUG ((
       DEBUG_INFO,
       "%a Communication returned software SMI value. PP: 0x%x; MC: 0x%x.\n",
-      __FUNCTION__,
+      __func__,
       TcgNvs->PhysicalPresence.SoftwareSmi,
       TcgNvs->MemoryClear.SoftwareSmi
       ));
diff --git a/SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c b/SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c
index 26bb5282a58b..1caaa4e319bc 100644
--- a/SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c
+++ b/SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c
@@ -312,10 +312,10 @@ SyncPcrAllocationsAndPcrMask (
     NewTpmActivePcrBanks &= BiosHashAlgorithmBitmap;
     DEBUG ((DEBUG_INFO, "NewTpmActivePcrBanks 0x%08x\n", NewTpmActivePcrBanks));
 
-    DEBUG ((DEBUG_INFO, "%a - Reallocating PCR banks from 0x%X to 0x%X.\n", __FUNCTION__, TpmActivePcrBanks, NewTpmActivePcrBanks));
+    DEBUG ((DEBUG_INFO, "%a - Reallocating PCR banks from 0x%X to 0x%X.\n", __func__, TpmActivePcrBanks, NewTpmActivePcrBanks));
 
     if (NewTpmActivePcrBanks == 0) {
-      DEBUG ((DEBUG_ERROR, "%a - No viable PCRs active! Please set a less restrictive value for PcdTpm2HashMask!\n", __FUNCTION__));
+      DEBUG ((DEBUG_ERROR, "%a - No viable PCRs active! Please set a less restrictive value for PcdTpm2HashMask!\n", __func__));
       ASSERT (FALSE);
     } else {
       DEBUG ((DEBUG_ERROR, "Tpm2PcrAllocateBanks (TpmHashAlgorithmBitmap: 0x%08x, NewTpmActivePcrBanks: 0x%08x)\n", TpmHashAlgorithmBitmap, NewTpmActivePcrBanks));
@@ -324,7 +324,7 @@ SyncPcrAllocationsAndPcrMask (
         //
         // We can't do much here, but we hope that this doesn't happen.
         //
-        DEBUG ((DEBUG_ERROR, "%a - Failed to reallocate PCRs!\n", __FUNCTION__));
+        DEBUG ((DEBUG_ERROR, "%a - Failed to reallocate PCRs!\n", __func__));
         ASSERT_EFI_ERROR (Status);
       }
 
@@ -342,9 +342,9 @@ SyncPcrAllocationsAndPcrMask (
   if ((Tpm2PcrMask & TpmHashAlgorithmBitmap) != Tpm2PcrMask) {
     NewTpm2PcrMask = Tpm2PcrMask & TpmHashAlgorithmBitmap;
 
-    DEBUG ((DEBUG_INFO, "%a - Updating PcdTpm2HashMask from 0x%X to 0x%X.\n", __FUNCTION__, Tpm2PcrMask, NewTpm2PcrMask));
+    DEBUG ((DEBUG_INFO, "%a - Updating PcdTpm2HashMask from 0x%X to 0x%X.\n", __func__, Tpm2PcrMask, NewTpm2PcrMask));
     if (NewTpm2PcrMask == 0) {
-      DEBUG ((DEBUG_ERROR, "%a - No viable PCRs supported! Please set a less restrictive value for PcdTpm2HashMask!\n", __FUNCTION__));
+      DEBUG ((DEBUG_ERROR, "%a - No viable PCRs supported! Please set a less restrictive value for PcdTpm2HashMask!\n", __func__));
       ASSERT (FALSE);
     }
 
diff --git a/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c b/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c
index 498fb626bd9c..c47c582cc8d2 100644
--- a/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c
+++ b/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c
@@ -57,7 +57,7 @@ TpmNvsCommunciate (
   UINTN                   TempCommBufferSize;
   TPM_NVS_MM_COMM_BUFFER  *CommParams;
 
-  DEBUG ((DEBUG_VERBOSE, "%a()\n", __FUNCTION__));
+  DEBUG ((DEBUG_VERBOSE, "%a()\n", __func__));
 
   //
   // If input is invalid, stop processing this SMI
@@ -69,12 +69,12 @@ TpmNvsCommunciate (
   TempCommBufferSize = *CommBufferSize;
 
   if (TempCommBufferSize != sizeof (TPM_NVS_MM_COMM_BUFFER)) {
-    DEBUG ((DEBUG_ERROR, "[%a] MM Communication buffer size is invalid for this handler!\n", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "[%a] MM Communication buffer size is invalid for this handler!\n", __func__));
     return EFI_ACCESS_DENIED;
   }
 
   if (!IsBufferOutsideMmValid ((UINTN)CommBuffer, TempCommBufferSize)) {
-    DEBUG ((DEBUG_ERROR, "[%a] - MM Communication buffer in invalid location!\n", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "[%a] - MM Communication buffer in invalid location!\n", __func__));
     return EFI_ACCESS_DENIED;
   }
 
@@ -85,14 +85,14 @@ TpmNvsCommunciate (
   Status     = EFI_SUCCESS;
   switch (CommParams->Function) {
     case TpmNvsMmExchangeInfo:
-      DEBUG ((DEBUG_VERBOSE, "[%a] - Function requested: MM_EXCHANGE_NVS_INFO\n", __FUNCTION__));
+      DEBUG ((DEBUG_VERBOSE, "[%a] - Function requested: MM_EXCHANGE_NVS_INFO\n", __func__));
       CommParams->RegisteredPpSwiValue = mPpSoftwareSmi;
       CommParams->RegisteredMcSwiValue = mMcSoftwareSmi;
       mTcgNvs                          = (TCG_NVS *)(UINTN)CommParams->TargetAddress;
       break;
 
     default:
-      DEBUG ((DEBUG_INFO, "[%a] - Unknown function %d!\n", __FUNCTION__, CommParams->Function));
+      DEBUG ((DEBUG_INFO, "[%a] - Unknown function %d!\n", __func__, CommParams->Function));
       Status = EFI_UNSUPPORTED;
       break;
   }
@@ -301,7 +301,7 @@ InitializeTcgCommon (
   Status = gMmst->MmiHandlerRegister (TpmNvsCommunciate, &gTpmNvsMmGuid, &mReadyToLockHandle);
   ASSERT_EFI_ERROR (Status);
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "[%a] Failed to register NVS communicate as root MM handler - %r!\n", __FUNCTION__, Status));
+    DEBUG ((DEBUG_ERROR, "[%a] Failed to register NVS communicate as root MM handler - %r!\n", __func__, Status));
     goto Cleanup;
   }
 
@@ -311,7 +311,7 @@ InitializeTcgCommon (
   Status = gMmst->MmLocateProtocol (&gEfiSmmSwDispatch2ProtocolGuid, NULL, (VOID **)&SwDispatch);
   ASSERT_EFI_ERROR (Status);
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "[%a] Failed to locate Sw dispatch protocol - %r!\n", __FUNCTION__, Status));
+    DEBUG ((DEBUG_ERROR, "[%a] Failed to locate Sw dispatch protocol - %r!\n", __func__, Status));
     goto Cleanup;
   }
 
@@ -319,7 +319,7 @@ InitializeTcgCommon (
   Status                    = SwDispatch->Register (SwDispatch, PhysicalPresenceCallback, &SwContext, &PpSwHandle);
   ASSERT_EFI_ERROR (Status);
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "[%a] Failed to register PP callback as SW MM handler - %r!\n", __FUNCTION__, Status));
+    DEBUG ((DEBUG_ERROR, "[%a] Failed to register PP callback as SW MM handler - %r!\n", __func__, Status));
     goto Cleanup;
   }
 
@@ -329,7 +329,7 @@ InitializeTcgCommon (
   Status                    = SwDispatch->Register (SwDispatch, MemoryClearCallback, &SwContext, &McSwHandle);
   ASSERT_EFI_ERROR (Status);
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "[%a] Failed to register MC callback as SW MM handler - %r!\n", __FUNCTION__, Status));
+    DEBUG ((DEBUG_ERROR, "[%a] Failed to register MC callback as SW MM handler - %r!\n", __func__, Status));
     goto Cleanup;
   }
 
@@ -342,7 +342,7 @@ InitializeTcgCommon (
   ASSERT_EFI_ERROR (Status);
   if (EFI_ERROR (Status)) {
     // Should not happen
-    DEBUG ((DEBUG_ERROR, "[%a] Failed to locate SMM variable protocol - %r!\n", __FUNCTION__, Status));
+    DEBUG ((DEBUG_ERROR, "[%a] Failed to locate SMM variable protocol - %r!\n", __func__, Status));
     goto Cleanup;
   }
 
@@ -350,7 +350,7 @@ InitializeTcgCommon (
   Status = gMmst->MmRegisterProtocolNotify (&gEfiMmReadyToLockProtocolGuid, TcgMmReadyToLock, &NotifyHandle);
   ASSERT_EFI_ERROR (Status);
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "[%a] Failed to register ready to lock notification - %r!\n", __FUNCTION__, Status));
+    DEBUG ((DEBUG_ERROR, "[%a] Failed to register ready to lock notification - %r!\n", __func__, Status));
     goto Cleanup;
   }
 
diff --git a/SecurityPkg/Tcg/TdTcg2Dxe/TdTcg2Dxe.c b/SecurityPkg/Tcg/TdTcg2Dxe/TdTcg2Dxe.c
index b34da724ac42..6ca29f5de0df 100644
--- a/SecurityPkg/Tcg/TdTcg2Dxe/TdTcg2Dxe.c
+++ b/SecurityPkg/Tcg/TdTcg2Dxe/TdTcg2Dxe.c
@@ -1353,12 +1353,12 @@ TdHashLogExtendEvent (
   }
 
   if (CcEvent->Header.MrIndex == CC_MR_INDEX_0_MRTD) {
-    DEBUG ((DEBUG_ERROR, "%a: MRTD cannot be extended in TDVF.\n", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a: MRTD cannot be extended in TDVF.\n", __func__));
     return EFI_INVALID_PARAMETER;
   }
 
   if (CcEvent->Header.MrIndex >= CC_MR_INDEX_INVALID) {
-    DEBUG ((DEBUG_ERROR, "%a: MrIndex is invalid. (%d)\n", __FUNCTION__, CcEvent->Header.MrIndex));
+    DEBUG ((DEBUG_ERROR, "%a: MrIndex is invalid. (%d)\n", __func__, CcEvent->Header.MrIndex));
     return EFI_INVALID_PARAMETER;
   }
 
@@ -2514,7 +2514,7 @@ DriverEntry (
     //
     // Cc measurement feature is crucial to a td-guest and it shall stop running immediately
     // when it is failed to be installed.
-    DEBUG ((DEBUG_ERROR, "%a: CcMeasurement protocol failed to be installed - %r\n", __FUNCTION__, Status));
+    DEBUG ((DEBUG_ERROR, "%a: CcMeasurement protocol failed to be installed - %r\n", __func__, Status));
     CpuDeadLoop ();
   }
 
diff --git a/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.c b/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.c
index 4299a6b5e56d..0e31502b1bfc 100644
--- a/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.c
+++ b/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.c
@@ -167,7 +167,7 @@ GetCurrentTime (
     DEBUG ((
       DEBUG_ERROR,
       "%a(), GetTime() failed, status = '%r'\n",
-      __FUNCTION__,
+      __func__,
       Status
       ));
     return Status;
diff --git a/SecurityPkg/VariableAuthenticated/SecureBootDefaultKeysDxe/SecureBootDefaultKeysDxe.c b/SecurityPkg/VariableAuthenticated/SecureBootDefaultKeysDxe/SecureBootDefaultKeysDxe.c
index 0abde52a05ae..2f6f3e6796bf 100644
--- a/SecurityPkg/VariableAuthenticated/SecureBootDefaultKeysDxe/SecureBootDefaultKeysDxe.c
+++ b/SecurityPkg/VariableAuthenticated/SecureBootDefaultKeysDxe/SecureBootDefaultKeysDxe.c
@@ -42,35 +42,35 @@ SecureBootDefaultKeysEntryPoint (
 
   Status = SecureBootInitPKDefault ();
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "%a: Cannot initialize PKDefault: %r\n", __FUNCTION__, Status));
+    DEBUG ((DEBUG_ERROR, "%a: Cannot initialize PKDefault: %r\n", __func__, Status));
     return Status;
   }
 
   Status = SecureBootInitKEKDefault ();
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "%a: Cannot initialize KEKDefault: %r\n", __FUNCTION__, Status));
+    DEBUG ((DEBUG_ERROR, "%a: Cannot initialize KEKDefault: %r\n", __func__, Status));
     return Status;
   }
 
   Status = SecureBootInitDbDefault ();
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "%a: Cannot initialize dbDefault: %r\n", __FUNCTION__, Status));
+    DEBUG ((DEBUG_ERROR, "%a: Cannot initialize dbDefault: %r\n", __func__, Status));
     return Status;
   }
 
   Status = SecureBootInitDbtDefault ();
   if (Status == EFI_NOT_FOUND) {
-    DEBUG ((DEBUG_INFO, "%a: dbtDefault not initialized\n", __FUNCTION__));
+    DEBUG ((DEBUG_INFO, "%a: dbtDefault not initialized\n", __func__));
   } else if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "%a: Cannot initialize dbtDefault: %r\n", __FUNCTION__, Status));
+    DEBUG ((DEBUG_ERROR, "%a: Cannot initialize dbtDefault: %r\n", __func__, Status));
     return Status;
   }
 
   Status = SecureBootInitDbxDefault ();
   if (Status == EFI_NOT_FOUND) {
-    DEBUG ((DEBUG_INFO, "%a: dbxDefault not initialized\n", __FUNCTION__));
+    DEBUG ((DEBUG_INFO, "%a: dbxDefault not initialized\n", __func__));
   } else if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "%a: Cannot initialize dbxDefault: %r\n", __FUNCTION__, Status));
+    DEBUG ((DEBUG_ERROR, "%a: Cannot initialize dbxDefault: %r\n", __func__, Status));
     return Status;
   }
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 07/18] EmbeddedPkg: Update code to be more C11 compliant by using __func__
  2023-04-06 22:23 [PATCH 00/18] Replace pre-standard macro __FUNCTION__ with C99 __func__ throughout edk2 Rebecca Cran
                   ` (5 preceding siblings ...)
  2023-04-06 22:23 ` [PATCH 06/18] SecurityPkg: " Rebecca Cran
@ 2023-04-06 22:23 ` Rebecca Cran
  2023-04-07  8:25   ` Chang, Abner
  2023-04-06 22:23 ` [PATCH 08/18] RedfishPkg: " Rebecca Cran
                   ` (13 subsequent siblings)
  20 siblings, 1 reply; 34+ messages in thread
From: Rebecca Cran @ 2023-04-06 22:23 UTC (permalink / raw)
  To: devel, Liming Gao, Michael D Kinney, Guomin Jiang, Wei6 Xu,
	Guo Dong, Ray Ni, Sean Rhodes, James Lu, Gua Guo, Andrew Fish,
	Hao A Wu, Maciej Rabeda, Siyuan Fu, Jiewen Yao, Jian J Wang,
	Xiaoyu Lu, Ard Biesheuvel, Sami Mujawar, Supreeth Venkatesh,
	Michael Kubacki, Nate DeSimone, Sean Brogan
  Cc: Rebecca Cran, Leif Lindholm, Abner Chang, Nickle Wang,
	Igor Kulchytskyy, Daniel Schaefer, Min Xu, Jordan Justen,
	Gerd Hoffmann, Peter Grehan, Erdem Aktas, James Bottomley,
	Tom Lendacky, Michael Roth, Sunil V L, Andrei Warkentin

__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
EmbeddedPkg.

Visual Studio versions before VS 2015 don't support __func__ and so
will fail to compile. A workaround is to define __func__ as
__FUNCTION__ :

  #define __func__ __FUNCTION__

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
---
 EmbeddedPkg/Drivers/ConsolePrefDxe/ConsolePrefDxe.c       | 18 ++++++++--------
 EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.c         | 10 ++++-----
 EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.c           | 22 ++++++++++----------
 EmbeddedPkg/Library/NonCoherentDmaLib/NonCoherentDmaLib.c |  2 +-
 EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClock.c       |  2 +-
 EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c          | 20 +++++++++---------
 6 files changed, 37 insertions(+), 37 deletions(-)

diff --git a/EmbeddedPkg/Drivers/ConsolePrefDxe/ConsolePrefDxe.c b/EmbeddedPkg/Drivers/ConsolePrefDxe/ConsolePrefDxe.c
index 07b82892eb0f..2c2e73e72076 100644
--- a/EmbeddedPkg/Drivers/ConsolePrefDxe/ConsolePrefDxe.c
+++ b/EmbeddedPkg/Drivers/ConsolePrefDxe/ConsolePrefDxe.c
@@ -116,7 +116,7 @@ RemoveDtStdoutPath (
     DEBUG ((
       DEBUG_INFO,
       "%a: could not retrieve DT blob - %r\n",
-      __FUNCTION__,
+      __func__,
       Status
       ));
     return;
@@ -132,7 +132,7 @@ RemoveDtStdoutPath (
     DEBUG ((
       DEBUG_INFO,
       "%a: Failed to delete 'stdout-path' property: %a\n",
-      __FUNCTION__,
+      __func__,
       fdt_strerror (Error)
       ));
   }
@@ -190,7 +190,7 @@ RemoveSpcrTable (
       DEBUG ((
         DEBUG_WARN,
         "%a: failed to uninstall SPCR table - %r\n",
-        __FUNCTION__,
+        __func__,
         Status
         ));
     }
@@ -224,7 +224,7 @@ OnReadyToBoot (
     DEBUG ((
       DEBUG_ERROR,
       "%a: variable '%s' could not be read - bailing!\n",
-      __FUNCTION__,
+      __func__,
       CONSOLE_PREF_VARIABLE_NAME
       ));
     return;
@@ -234,7 +234,7 @@ OnReadyToBoot (
     DEBUG ((
       DEBUG_INFO,
       "%a: serial console preferred - doing nothing\n",
-      __FUNCTION__
+      __func__
       ));
     return;
   }
@@ -247,7 +247,7 @@ OnReadyToBoot (
     DEBUG ((
       DEBUG_INFO,
       "%a: no GOP instances found - doing nothing (%r)\n",
-      __FUNCTION__,
+      __func__,
       Status
       ));
     return;
@@ -296,7 +296,7 @@ ConsolePrefDxeEntryPoint (
     DEBUG ((
       DEBUG_INFO,
       "%a: no console preference found, defaulting to graphical\n",
-      __FUNCTION__
+      __func__
       ));
     ConsolePref.Console = CONSOLE_PREF_GRAPHICAL;
   }
@@ -308,7 +308,7 @@ ConsolePrefDxeEntryPoint (
     DEBUG ((
       DEBUG_WARN,
       "%a: invalid value for %s, defaulting to graphical\n",
-      __FUNCTION__,
+      __func__,
       CONSOLE_PREF_VARIABLE_NAME
       ));
     ConsolePref.Console = CONSOLE_PREF_GRAPHICAL;
@@ -332,7 +332,7 @@ ConsolePrefDxeEntryPoint (
       DEBUG ((
         DEBUG_ERROR,
         "%a: gRT->SetVariable () failed - %r\n",
-        __FUNCTION__,
+        __func__,
         Status
         ));
       return Status;
diff --git a/EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.c b/EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.c
index 7f7e8c446c98..b94cd4da25d1 100644
--- a/EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.c
+++ b/EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.c
@@ -122,7 +122,7 @@ DtPlatformDxeEntryPoint (
     DEBUG ((
       DEBUG_WARN,
       "%a: no DTB blob could be loaded, defaulting to ACPI (Status == %r)\n",
-      __FUNCTION__,
+      __func__,
       Status
       ));
     DtAcpiPref.Pref = DT_ACPI_SELECT_ACPI;
@@ -142,7 +142,7 @@ DtPlatformDxeEntryPoint (
       DEBUG ((
         DEBUG_WARN,
         "%a: no DT/ACPI preference found, defaulting to %a\n",
-        __FUNCTION__,
+        __func__,
         PcdGetBool (PcdDefaultDtPref) ? "DT" : "ACPI"
         ));
       DtAcpiPref.Pref = PcdGetBool (PcdDefaultDtPref) ? DT_ACPI_SELECT_DT
@@ -157,7 +157,7 @@ DtPlatformDxeEntryPoint (
     DEBUG ((
       DEBUG_WARN,
       "%a: invalid value for %s, defaulting to %a\n",
-      __FUNCTION__,
+      __func__,
       DT_ACPI_VARIABLE_NAME,
       PcdGetBool (PcdDefaultDtPref) ? "DT" : "ACPI"
       ));
@@ -197,7 +197,7 @@ DtPlatformDxeEntryPoint (
       DEBUG ((
         DEBUG_ERROR,
         "%a: failed to install gEdkiiPlatformHasAcpiGuid as a protocol\n",
-        __FUNCTION__
+        __func__
         ));
       goto FreeDtb;
     }
@@ -211,7 +211,7 @@ DtPlatformDxeEntryPoint (
       DEBUG ((
         DEBUG_ERROR,
         "%a: failed to install FDT configuration table\n",
-        __FUNCTION__
+        __func__
         ));
       goto FreeDtb;
     }
diff --git a/EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.c b/EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.c
index b182c77d19b1..7da505a313d7 100644
--- a/EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.c
+++ b/EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.c
@@ -222,7 +222,7 @@ FindCompatibleNodeReg (
     DEBUG ((
       DEBUG_ERROR,
       "%a: '%a' compatible node has invalid 'reg' property (size == 0x%x)\n",
-      __FUNCTION__,
+      __func__,
       CompatibleString,
       *RegSize
       ));
@@ -263,7 +263,7 @@ FindNextMemoryNodeReg (
     }
 
     if (!IsNodeEnabled (Next)) {
-      DEBUG ((DEBUG_WARN, "%a: ignoring disabled memory node\n", __FUNCTION__));
+      DEBUG ((DEBUG_WARN, "%a: ignoring disabled memory node\n", __func__));
       continue;
     }
 
@@ -279,7 +279,7 @@ FindNextMemoryNodeReg (
         DEBUG ((
           DEBUG_WARN,
           "%a: ignoring memory node with no 'reg' property\n",
-          __FUNCTION__
+          __func__
           ));
         continue;
       }
@@ -288,7 +288,7 @@ FindNextMemoryNodeReg (
         DEBUG ((
           DEBUG_WARN,
           "%a: ignoring memory node with invalid 'reg' property (size == 0x%x)\n",
-          __FUNCTION__,
+          __func__,
           *RegSize
           ));
         continue;
@@ -391,7 +391,7 @@ OnPlatformHasDeviceTree (
   DEBUG ((
     DEBUG_INFO,
     "%a: exposing DTB @ 0x%p to OS\n",
-    __FUNCTION__,
+    __func__,
     DeviceTreeBase
     ));
   Status = gBS->InstallConfigurationTable (&gFdtTableGuid, DeviceTreeBase);
@@ -424,7 +424,7 @@ InitializeFdtClientDxe (
     DEBUG ((
       DEBUG_ERROR,
       "%a: No DTB found @ 0x%p\n",
-      __FUNCTION__,
+      __func__,
       DeviceTreeBase
       ));
     return EFI_NOT_FOUND;
@@ -432,7 +432,7 @@ InitializeFdtClientDxe (
 
   mDeviceTreeBase = DeviceTreeBase;
 
-  DEBUG ((DEBUG_INFO, "%a: DTB @ 0x%p\n", __FUNCTION__, mDeviceTreeBase));
+  DEBUG ((DEBUG_INFO, "%a: DTB @ 0x%p\n", __func__, mDeviceTreeBase));
 
   //
   // Register a protocol notify for the EDKII Platform Has Device Tree
@@ -446,7 +446,7 @@ InitializeFdtClientDxe (
                   &PlatformHasDeviceTreeEvent
                   );
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "%a: CreateEvent(): %r\n", __FUNCTION__, Status));
+    DEBUG ((DEBUG_ERROR, "%a: CreateEvent(): %r\n", __func__, Status));
     return Status;
   }
 
@@ -459,7 +459,7 @@ InitializeFdtClientDxe (
     DEBUG ((
       DEBUG_ERROR,
       "%a: RegisterProtocolNotify(): %r\n",
-      __FUNCTION__,
+      __func__,
       Status
       ));
     goto CloseEvent;
@@ -470,7 +470,7 @@ InitializeFdtClientDxe (
   //
   Status = gBS->SignalEvent (PlatformHasDeviceTreeEvent);
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "%a: SignalEvent(): %r\n", __FUNCTION__, Status));
+    DEBUG ((DEBUG_ERROR, "%a: SignalEvent(): %r\n", __func__, Status));
     goto CloseEvent;
   }
 
@@ -484,7 +484,7 @@ InitializeFdtClientDxe (
     DEBUG ((
       DEBUG_ERROR,
       "%a: InstallProtocolInterface(): %r\n",
-      __FUNCTION__,
+      __func__,
       Status
       ));
     goto CloseEvent;
diff --git a/EmbeddedPkg/Library/NonCoherentDmaLib/NonCoherentDmaLib.c b/EmbeddedPkg/Library/NonCoherentDmaLib/NonCoherentDmaLib.c
index 44a78c947ef4..e193352fbe41 100644
--- a/EmbeddedPkg/Library/NonCoherentDmaLib/NonCoherentDmaLib.c
+++ b/EmbeddedPkg/Library/NonCoherentDmaLib/NonCoherentDmaLib.c
@@ -349,7 +349,7 @@ DmaMap (
     "%a: Operation type 'MapOperationBusMasterCommonBuffer' is only "
     "supported\non memory regions that were allocated using "
     "DmaAllocateBuffer ()\n",
-    __FUNCTION__
+    __func__
     ));
   Status = EFI_UNSUPPORTED;
 FreeMapInfo:
diff --git a/EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClock.c b/EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClock.c
index 7adb7324057e..17dde432c4eb 100644
--- a/EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClock.c
+++ b/EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClock.c
@@ -219,7 +219,7 @@ InitializeRealTimeClock (
     DEBUG ((
       DEBUG_WARN,
       "%a: using default timezone/daylight settings\n",
-      __FUNCTION__
+      __func__
       ));
 
     mTimeSettings.TimeZone = EFI_UNSPECIFIED_TIMEZONE;
diff --git a/EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c b/EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c
index 86eb55800e5a..57388d9f461c 100755
--- a/EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c
+++ b/EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c
@@ -414,13 +414,13 @@ InitializeSdMmcDevice (
 
   Status = MmcHost->SendCommand (MmcHost, MMC_CMD55, CmdArg);
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "%a (MMC_CMD55): Error and Status = %r\n", __FUNCTION__, Status));
+    DEBUG ((DEBUG_ERROR, "%a (MMC_CMD55): Error and Status = %r\n", __func__, Status));
     return Status;
   }
 
   Status = MmcHost->ReceiveResponse (MmcHost, MMC_RESPONSE_TYPE_R1, Response);
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "%a (MMC_CMD55): Error and Status = %r\n", __FUNCTION__, Status));
+    DEBUG ((DEBUG_ERROR, "%a (MMC_CMD55): Error and Status = %r\n", __func__, Status));
     return Status;
   }
 
@@ -473,18 +473,18 @@ InitializeSdMmcDevice (
     CmdArg = CreateSwitchCmdArgument (0, 0, 0);
     Status = MmcHost->SendCommand (MmcHost, MMC_CMD6, CmdArg);
     if (EFI_ERROR (Status)) {
-      DEBUG ((DEBUG_ERROR, "%a (MMC_CMD6): Error and Status = %r\n", __FUNCTION__, Status));
+      DEBUG ((DEBUG_ERROR, "%a (MMC_CMD6): Error and Status = %r\n", __func__, Status));
       return Status;
     } else {
       Status = MmcHost->ReadBlockData (MmcHost, 0, SWITCH_CMD_DATA_LENGTH, Buffer);
       if (EFI_ERROR (Status)) {
-        DEBUG ((DEBUG_ERROR, "%a (MMC_CMD6): ReadBlockData Error and Status = %r\n", __FUNCTION__, Status));
+        DEBUG ((DEBUG_ERROR, "%a (MMC_CMD6): ReadBlockData Error and Status = %r\n", __func__, Status));
         return Status;
       }
     }
 
     if (!(Buffer[3] & SD_HIGH_SPEED_SUPPORTED)) {
-      DEBUG ((DEBUG_INFO, "%a : High Speed not supported by Card\n", __FUNCTION__));
+      DEBUG ((DEBUG_INFO, "%a : High Speed not supported by Card\n", __func__));
     } else {
       Speed = SD_HIGH_SPEED;
 
@@ -492,12 +492,12 @@ InitializeSdMmcDevice (
       CmdArg = CreateSwitchCmdArgument (1, 0, 1);
       Status = MmcHost->SendCommand (MmcHost, MMC_CMD6, CmdArg);
       if (EFI_ERROR (Status)) {
-        DEBUG ((DEBUG_ERROR, "%a (MMC_CMD6): Error and Status = %r\n", __FUNCTION__, Status));
+        DEBUG ((DEBUG_ERROR, "%a (MMC_CMD6): Error and Status = %r\n", __func__, Status));
         return Status;
       } else {
         Status = MmcHost->ReadBlockData (MmcHost, 0, SWITCH_CMD_DATA_LENGTH, Buffer);
         if (EFI_ERROR (Status)) {
-          DEBUG ((DEBUG_ERROR, "%a (MMC_CMD6): ReadBlockData Error and Status = %r\n", __FUNCTION__, Status));
+          DEBUG ((DEBUG_ERROR, "%a (MMC_CMD6): ReadBlockData Error and Status = %r\n", __func__, Status));
           return Status;
         }
 
@@ -513,14 +513,14 @@ InitializeSdMmcDevice (
     CmdArg = MmcHostInstance->CardInfo.RCA << 16;
     Status = MmcHost->SendCommand (MmcHost, MMC_CMD55, CmdArg);
     if (EFI_ERROR (Status)) {
-      DEBUG ((DEBUG_ERROR, "%a (MMC_CMD55): Error and Status = %r\n", __FUNCTION__, Status));
+      DEBUG ((DEBUG_ERROR, "%a (MMC_CMD55): Error and Status = %r\n", __func__, Status));
       return Status;
     }
 
     /* Width: 4 */
     Status = MmcHost->SendCommand (MmcHost, MMC_CMD6, 2);
     if (EFI_ERROR (Status)) {
-      DEBUG ((DEBUG_ERROR, "%a (MMC_CMD6): Error and Status = %r\n", __FUNCTION__, Status));
+      DEBUG ((DEBUG_ERROR, "%a (MMC_CMD6): Error and Status = %r\n", __func__, Status));
       return Status;
     }
   }
@@ -528,7 +528,7 @@ InitializeSdMmcDevice (
   if (MMC_HOST_HAS_SETIOS (MmcHost)) {
     Status = MmcHost->SetIos (MmcHost, Speed, BUSWIDTH_4, EMMCBACKWARD);
     if (EFI_ERROR (Status)) {
-      DEBUG ((DEBUG_ERROR, "%a (SetIos): Error and Status = %r\n", __FUNCTION__, Status));
+      DEBUG ((DEBUG_ERROR, "%a (SetIos): Error and Status = %r\n", __func__, Status));
       return Status;
     }
   }
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 08/18] RedfishPkg: Update code to be more C11 compliant by using __func__
  2023-04-06 22:23 [PATCH 00/18] Replace pre-standard macro __FUNCTION__ with C99 __func__ throughout edk2 Rebecca Cran
                   ` (6 preceding siblings ...)
  2023-04-06 22:23 ` [PATCH 07/18] EmbeddedPkg: " Rebecca Cran
@ 2023-04-06 22:23 ` Rebecca Cran
  2023-04-07  5:39   ` Nickle Wang
  2023-04-06 22:23 ` [PATCH 09/18] ArmPlatformPkg: " Rebecca Cran
                   ` (12 subsequent siblings)
  20 siblings, 1 reply; 34+ messages in thread
From: Rebecca Cran @ 2023-04-06 22:23 UTC (permalink / raw)
  To: devel, Liming Gao, Michael D Kinney, Guomin Jiang, Wei6 Xu,
	Guo Dong, Ray Ni, Sean Rhodes, James Lu, Gua Guo, Andrew Fish,
	Hao A Wu, Maciej Rabeda, Siyuan Fu, Jiewen Yao, Jian J Wang,
	Xiaoyu Lu, Ard Biesheuvel, Sami Mujawar, Supreeth Venkatesh,
	Michael Kubacki, Nate DeSimone, Sean Brogan
  Cc: Rebecca Cran, Leif Lindholm, Abner Chang, Nickle Wang,
	Igor Kulchytskyy, Daniel Schaefer, Min Xu, Jordan Justen,
	Gerd Hoffmann, Peter Grehan, Erdem Aktas, James Bottomley,
	Tom Lendacky, Michael Roth, Sunil V L, Andrei Warkentin

__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
RedfishPkg.

Visual Studio versions before VS 2015 don't support __func__ and so
will fail to compile. A workaround is to define __func__ as
__FUNCTION__ :

  #define __func__ __FUNCTION__

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
---
 RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfaceBmcUsbNicLib.c | 36 ++++++------
 RedfishPkg/Library/RedfishPlatformCredentialIpmiLib/RedfishPlatformCredentialIpmiLib.c   | 28 ++++-----
 RedfishPkg/PrivateLibrary/RedfishLib/RedfishLib.c                                        |  2 +-
 RedfishPkg/PrivateLibrary/RedfishLib/edk2libredfish/src/service.c                        |  4 +-
 RedfishPkg/RedfishConfigHandler/RedfishConfigHandlerCommon.c                             |  6 +-
 RedfishPkg/RedfishConfigHandler/RedfishConfigHandlerDriver.c                             | 20 +++----
 RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c                                       | 62 ++++++++++----------
 RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.c                             | 14 ++---
 RedfishPkg/RedfishRestExDxe/RedfishRestExImpl.c                                          | 14 ++---
 9 files changed, 93 insertions(+), 93 deletions(-)

diff --git a/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfaceBmcUsbNicLib.c b/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfaceBmcUsbNicLib.c
index 122473dbe446..4bd01850af93 100644
--- a/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfaceBmcUsbNicLib.c
+++ b/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfaceBmcUsbNicLib.c
@@ -37,7 +37,7 @@ ProbeRedfishCredentialBootstrap (
   UINT32                                      ResponseSize;
   BOOLEAN                                     ReturnBool;
 
-  DEBUG ((DEBUG_INFO, "%a: Entry\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a: Entry\n", __func__));
 
   //
   // IPMI callout to NetFn 2C, command 02
@@ -65,10 +65,10 @@ ProbeRedfishCredentialBootstrap (
        (ResponseData.CompletionCode == REDFISH_IPMI_COMP_CODE_BOOTSTRAP_CREDENTIAL_DISABLED)
       ))
   {
-    DEBUG ((DEBUG_REDFISH_HOST_INTERFACE, "    Redfish Credentail Bootstrapping is supported\n", __FUNCTION__));
+    DEBUG ((DEBUG_REDFISH_HOST_INTERFACE, "    Redfish Credentail Bootstrapping is supported\n", __func__));
     ReturnBool = TRUE;
   } else {
-    DEBUG ((DEBUG_REDFISH_HOST_INTERFACE, "    Redfish Credentail Bootstrapping is not supported\n", __FUNCTION__));
+    DEBUG ((DEBUG_REDFISH_HOST_INTERFACE, "    Redfish Credentail Bootstrapping is not supported\n", __func__));
     ReturnBool = FALSE;
   }
 
@@ -94,7 +94,7 @@ RedfishPlatformHostInterfaceDeviceDescriptor (
   HOST_INTERFACE_BMC_USB_NIC_INFO  *ThisInstance;
   REDFISH_INTERFACE_DATA           *InterfaceData;
 
-  DEBUG ((DEBUG_INFO, "%a: Entry\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a: Entry\n", __func__));
 
   if (IsListEmpty (&mBmcUsbNic)) {
     return EFI_NOT_FOUND;
@@ -166,7 +166,7 @@ RedfishPlatformHostInterfaceProtocolData (
   UINT8                              HostNameLength;
   CHAR8                              *HostNameString;
 
-  DEBUG ((DEBUG_INFO, "%a: Entry\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a: Entry\n", __func__));
 
   if (IsListEmpty (&mBmcUsbNic) || (IndexOfProtocolData > 0)) {
     return EFI_NOT_FOUND;
@@ -300,7 +300,7 @@ RetrievedBmcUsbNicInfo (
   IPMI_LAN_VLAN_ID                                *LanVlanId;
   EFI_USB_DEVICE_DESCRIPTOR                       UsbDeviceDescriptor;
 
-  DEBUG ((DEBUG_INFO, "%a: Entry\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a: Entry\n", __func__));
 
   if (IsListEmpty (&mBmcUsbNic)) {
     return EFI_NOT_FOUND;
@@ -605,7 +605,7 @@ HostInterfaceIpmiCheckMacAddress (
   EFI_MAC_ADDRESS                                 IpmiLanChannelMacAddress;
   BOOLEAN                                         AlreadyCached;
 
-  DEBUG ((DEBUG_INFO, "%a: Entry.\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a: Entry.\n", __func__));
 
   GetLanConfigReps = NULL;
   AlreadyCached    = FALSE;
@@ -823,7 +823,7 @@ UsbNicSearchUsbIo (
   EFI_DEVICE_PATH_PROTOCOL  *ThisUsbDevicePath;
   EFI_DEVICE_PATH_PROTOCOL  *ThisUsbDevicePathEnd;
 
-  DEBUG ((DEBUG_INFO, "%a: Entry.\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a: Entry.\n", __func__));
   DEBUG ((DEBUG_REDFISH_HOST_INTERFACE, "Device path on the EFI handle which has UsbIo and SNP instaleld on it.\n"));
   DevicePathStr = ConvertDevicePathToText (UsbDevicePath, FALSE, FALSE);
   if (DevicePathStr != NULL) {
@@ -987,7 +987,7 @@ IdentifyUsbNicBmcChannel (
   EFI_USB_IO_PROTOCOL              *UsbIo;
   HOST_INTERFACE_BMC_USB_NIC_INFO  *BmcUsbNic;
 
-  DEBUG ((DEBUG_INFO, "%a: Entry.\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a: Entry.\n", __func__));
   Status = gBS->HandleProtocol (
                   Handle,
                   &gEfiSimpleNetworkProtocolGuid,
@@ -1074,7 +1074,7 @@ CheckBmcUsbNicOnHandles (
     return EFI_INVALID_PARAMETER;
   }
 
-  DEBUG ((DEBUG_INFO, "%a: Entry, #%d SNP handle\n", __FUNCTION__, HandleNumer));
+  DEBUG ((DEBUG_INFO, "%a: Entry, #%d SNP handle\n", __func__, HandleNumer));
 
   GotOneUsbNIc = FALSE;
   for (Index = 0; Index < HandleNumer; Index++) {
@@ -1084,7 +1084,7 @@ CheckBmcUsbNicOnHandles (
                     (VOID **)&DevicePath
                     );
     if (EFI_ERROR (Status)) {
-      DEBUG ((DEBUG_ERROR, "    Failed to locate SNP on %d handle.\n", __FUNCTION__, Index));
+      DEBUG ((DEBUG_ERROR, "    Failed to locate SNP on %d handle.\n", __func__, Index));
       continue;
     }
 
@@ -1137,7 +1137,7 @@ CheckBmcUsbNic (
   UINTN       BufferSize;
   EFI_HANDLE  *HandleBuffer;
 
-  DEBUG ((DEBUG_INFO, "%a: Entry, the registration key - 0x%08x.\n", __FUNCTION__, Registration));
+  DEBUG ((DEBUG_INFO, "%a: Entry, the registration key - 0x%08x.\n", __func__, Registration));
 
   Handle     = NULL;
   Status     = EFI_SUCCESS;
@@ -1213,7 +1213,7 @@ PlatformHostInterfaceSnpCallback (
   IN  VOID       *Context
   )
 {
-  DEBUG ((DEBUG_INFO, "%a: Entry.\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a: Entry.\n", __func__));
 
   CheckBmcUsbNic (mPlatformHostInterfaceSnpRegistration);
   return;
@@ -1241,7 +1241,7 @@ RedfishPlatformHostInterfaceNotification (
 {
   EFI_STATUS  Status;
 
-  DEBUG ((DEBUG_INFO, "%a: Entry\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a: Entry\n", __func__));
 
   *InformationReadinessGuid = NULL;
   InitializeListHead (&mBmcUsbNic);
@@ -1257,7 +1257,7 @@ RedfishPlatformHostInterfaceNotification (
   }
 
   if (Status == EFI_NOT_FOUND) {
-    DEBUG ((DEBUG_REDFISH_HOST_INTERFACE, "%a: BMC USB NIC is not found. Register the notification.\n", __FUNCTION__));
+    DEBUG ((DEBUG_REDFISH_HOST_INTERFACE, "%a: BMC USB NIC is not found. Register the notification.\n", __func__));
 
     // Register the notification of SNP installation.
     Status = gBS->CreateEvent (
@@ -1268,7 +1268,7 @@ RedfishPlatformHostInterfaceNotification (
                     &mPlatformHostInterfaceSnpEvent
                     );
     if (EFI_ERROR (Status)) {
-      DEBUG ((DEBUG_ERROR, "%a: Fail to create event for the installation of SNP protocol.", __FUNCTION__));
+      DEBUG ((DEBUG_ERROR, "%a: Fail to create event for the installation of SNP protocol.", __func__));
       return Status;
     }
 
@@ -1278,7 +1278,7 @@ RedfishPlatformHostInterfaceNotification (
                     &mPlatformHostInterfaceSnpRegistration
                     );
     if (EFI_ERROR (Status)) {
-      DEBUG ((DEBUG_ERROR, "%a: Fail to register event for the installation of SNP protocol.", __FUNCTION__));
+      DEBUG ((DEBUG_ERROR, "%a: Fail to register event for the installation of SNP protocol.", __func__));
       return Status;
     }
 
@@ -1286,6 +1286,6 @@ RedfishPlatformHostInterfaceNotification (
     return EFI_SUCCESS;
   }
 
-  DEBUG ((DEBUG_ERROR, "%a: Something wrong when look for BMC USB NIC.\n", __FUNCTION__));
+  DEBUG ((DEBUG_ERROR, "%a: Something wrong when look for BMC USB NIC.\n", __func__));
   return Status;
 }
diff --git a/RedfishPkg/Library/RedfishPlatformCredentialIpmiLib/RedfishPlatformCredentialIpmiLib.c b/RedfishPkg/Library/RedfishPlatformCredentialIpmiLib/RedfishPlatformCredentialIpmiLib.c
index dacb09bb2399..3b34dafbaf60 100644
--- a/RedfishPkg/Library/RedfishPlatformCredentialIpmiLib/RedfishPlatformCredentialIpmiLib.c
+++ b/RedfishPkg/Library/RedfishPlatformCredentialIpmiLib/RedfishPlatformCredentialIpmiLib.c
@@ -63,10 +63,10 @@ LibStopRedfishService (
   //
   Status = SetBootstrapAccountCredentialsToVariable (NULL, NULL, TRUE);
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "%a: fail to remove bootstrap credential: %r\n", __FUNCTION__, Status));
+    DEBUG ((DEBUG_ERROR, "%a: fail to remove bootstrap credential: %r\n", __func__, Status));
   }
 
-  DEBUG ((DEBUG_INFO, "%a: bootstrap credential service stopped\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a: bootstrap credential service stopped\n", __func__));
 
   return EFI_SUCCESS;
 }
@@ -153,7 +153,7 @@ GetBootstrapAccountCredentials (
     return EFI_INVALID_PARAMETER;
   }
 
-  DEBUG ((DEBUG_VERBOSE, "%a: Disable bootstrap control: 0x%x\n", __FUNCTION__, DisableBootstrapControl));
+  DEBUG ((DEBUG_VERBOSE, "%a: Disable bootstrap control: 0x%x\n", __func__, DisableBootstrapControl));
 
   //
   // IPMI callout to NetFn 2C, command 02
@@ -183,19 +183,19 @@ GetBootstrapAccountCredentials (
              );
 
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "%a: IPMI transaction failure. Returning\n", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a: IPMI transaction failure. Returning\n", __func__));
     return Status;
   } else {
     if (ResponseData.CompletionCode != IPMI_COMP_CODE_NORMAL) {
       if (ResponseData.CompletionCode == REDFISH_IPMI_COMP_CODE_BOOTSTRAP_CREDENTIAL_DISABLED) {
-        DEBUG ((DEBUG_ERROR, "%a: bootstrap credential support was disabled\n", __FUNCTION__));
+        DEBUG ((DEBUG_ERROR, "%a: bootstrap credential support was disabled\n", __func__));
         return EFI_ACCESS_DENIED;
       }
 
-      DEBUG ((DEBUG_ERROR, "%a: Completion code = 0x%x. Returning\n", __FUNCTION__, ResponseData.CompletionCode));
+      DEBUG ((DEBUG_ERROR, "%a: Completion code = 0x%x. Returning\n", __func__, ResponseData.CompletionCode));
       return EFI_PROTOCOL_ERROR;
     } else if (ResponseData.GroupExtensionId != REDFISH_IPMI_GROUP_EXTENSION) {
-      DEBUG ((DEBUG_ERROR, "%a: Group Extension Response = 0x%x. Returning\n", __FUNCTION__, ResponseData.GroupExtensionId));
+      DEBUG ((DEBUG_ERROR, "%a: Group Extension Response = 0x%x. Returning\n", __func__, ResponseData.GroupExtensionId));
       return EFI_DEVICE_ERROR;
     } else {
       if (BootstrapUsername != NULL) {
@@ -216,7 +216,7 @@ GetBootstrapAccountCredentials (
     }
   }
 
-  DEBUG ((DEBUG_INFO, "%a: get bootstrap credential via IPMI: %r\n", __FUNCTION__, Status));
+  DEBUG ((DEBUG_INFO, "%a: get bootstrap credential via IPMI: %r\n", __func__, Status));
 
   return Status;
 }
@@ -269,7 +269,7 @@ GetBootstrapAccountCredentialsFromVariable (
   }
 
   if (DataSize != sizeof (BOOTSTRAP_CREDENTIALS_VARIABLE)) {
-    DEBUG ((DEBUG_ERROR, "%a: data corruption. returned size: %d != structure size: %d\n", __FUNCTION__, DataSize, sizeof (BOOTSTRAP_CREDENTIALS_VARIABLE)));
+    DEBUG ((DEBUG_ERROR, "%a: data corruption. returned size: %d != structure size: %d\n", __func__, DataSize, sizeof (BOOTSTRAP_CREDENTIALS_VARIABLE)));
     FreePool (Data);
     return EFI_NOT_FOUND;
   }
@@ -284,7 +284,7 @@ GetBootstrapAccountCredentialsFromVariable (
 
   FreePool (Data);
 
-  DEBUG ((DEBUG_INFO, "%a: get bootstrap credential from variable\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a: get bootstrap credential from variable\n", __func__));
 
   return EFI_SUCCESS;
 }
@@ -412,7 +412,7 @@ LibCredentialGetAuthInfo (
   DisableCredentialService = PcdGetBool (PcdRedfishDisableBootstrapCredentialService);
 
   if (mRedfishServiceStopped) {
-    DEBUG ((DEBUG_ERROR, "%a: credential service is stopped due to security reason\n", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a: credential service is stopped due to security reason\n", __func__));
     return EFI_ACCESS_DENIED;
   }
 
@@ -441,17 +441,17 @@ LibCredentialGetAuthInfo (
   //
   Status = GetBootstrapAccountCredentials (DisableCredentialService, *UserId, USERNAME_MAX_SIZE, *Password, PASSWORD_MAX_SIZE);
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "%a: fail to get bootstrap credential: %r\n", __FUNCTION__, Status));
+    DEBUG ((DEBUG_ERROR, "%a: fail to get bootstrap credential: %r\n", __func__, Status));
     return Status;
   }
 
   if (DisableCredentialService) {
-    DEBUG ((DEBUG_INFO, "%a: credential bootstrapping control disabled\n", __FUNCTION__));
+    DEBUG ((DEBUG_INFO, "%a: credential bootstrapping control disabled\n", __func__));
   }
 
   Status = SetBootstrapAccountCredentialsToVariable (*UserId, *Password, FALSE);
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "%a: fail to cache bootstrap credential: %r\n", __FUNCTION__, Status));
+    DEBUG ((DEBUG_ERROR, "%a: fail to cache bootstrap credential: %r\n", __func__, Status));
   }
 
   return EFI_SUCCESS;
diff --git a/RedfishPkg/PrivateLibrary/RedfishLib/RedfishLib.c b/RedfishPkg/PrivateLibrary/RedfishLib/RedfishLib.c
index 51a85a73360d..0a0a4e645872 100644
--- a/RedfishPkg/PrivateLibrary/RedfishLib/RedfishLib.c
+++ b/RedfishPkg/PrivateLibrary/RedfishLib/RedfishLib.c
@@ -1101,7 +1101,7 @@ RedfishIsValidOdataType (
     }
   }
 
-  DEBUG ((DEBUG_INFO, "%a: This Odata type is not in the list.\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a: This Odata type is not in the list.\n", __func__));
   return FALSE;
 }
 
diff --git a/RedfishPkg/PrivateLibrary/RedfishLib/edk2libredfish/src/service.c b/RedfishPkg/PrivateLibrary/RedfishLib/edk2libredfish/src/service.c
index cbd4330a0ed0..206094d87d0f 100644
--- a/RedfishPkg/PrivateLibrary/RedfishLib/edk2libredfish/src/service.c
+++ b/RedfishPkg/PrivateLibrary/RedfishLib/edk2libredfish/src/service.c
@@ -521,7 +521,7 @@ getUriFromService (
       //
       Status = DecodeResponseContent (ContentEncodedHeader->FieldValue, &ResponseMsg.Body, &ResponseMsg.BodyLength);
       if (EFI_ERROR (Status)) {
-        DEBUG ((DEBUG_ERROR, "%a: Failed to decompress the response content %r\n.", __FUNCTION__, Status));
+        DEBUG ((DEBUG_ERROR, "%a: Failed to decompress the response content %r\n.", __func__, Status));
         ret = NULL;
         goto ON_EXIT;
       }
@@ -656,7 +656,7 @@ patchUriFromService (
   //
   Status = EncodeRequestContent ((CHAR8 *)HTTP_CONTENT_ENCODING_GZIP, (CHAR8 *)content, (VOID **)&EncodedContent, &EncodedContentLen);
   if (Status == EFI_INVALID_PARAMETER) {
-    DEBUG ((DEBUG_ERROR, "%a: Error to encode content.\n", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a: Error to encode content.\n", __func__));
     ret = NULL;
     goto ON_EXIT;
   } else if (Status == EFI_UNSUPPORTED) {
diff --git a/RedfishPkg/RedfishConfigHandler/RedfishConfigHandlerCommon.c b/RedfishPkg/RedfishConfigHandler/RedfishConfigHandlerCommon.c
index 96aac125ee22..b51b558a487d 100644
--- a/RedfishPkg/RedfishConfigHandler/RedfishConfigHandlerCommon.c
+++ b/RedfishPkg/RedfishConfigHandler/RedfishConfigHandlerCommon.c
@@ -122,7 +122,7 @@ RedfishConfigCommonInit (
   //
   Status = gBS->LocateProtocol (&gEdkIIRedfishCredentialProtocolGuid, NULL, (VOID **)&gCredential);
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_INFO, "%a: No Redfish Credential Protocol is installed on system.", __FUNCTION__));
+    DEBUG ((DEBUG_INFO, "%a: No Redfish Credential Protocol is installed on system.", __func__));
     return Status;
   }
 
@@ -138,7 +138,7 @@ RedfishConfigCommonInit (
                   &gEndOfDxeEvent
                   );
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "%a: Fail to register End Of DXE event.", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a: Fail to register End Of DXE event.", __func__));
     return Status;
   }
 
@@ -156,7 +156,7 @@ RedfishConfigCommonInit (
   if (EFI_ERROR (Status)) {
     gBS->CloseEvent (gEndOfDxeEvent);
     gEndOfDxeEvent = NULL;
-    DEBUG ((DEBUG_ERROR, "%a: Fail to register Exit Boot Service event.", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a: Fail to register Exit Boot Service event.", __func__));
     return Status;
   }
 
diff --git a/RedfishPkg/RedfishConfigHandler/RedfishConfigHandlerDriver.c b/RedfishPkg/RedfishConfigHandler/RedfishConfigHandlerDriver.c
index 96ac70f418c8..993ad338b6eb 100644
--- a/RedfishPkg/RedfishConfigHandler/RedfishConfigHandlerDriver.c
+++ b/RedfishPkg/RedfishConfigHandler/RedfishConfigHandlerDriver.c
@@ -372,7 +372,7 @@ RedfishDiscoverProtocolInstalled (
   EFI_REDFISH_DISCOVER_NETWORK_INTERFACE  *ThisNetworkInterface;
   EFI_REDFISH_DISCOVERED_TOKEN            *ThisRedfishDiscoveredToken;
 
-  DEBUG ((DEBUG_INFO, "%a: New network interface is installed on system by EFI Redfish discover driver.\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a: New network interface is installed on system by EFI Redfish discover driver.\n", __func__));
 
   BufferSize = sizeof (EFI_HANDLE);
   Status     = gBS->LocateHandle (
@@ -383,7 +383,7 @@ RedfishDiscoverProtocolInstalled (
                       &HandleBuffer
                       );
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "%a: Can't locate handle with EFI_REDFISH_DISCOVER_PROTOCOL installed.\n", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a: Can't locate handle with EFI_REDFISH_DISCOVER_PROTOCOL installed.\n", __func__));
   }
 
   gRedfishDiscoverActivated = TRUE;
@@ -403,7 +403,7 @@ RedfishDiscoverProtocolInstalled (
     if (EFI_ERROR (Status)) {
       gEfiRedfishDiscoverProtocol = NULL;
       gRedfishDiscoverActivated   = FALSE;
-      DEBUG ((DEBUG_ERROR, "%a: Can't locate EFI_REDFISH_DISCOVER_PROTOCOL.\n", __FUNCTION__));
+      DEBUG ((DEBUG_ERROR, "%a: Can't locate EFI_REDFISH_DISCOVER_PROTOCOL.\n", __func__));
       return;
     }
   }
@@ -422,13 +422,13 @@ RedfishDiscoverProtocolInstalled (
                                           &gNetworkInterfaceInstances
                                           );
   if (EFI_ERROR (Status) || (gNumberOfNetworkInterfaces == 0)) {
-    DEBUG ((DEBUG_ERROR, "%a: No network interfaces found on the handle.\n", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a: No network interfaces found on the handle.\n", __func__));
     return;
   }
 
   gRedfishDiscoveredToken = AllocateZeroPool (gNumberOfNetworkInterfaces * sizeof (EFI_REDFISH_DISCOVERED_TOKEN));
   if (gRedfishDiscoveredToken == NULL) {
-    DEBUG ((DEBUG_ERROR, "%a: Not enough memory for EFI_REDFISH_DISCOVERED_TOKEN.\n", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a: Not enough memory for EFI_REDFISH_DISCOVERED_TOKEN.\n", __func__));
     return;
   }
 
@@ -449,7 +449,7 @@ RedfishDiscoverProtocolInstalled (
                     &ThisRedfishDiscoveredToken->Event
                     );
     if (EFI_ERROR (Status)) {
-      DEBUG ((DEBUG_ERROR, "%a: Failed to create event for Redfish discovered token.\n", __FUNCTION__));
+      DEBUG ((DEBUG_ERROR, "%a: Failed to create event for Redfish discovered token.\n", __func__));
       goto ErrorReturn;
     }
 
@@ -472,7 +472,7 @@ RedfishDiscoverProtocolInstalled (
   }
 
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "%a: Acquire Redfish service fail.\n", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a: Acquire Redfish service fail.\n", __func__));
     goto ErrorReturn;
   }
 
@@ -556,7 +556,7 @@ RedfishConfigHandlerDriverEntryPoint (
                   &gEfiRedfishDiscoverProtocolEvent
                   );
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "%a: Fail to create event for the installation of EFI_REDFISH_DISCOVER_PROTOCOL.", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a: Fail to create event for the installation of EFI_REDFISH_DISCOVER_PROTOCOL.", __func__));
     return Status;
   }
 
@@ -566,7 +566,7 @@ RedfishConfigHandlerDriverEntryPoint (
                   &gEfiRedfishDiscoverRegistration
                   );
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "%a: Fail to register event for the installation of EFI_REDFISH_DISCOVER_PROTOCOL.", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a: Fail to register event for the installation of EFI_REDFISH_DISCOVER_PROTOCOL.", __func__));
     return Status;
   }
 
@@ -593,7 +593,7 @@ RedfishConfigHandlerDriverEntryPoint (
     gExitBootServiceEvent = NULL;
     gBS->CloseEvent (gEfiRedfishDiscoverProtocolEvent);
     gEfiRedfishDiscoverProtocolEvent = NULL;
-    DEBUG ((DEBUG_ERROR, "%a: Fail to install EFI Binding Protocol of EFI Redfish Config driver.", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a: Fail to install EFI Binding Protocol of EFI Redfish Config driver.", __func__));
     return Status;
   }
 
diff --git a/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c b/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c
index f64c79088f63..583c6f78e19c 100644
--- a/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c
+++ b/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c
@@ -196,13 +196,13 @@ Tcp4GetSubnetInfo (
   Tcp4Option.EnableNagle       = TRUE;
   Status                       = Tcp4->Configure (Tcp4, &Tcp4CfgData);
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "%a: Can't get subnet information\n", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a: Can't get subnet information\n", __func__));
     return Status;
   }
 
   Status = Tcp4->GetModeData (Tcp4, NULL, NULL, &IpModedata, NULL, NULL);
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "%a: Can't get IP mode data information\n", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a: Can't get IP mode data information\n", __func__));
     return Status;
   }
 
@@ -265,12 +265,12 @@ Tcp6GetSubnetInfo (
   ZeroMem ((VOID *)&IpModedata, sizeof (EFI_IP6_MODE_DATA));
   Status = Tcp6->GetModeData (Tcp6, NULL, NULL, &IpModedata, NULL, NULL);
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "%a: Can't get IP mode data information\n", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a: Can't get IP mode data information\n", __func__));
     return Status;
   }
 
   if (IpModedata.AddressCount == 0) {
-    DEBUG ((DEBUG_INFO, "%a: No IPv6 address configured.\n", __FUNCTION__));
+    DEBUG ((DEBUG_INFO, "%a: No IPv6 address configured.\n", __func__));
     Instance->SubnetAddrInfoIPv6Number = 0;
     return EFI_SUCCESS;
   }
@@ -282,7 +282,7 @@ Tcp6GetSubnetInfo (
 
   Instance->SubnetAddrInfoIPv6 = AllocateZeroPool (IpModedata.AddressCount * sizeof (EFI_IP6_ADDRESS_INFO));
   if (Instance->SubnetAddrInfoIPv6 == NULL) {
-    DEBUG ((DEBUG_ERROR, "%a: Failed to allocate memory for IPv6 subnet address information\n", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a: Failed to allocate memory for IPv6 subnet address information\n", __func__));
     return EFI_OUT_OF_RESOURCES;
   }
 
@@ -529,7 +529,7 @@ DiscoverRedfishHostInterface (
       IP4_COPY_ADDRESS ((VOID *)&Instance->HostSubnetMask.v4, (VOID *)Data->HostIpMask);
 
       if (EFI_IP4_EQUAL (&Instance->HostIpAddress.v4, &mZeroIp4Addr)) {
-        DEBUG ((DEBUG_ERROR, "%a: invalid host IP address: zero address\n", __FUNCTION__));
+        DEBUG ((DEBUG_ERROR, "%a: invalid host IP address: zero address\n", __func__));
         //
         // Invalid IP address detected. Change address format to Unknown and use system default address.
         //
@@ -537,7 +537,7 @@ DiscoverRedfishHostInterface (
       }
 
       if (!IP4_IS_VALID_NETMASK (EFI_IP4 (Instance->HostSubnetMask.v4))) {
-        DEBUG ((DEBUG_ERROR, "%a: invalid subnet mask address\n", __FUNCTION__));
+        DEBUG ((DEBUG_ERROR, "%a: invalid subnet mask address\n", __func__));
         //
         // Invalid subnet mast address detected. Change address format to Unknown and use system default address.
         //
@@ -551,14 +551,14 @@ DiscoverRedfishHostInterface (
       IP4_COPY_ADDRESS ((VOID *)&Instance->TargetIpAddress.v4, (VOID *)Data->RedfishServiceIpAddress);
 
       if (EFI_IP4_EQUAL (&Instance->TargetIpAddress.v4, &mZeroIp4Addr)) {
-        DEBUG ((DEBUG_ERROR, "%a: invalid service IP address: zero address\n", __FUNCTION__));
+        DEBUG ((DEBUG_ERROR, "%a: invalid service IP address: zero address\n", __func__));
       }
     } else {
       IP6_COPY_ADDRESS ((VOID *)&Instance->TargetIpAddress.v6, (VOID *)Data->RedfishServiceIpAddress);
     }
 
     if (Instance->HostIntfValidation) {
-      DEBUG ((DEBUG_ERROR, "%a:Send UPnP unicast SSDP to validate this Redfish Host Interface is not supported.\n", __FUNCTION__));
+      DEBUG ((DEBUG_ERROR, "%a:Send UPnP unicast SSDP to validate this Redfish Host Interface is not supported.\n", __func__));
       Status = EFI_UNSUPPORTED;
     } else {
       //
@@ -682,7 +682,7 @@ AddAndSignalNewRedfishService (
   RestExOpened = FALSE;
   DeleteRestEx = FALSE;
 
-  DEBUG ((DEBUG_INFO, "%a:Add this instance to Redfish instance list.\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a:Add this instance to Redfish instance list.\n", __func__));
 
   if (Uuid != NULL) {
     Char16Uuid = (CHAR16 *)AllocateZeroPool (AsciiStrSize ((const CHAR8 *)Uuid) * sizeof (CHAR16));
@@ -846,7 +846,7 @@ AddAndSignalNewRedfishService (
     if (!InfoRefresh) {
       Status = CreateRestExInstance (Instance, Instance->DiscoverToken); // Create REST EX child.
       if (EFI_ERROR (Status)) {
-        DEBUG ((DEBUG_ERROR, "%a:Can't create REST EX child instance.\n", __FUNCTION__));
+        DEBUG ((DEBUG_ERROR, "%a:Can't create REST EX child instance.\n", __func__));
         goto ON_EXIT;
       }
 
@@ -906,7 +906,7 @@ AddAndSignalNewRedfishService (
                          (EFI_REST_EX_CONFIG_DATA)(UINT8 *)RestExHttpConfigData
                          );
       if (EFI_ERROR (Status)) {
-        DEBUG ((DEBUG_ERROR, "%a:REST EX configured..\n", __FUNCTION__));
+        DEBUG ((DEBUG_ERROR, "%a:REST EX configured..\n", __func__));
         DeleteRestEx = TRUE;
         goto EXIT_FREE_ALL;
       }
@@ -927,7 +927,7 @@ AddAndSignalNewRedfishService (
 
     Status = gBS->SignalEvent (Instance->DiscoverToken->Event);
     if (!EFI_ERROR (Status)) {
-      DEBUG ((DEBUG_ERROR, "%a:No event to signal!\n", __FUNCTION__));
+      DEBUG ((DEBUG_ERROR, "%a:No event to signal!\n", __func__));
     }
   }
 
@@ -997,13 +997,13 @@ NetworkInterfaceGetSubnetInfo (
                                                Instance
                                                );
     if (EFI_ERROR (Status)) {
-      DEBUG ((DEBUG_ERROR, "%a:Failed to get Subnet infomation.\n", __FUNCTION__));
+      DEBUG ((DEBUG_ERROR, "%a:Failed to get Subnet infomation.\n", __func__));
       return Status;
     } else {
-      DEBUG ((DEBUG_INFO, "%a:MAC address: %s\n", __FUNCTION__, Instance->StrMacAddr));
+      DEBUG ((DEBUG_INFO, "%a:MAC address: %s\n", __func__, Instance->StrMacAddr));
       if (CheckIsIpVersion6 (Instance)) {
         if (Instance->SubnetAddrInfoIPv6Number == 0) {
-          DEBUG ((DEBUG_ERROR, "%a: There is no Subnet infomation for IPv6 network interface.\n", __FUNCTION__));
+          DEBUG ((DEBUG_ERROR, "%a: There is no Subnet infomation for IPv6 network interface.\n", __func__));
           return EFI_NOT_FOUND;
         }
 
@@ -1184,13 +1184,13 @@ RedfishServiceAcquireService (
   UINTN                                            NetworkInterfacesIndex;
   EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL  *TargetNetworkInterfaceInternal;
 
-  DEBUG ((DEBUG_INFO, "%a:Entry.\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a:Entry.\n", __func__));
 
   //
   // Validate parameters.
   //
   if ((ImageHandle == NULL) || (Token == NULL) || ((Flags & ~EFI_REDFISH_DISCOVER_VALIDATION) == 0)) {
-    DEBUG ((DEBUG_ERROR, "%a:Invalid parameters.\n", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a:Invalid parameters.\n", __func__));
     return EFI_INVALID_PARAMETER;
   }
 
@@ -1208,7 +1208,7 @@ RedfishServiceAcquireService (
     TargetNetworkInterfaceInternal = (EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL *)GetFirstNode (&mEfiRedfishDiscoverNetworkInterface);
     NumNetworkInterfaces           = NumberOfNetworkInterface ();
     if (NumNetworkInterfaces == 0) {
-      DEBUG ((DEBUG_ERROR, "%a:No network interface on platform.\n", __FUNCTION__));
+      DEBUG ((DEBUG_ERROR, "%a:No network interface on platform.\n", __func__));
       return EFI_UNSUPPORTED;
     }
   }
@@ -1219,10 +1219,10 @@ RedfishServiceAcquireService (
     NewInstance = FALSE;
     Instance    = GetInstanceByOwner (ImageHandle, TargetNetworkInterfaceInternal, Flags & ~EFI_REDFISH_DISCOVER_VALIDATION); // Check if we can re-use previous instance.
     if (Instance == NULL) {
-      DEBUG ((DEBUG_INFO, "%a:Create new EFI_REDFISH_DISCOVERED_INTERNAL_INSTANCE.\n", __FUNCTION__));
+      DEBUG ((DEBUG_INFO, "%a:Create new EFI_REDFISH_DISCOVERED_INTERNAL_INSTANCE.\n", __func__));
       Instance = (EFI_REDFISH_DISCOVERED_INTERNAL_INSTANCE *)AllocateZeroPool (sizeof (EFI_REDFISH_DISCOVERED_INTERNAL_INSTANCE));
       if (Instance == NULL) {
-        DEBUG ((DEBUG_ERROR, "%a:Memory allocation fail.\n", __FUNCTION__));
+        DEBUG ((DEBUG_ERROR, "%a:Memory allocation fail.\n", __func__));
       }
 
       InitializeListHead (&Instance->Entry);
@@ -1238,14 +1238,14 @@ RedfishServiceAcquireService (
     }
 
     if (TargetNetworkInterfaceInternal->StrMacAddr != NULL) {
-      DEBUG ((DEBUG_INFO, "%a:Acquire Redfish service on network interface MAC address:%s.\n", __FUNCTION__, TargetNetworkInterfaceInternal->StrMacAddr));
+      DEBUG ((DEBUG_INFO, "%a:Acquire Redfish service on network interface MAC address:%s.\n", __func__, TargetNetworkInterfaceInternal->StrMacAddr));
     } else {
-      DEBUG ((DEBUG_INFO, "%a:WARNING: No MAC address on this network interface.\n", __FUNCTION__));
+      DEBUG ((DEBUG_INFO, "%a:WARNING: No MAC address on this network interface.\n", __func__));
     }
 
     Instance->DiscoverToken = Token; // Always use the latest Token passed by caller.
     if ((Flags & EFI_REDFISH_DISCOVER_HOST_INTERFACE) != 0) {
-      DEBUG ((DEBUG_INFO, "%a:Redfish HOST interface discovery.\n", __FUNCTION__));
+      DEBUG ((DEBUG_INFO, "%a:Redfish HOST interface discovery.\n", __func__));
       Instance->HostIntfValidation = FALSE;
       if ((Flags & EFI_REDFISH_DISCOVER_VALIDATION) != 0) {
         Instance->HostIntfValidation = TRUE;
@@ -1255,12 +1255,12 @@ RedfishServiceAcquireService (
     }
 
     if ((Flags & EFI_REDFISH_DISCOVER_SSDP) != 0) {
-      DEBUG ((DEBUG_ERROR, "%a:Redfish service discovery through SSDP is not supported\n", __FUNCTION__));
+      DEBUG ((DEBUG_ERROR, "%a:Redfish service discovery through SSDP is not supported\n", __func__));
       return EFI_UNSUPPORTED;
     } else {
       if (EFI_ERROR (Status1) && EFI_ERROR (Status2)) {
         FreePool ((VOID *)Instance);
-        DEBUG ((DEBUG_ERROR, "%a:Something wrong on Redfish service discovery Status1=%x, Status2=%x.\n", __FUNCTION__, Status1, Status2));
+        DEBUG ((DEBUG_ERROR, "%a:Something wrong on Redfish service discovery Status1=%x, Status2=%x.\n", __func__, Status1, Status2));
       } else {
         if (NewInstance) {
           InsertTailList (&mRedfishDiscoverList, &Instance->Entry);
@@ -1326,7 +1326,7 @@ RedfishServiceReleaseService (
   EFI_REDFISH_DISCOVERED_INTERNAL_LIST  *DiscoveredRedfishInstance;
 
   if (IsListEmpty (&mRedfishInstanceList)) {
-    DEBUG ((DEBUG_ERROR, "%a:No any discovered Redfish service.\n", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a:No any discovered Redfish service.\n", __func__));
     return EFI_NOT_FOUND;
   }
 
@@ -1535,7 +1535,7 @@ TestForRequiredProtocols (
                       );
       if (EFI_ERROR (Status)) {
         if (Index == ListCount - 1) {
-          DEBUG ((DEBUG_ERROR, "%a: all required protocols are found on this controller handle: %p.\n", __FUNCTION__, ControllerHandle));
+          DEBUG ((DEBUG_ERROR, "%a: all required protocols are found on this controller handle: %p.\n", __func__, ControllerHandle));
           return EFI_SUCCESS;
         }
       }
@@ -1706,7 +1706,7 @@ BuildupNetworkInterface (
           if (!NewNetworkInterfaceInstalled) {
             NetworkInterface = GetTargetNetworkInterfaceInternalByController (ControllerHandle);
             if (NetworkInterface == NULL) {
-              DEBUG ((DEBUG_ERROR, "%a: Can't find network interface by ControllerHandle\n", __FUNCTION__));
+              DEBUG ((DEBUG_ERROR, "%a: Can't find network interface by ControllerHandle\n", __func__));
               return Status;
             }
           }
@@ -1720,10 +1720,10 @@ BuildupNetworkInterface (
                                                                       (VOID *)&mRedfishDiscover
                                                                       );
           if (EFI_ERROR (Status)) {
-            DEBUG ((DEBUG_ERROR, "%a: Fail to install EFI_REDFISH_DISCOVER_PROTOCOL\n", __FUNCTION__));
+            DEBUG ((DEBUG_ERROR, "%a: Fail to install EFI_REDFISH_DISCOVER_PROTOCOL\n", __func__));
           }
         } else {
-          DEBUG ((DEBUG_INFO, "%a: Not REST EX, continue with next\n", __FUNCTION__));
+          DEBUG ((DEBUG_INFO, "%a: Not REST EX, continue with next\n", __func__));
           Index++;
           if (Index == (sizeof (gRequiredProtocol) / sizeof (REDFISH_DISCOVER_REQUIRED_PROTOCOL))) {
             break;
diff --git a/RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.c b/RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.c
index 872cf3ae0609..45fc6e2182bc 100644
--- a/RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.c
+++ b/RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.c
@@ -59,11 +59,11 @@ RedfishCreateSmbiosTable42 (
   Status = RedfishPlatformHostInterfaceDeviceDescriptor (&DeviceType, &DeviceDescriptor);
   if (EFI_ERROR (Status)) {
     if (Status == EFI_NOT_FOUND) {
-      DEBUG ((DEBUG_ERROR, "%a: No Redfish host interface descriptor is provided on this platform.", __FUNCTION__));
+      DEBUG ((DEBUG_ERROR, "%a: No Redfish host interface descriptor is provided on this platform.", __func__));
       return EFI_NOT_FOUND;
     }
 
-    DEBUG ((DEBUG_ERROR, "%a: Fail to get device descriptor, %r.", __FUNCTION__, Status));
+    DEBUG ((DEBUG_ERROR, "%a: Fail to get device descriptor, %r.", __func__, Status));
     return Status;
   }
 
@@ -71,7 +71,7 @@ RedfishCreateSmbiosTable42 (
       (DeviceType != REDFISH_HOST_INTERFACE_DEVICE_TYPE_PCI_PCIE_V2)
       )
   {
-    DEBUG ((DEBUG_ERROR, "%a: Only support either protocol type 04h or 05h as Redfish host interface.", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a: Only support either protocol type 04h or 05h as Redfish host interface.", __func__));
     return EFI_UNSUPPORTED;
   }
 
@@ -98,7 +98,7 @@ RedfishCreateSmbiosTable42 (
     }
 
     if (EFI_ERROR (Status)) {
-      DEBUG ((DEBUG_ERROR, "%a: Fail to get Redfish host interafce protocol type data.", __FUNCTION__));
+      DEBUG ((DEBUG_ERROR, "%a: Fail to get Redfish host interafce protocol type data.", __func__));
       if (ProtocolRecords != NULL) {
         FreePool (ProtocolRecords);
       }
@@ -124,7 +124,7 @@ RedfishCreateSmbiosTable42 (
     } else {
       NewProtocolRecords = ReallocatePool (CurrentProtocolsDataLength, NewProtocolsDataLength, (VOID *)ProtocolRecords);
       if (NewProtocolRecords == NULL) {
-        DEBUG ((DEBUG_ERROR, "%a: Fail to allocate memory for Redfish host interface protocol data.", __FUNCTION__));
+        DEBUG ((DEBUG_ERROR, "%a: Fail to allocate memory for Redfish host interface protocol data.", __func__));
         FreePool (ProtocolRecords);
         FreePool (ProtocolRecord);
         return EFI_OUT_OF_RESOURCES;
@@ -258,7 +258,7 @@ PlatformHostInterfaceInformationReady (
   IN  VOID       *Context
   )
 {
-  DEBUG ((DEBUG_INFO, "%a: Platform Redfish Host Interface informtion is ready\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a: Platform Redfish Host Interface informtion is ready\n", __func__));
 
   RedfishCreateSmbiosTable42 ();
 
@@ -290,7 +290,7 @@ RedfishHostInterfaceDxeEntryPoint (
   EFI_STATUS  Status;
   EFI_GUID    *ReadyGuid;
 
-  DEBUG ((DEBUG_INFO, "%a: Entry\n.", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a: Entry\n.", __func__));
 
   //
   // Check if the Redfish Host Interface depends on
diff --git a/RedfishPkg/RedfishRestExDxe/RedfishRestExImpl.c b/RedfishPkg/RedfishRestExDxe/RedfishRestExImpl.c
index 75b3f1fab8fc..41f2b29c83be 100644
--- a/RedfishPkg/RedfishRestExDxe/RedfishRestExImpl.c
+++ b/RedfishPkg/RedfishRestExDxe/RedfishRestExImpl.c
@@ -28,17 +28,17 @@ ResetHttpTslSession (
 {
   EFI_STATUS  Status;
 
-  DEBUG ((DEBUG_INFO, "%a: TCP connection is finished. Could be TSL session closure, reset HTTP instance for the new TLS session.\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a: TCP connection is finished. Could be TSL session closure, reset HTTP instance for the new TLS session.\n", __func__));
 
   Status = Instance->HttpIo.Http->Configure (Instance->HttpIo.Http, NULL);
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "%a: Error to reset HTTP instance.\n", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a: Error to reset HTTP instance.\n", __func__));
     return Status;
   }
 
   Status = Instance->HttpIo.Http->Configure (Instance->HttpIo.Http, &((EFI_REST_EX_HTTP_CONFIG_DATA *)Instance->ConfigData)->HttpConfigData);
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "%a: Error to re-initiate HTTP instance.\n", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a: Error to re-initiate HTTP instance.\n", __func__));
   }
 
   return Status;
@@ -70,7 +70,7 @@ RedfishCheckHttpReceiveStatus (
     ReturnStatus = EFI_SUCCESS;
   } else if (HttpIoReceiveStatus != EFI_CONNECTION_FIN) {
     if ((Instance->Flags & RESTEX_INSTANCE_FLAGS_TCP_ERROR_RETRY) == 0) {
-      DEBUG ((DEBUG_ERROR, "%a: TCP error, reset HTTP session.\n", __FUNCTION__));
+      DEBUG ((DEBUG_ERROR, "%a: TCP error, reset HTTP session.\n", __func__));
       Instance->Flags |= RESTEX_INSTANCE_FLAGS_TCP_ERROR_RETRY;
       gBS->Stall (500);
       Status = ResetHttpTslSession (Instance);
@@ -78,20 +78,20 @@ RedfishCheckHttpReceiveStatus (
         return EFI_NOT_READY;
       }
 
-      DEBUG ((DEBUG_ERROR, "%a: Reset HTTP instance fail.\n", __FUNCTION__));
+      DEBUG ((DEBUG_ERROR, "%a: Reset HTTP instance fail.\n", __func__));
     }
 
     ReturnStatus = EFI_DEVICE_ERROR;
   } else {
     if ((Instance->Flags & RESTEX_INSTANCE_FLAGS_TLS_RETRY) != 0) {
-      DEBUG ((DEBUG_ERROR, "%a: REST_EX Send and receive fail even with a new TLS session.\n", __FUNCTION__));
+      DEBUG ((DEBUG_ERROR, "%a: REST_EX Send and receive fail even with a new TLS session.\n", __func__));
       ReturnStatus = EFI_DEVICE_ERROR;
     }
 
     Instance->Flags |= RESTEX_INSTANCE_FLAGS_TLS_RETRY;
     Status           = ResetHttpTslSession (Instance);
     if (EFI_ERROR (Status)) {
-      DEBUG ((DEBUG_ERROR, "%a: Reset HTTP instance fail.\n", __FUNCTION__));
+      DEBUG ((DEBUG_ERROR, "%a: Reset HTTP instance fail.\n", __func__));
       ReturnStatus = EFI_DEVICE_ERROR;
     }
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 09/18] ArmPlatformPkg: Update code to be more C11 compliant by using __func__
  2023-04-06 22:23 [PATCH 00/18] Replace pre-standard macro __FUNCTION__ with C99 __func__ throughout edk2 Rebecca Cran
                   ` (7 preceding siblings ...)
  2023-04-06 22:23 ` [PATCH 08/18] RedfishPkg: " Rebecca Cran
@ 2023-04-06 22:23 ` Rebecca Cran
  2023-04-06 22:23 ` [PATCH 10/18] UnitTestFrameworkPkg: Update " Rebecca Cran
                   ` (11 subsequent siblings)
  20 siblings, 0 replies; 34+ messages in thread
From: Rebecca Cran @ 2023-04-06 22:23 UTC (permalink / raw)
  To: devel, Liming Gao, Michael D Kinney, Guomin Jiang, Wei6 Xu,
	Guo Dong, Ray Ni, Sean Rhodes, James Lu, Gua Guo, Andrew Fish,
	Hao A Wu, Maciej Rabeda, Siyuan Fu, Jiewen Yao, Jian J Wang,
	Xiaoyu Lu, Ard Biesheuvel, Sami Mujawar, Supreeth Venkatesh,
	Michael Kubacki, Nate DeSimone, Sean Brogan
  Cc: Rebecca Cran, Leif Lindholm, Abner Chang, Nickle Wang,
	Igor Kulchytskyy, Daniel Schaefer, Min Xu, Jordan Justen,
	Gerd Hoffmann, Peter Grehan, Erdem Aktas, James Bottomley,
	Tom Lendacky, Michael Roth, Sunil V L, Andrei Warkentin

__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
ArmPlatformPkg.

Visual Studio versions before VS 2015 don't support __func__ and so
will fail to compile. A workaround is to define __func__ as
__FUNCTION__ :

  #define __func__ __FUNCTION__

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
---
 ArmPlatformPkg/Drivers/SP805WatchdogDxe/SP805Watchdog.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ArmPlatformPkg/Drivers/SP805WatchdogDxe/SP805Watchdog.c b/ArmPlatformPkg/Drivers/SP805WatchdogDxe/SP805Watchdog.c
index 5821dc195822..b8e7fbe38d77 100644
--- a/ArmPlatformPkg/Drivers/SP805WatchdogDxe/SP805Watchdog.c
+++ b/ArmPlatformPkg/Drivers/SP805WatchdogDxe/SP805Watchdog.c
@@ -397,7 +397,7 @@ SP805Initialize (
       DEBUG ((
         DEBUG_ERROR,
         "%a: failed to register watchdog interrupt - %r\n",
-        __FUNCTION__,
+        __func__,
         Status
         ));
       return Status;
@@ -406,7 +406,7 @@ SP805Initialize (
     DEBUG ((
       DEBUG_WARN,
       "%a: no interrupt specified, running in RESET mode only\n",
-      __FUNCTION__
+      __func__
       ));
   }
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 10/18] UnitTestFrameworkPkg: Update to be more C11 compliant by using __func__
  2023-04-06 22:23 [PATCH 00/18] Replace pre-standard macro __FUNCTION__ with C99 __func__ throughout edk2 Rebecca Cran
                   ` (8 preceding siblings ...)
  2023-04-06 22:23 ` [PATCH 09/18] ArmPlatformPkg: " Rebecca Cran
@ 2023-04-06 22:23 ` Rebecca Cran
  2023-04-06 22:23 ` [PATCH 11/18] PrmPkg: Update code " Rebecca Cran
                   ` (10 subsequent siblings)
  20 siblings, 0 replies; 34+ messages in thread
From: Rebecca Cran @ 2023-04-06 22:23 UTC (permalink / raw)
  To: devel, Liming Gao, Michael D Kinney, Guomin Jiang, Wei6 Xu,
	Guo Dong, Ray Ni, Sean Rhodes, James Lu, Gua Guo, Andrew Fish,
	Hao A Wu, Maciej Rabeda, Siyuan Fu, Jiewen Yao, Jian J Wang,
	Xiaoyu Lu, Ard Biesheuvel, Sami Mujawar, Supreeth Venkatesh,
	Michael Kubacki, Nate DeSimone, Sean Brogan
  Cc: Rebecca Cran, Leif Lindholm, Abner Chang, Nickle Wang,
	Igor Kulchytskyy, Daniel Schaefer, Min Xu, Jordan Justen,
	Gerd Hoffmann, Peter Grehan, Erdem Aktas, James Bottomley,
	Tom Lendacky, Michael Roth, Sunil V L, Andrei Warkentin

__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
UnitTestFrameworkPkg.

Visual Studio versions before VS 2015 don't support __func__ and so
will fail to compile. A workaround is to define __func__ as
__FUNCTION__ :

  #define __func__ __FUNCTION__

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
---
 UnitTestFrameworkPkg/Library/UnitTestBootLibUsbClass/UnitTestBootLibUsbClass.c                               | 12 ++++-----
 UnitTestFrameworkPkg/Library/UnitTestLib/Log.c                                                               |  2 +-
 UnitTestFrameworkPkg/Library/UnitTestLib/UnitTestLib.c                                                       |  4 +--
 UnitTestFrameworkPkg/Library/UnitTestPersistenceLibSimpleFileSystem/UnitTestPersistenceLibSimpleFileSystem.c | 26 ++++++++++----------
 UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultReportLib.c                               |  2 +-
 UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultReportLibConOut.c                         |  2 +-
 UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultReportLibDebugLib.c                       |  2 +-
 7 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/UnitTestFrameworkPkg/Library/UnitTestBootLibUsbClass/UnitTestBootLibUsbClass.c b/UnitTestFrameworkPkg/Library/UnitTestBootLibUsbClass/UnitTestBootLibUsbClass.c
index ebb42186a534..b9b2d23eb14d 100644
--- a/UnitTestFrameworkPkg/Library/UnitTestBootLibUsbClass/UnitTestBootLibUsbClass.c
+++ b/UnitTestFrameworkPkg/Library/UnitTestBootLibUsbClass/UnitTestBootLibUsbClass.c
@@ -61,7 +61,7 @@ SetBootNextDevice (
 
   DpEnd = AppendDevicePathNode (NULL, NULL);
   if (DpEnd == NULL) {
-    DEBUG ((DEBUG_ERROR, "%a: Unable to create device path.  DpEnd is NULL.\n", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a: Unable to create device path.  DpEnd is NULL.\n", __func__));
     Status = EFI_OUT_OF_RESOURCES;
     goto CLEANUP;
   }
@@ -72,7 +72,7 @@ SetBootNextDevice (
          (EFI_DEVICE_PATH_PROTOCOL *)&UsbDp
          );
   if (Dp == NULL) {
-    DEBUG ((DEBUG_ERROR, "%a: Unable to create device path.  Dp is NULL.\n", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a: Unable to create device path.  Dp is NULL.\n", __func__));
     Status = EFI_OUT_OF_RESOURCES;
     goto CLEANUP;
   }
@@ -88,15 +88,15 @@ SetBootNextDevice (
              OptionalDataSize
              );
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "%a: Error creating load option.  Status = %r\n", __FUNCTION__, Status));
+    DEBUG ((DEBUG_ERROR, "%a: Error creating load option.  Status = %r\n", __func__, Status));
     goto CLEANUP;
   }
 
   NewOptionValid = TRUE;
-  DEBUG ((DEBUG_VERBOSE, "%a: Generic USB Class Device boot option created.\n", __FUNCTION__));
+  DEBUG ((DEBUG_VERBOSE, "%a: Generic USB Class Device boot option created.\n", __func__));
   Status = EfiBootManagerLoadOptionToVariable (&NewOption);
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "%a: Error Saving boot option NV variable. Status = %r\n", __FUNCTION__, Status));
+    DEBUG ((DEBUG_ERROR, "%a: Error Saving boot option NV variable. Status = %r\n", __func__, Status));
     goto CLEANUP;
   }
 
@@ -111,7 +111,7 @@ SetBootNextDevice (
                   &(BootNextValue)
                   );
 
-  DEBUG ((DEBUG_VERBOSE, "%a - Set BootNext Status (%r)\n", __FUNCTION__, Status));
+  DEBUG ((DEBUG_VERBOSE, "%a - Set BootNext Status (%r)\n", __func__, Status));
 
 CLEANUP:
   if (Dp != NULL) {
diff --git a/UnitTestFrameworkPkg/Library/UnitTestLib/Log.c b/UnitTestFrameworkPkg/Library/UnitTestLib/Log.c
index 3998aafdf843..19eb8ee0db6e 100644
--- a/UnitTestFrameworkPkg/Library/UnitTestLib/Log.c
+++ b/UnitTestFrameworkPkg/Library/UnitTestLib/Log.c
@@ -118,7 +118,7 @@ UnitTestLogInit (
   // Make sure that you're cooking with gas.
   //
   if (Test == NULL) {
-    DEBUG ((DEBUG_ERROR, "%a called with invalid Test parameter\n", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a called with invalid Test parameter\n", __func__));
     return;
   }
 
diff --git a/UnitTestFrameworkPkg/Library/UnitTestLib/UnitTestLib.c b/UnitTestFrameworkPkg/Library/UnitTestLib/UnitTestLib.c
index 5b442ed122ea..322ea15b1575 100644
--- a/UnitTestFrameworkPkg/Library/UnitTestLib/UnitTestLib.c
+++ b/UnitTestFrameworkPkg/Library/UnitTestLib/UnitTestLib.c
@@ -274,7 +274,7 @@ InitUnitTestFramework (
       //
       // Don't actually report it as an error, but emit a warning.
       //
-      DEBUG ((DEBUG_ERROR, "%a - Cache was detected, but failed to load.\n", __FUNCTION__));
+      DEBUG ((DEBUG_ERROR, "%a - Cache was detected, but failed to load.\n", __func__));
       Status = EFI_SUCCESS;
     }
   }
@@ -856,7 +856,7 @@ SaveFrameworkState (
   //
   Status = SaveUnitTestCache (FrameworkHandle, Header, Header->SaveStateSize);
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "%a - Could not save state! %r\n", __FUNCTION__, Status));
+    DEBUG ((DEBUG_ERROR, "%a - Could not save state! %r\n", __func__, Status));
     Status = EFI_DEVICE_ERROR;
   }
 
diff --git a/UnitTestFrameworkPkg/Library/UnitTestPersistenceLibSimpleFileSystem/UnitTestPersistenceLibSimpleFileSystem.c b/UnitTestFrameworkPkg/Library/UnitTestPersistenceLibSimpleFileSystem/UnitTestPersistenceLibSimpleFileSystem.c
index d7a62145dac6..b59991683f48 100644
--- a/UnitTestFrameworkPkg/Library/UnitTestPersistenceLibSimpleFileSystem/UnitTestPersistenceLibSimpleFileSystem.c
+++ b/UnitTestFrameworkPkg/Library/UnitTestPersistenceLibSimpleFileSystem/UnitTestPersistenceLibSimpleFileSystem.c
@@ -61,7 +61,7 @@ GetCacheFileDevicePath (
                   (VOID **)&LoadedImage
                   );
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_WARN, "%a - Failed to locate DevicePath for loaded image. %r\n", __FUNCTION__, Status));
+    DEBUG ((DEBUG_WARN, "%a - Failed to locate DevicePath for loaded image. %r\n", __func__, Status));
     return NULL;
   }
 
@@ -91,7 +91,7 @@ GetCacheFileDevicePath (
   // Make sure we didn't get any weird data.
   //
   if (DirectorySlashOffset == 0) {
-    DEBUG ((DEBUG_ERROR, "%a - Weird 0-length string when processing app path.\n", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a - Weird 0-length string when processing app path.\n", __func__));
     goto Exit;
   }
 
@@ -112,7 +112,7 @@ GetCacheFileDevicePath (
   // Let's check and make sure that's right.
   //
   if (AppPath[DirectorySlashOffset] != L'\\') {
-    DEBUG ((DEBUG_ERROR, "%a - Could not find a single directory separator in app path.\n", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a - Could not find a single directory separator in app path.\n", __func__));
     goto Exit;
   }
 
@@ -202,7 +202,7 @@ DoesCacheExist (
     FreePool (FileDevicePath);
   }
 
-  DEBUG ((DEBUG_VERBOSE, "%a - Returning %d\n", __FUNCTION__, !EFI_ERROR (Status)));
+  DEBUG ((DEBUG_VERBOSE, "%a - Returning %d\n", __func__, !EFI_ERROR (Status)));
 
   return (!EFI_ERROR (Status));
 }
@@ -263,7 +263,7 @@ SaveUnitTestCache (
     //
     Status = ShellDeleteFile (&FileHandle);
     if (EFI_ERROR (Status)) {
-      DEBUG ((DEBUG_ERROR, "%a failed to delete file %r\n", __FUNCTION__, Status));
+      DEBUG ((DEBUG_ERROR, "%a failed to delete file %r\n", __func__, Status));
     }
   }
 
@@ -277,7 +277,7 @@ SaveUnitTestCache (
              0
              );
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "%a - Opening file for writing failed! %r\n", __FUNCTION__, Status));
+    DEBUG ((DEBUG_ERROR, "%a - Opening file for writing failed! %r\n", __func__, Status));
     goto Exit;
   }
 
@@ -285,7 +285,7 @@ SaveUnitTestCache (
   // Write the data to the file.
   //
   WriteCount = SaveStateSize;
-  DEBUG ((DEBUG_INFO, "%a - Writing %d bytes to file...\n", __FUNCTION__, WriteCount));
+  DEBUG ((DEBUG_INFO, "%a - Writing %d bytes to file...\n", __func__, WriteCount));
   Status = ShellWriteFile (
              FileHandle,
              &WriteCount,
@@ -293,9 +293,9 @@ SaveUnitTestCache (
              );
 
   if (EFI_ERROR (Status) || (WriteCount != SaveStateSize)) {
-    DEBUG ((DEBUG_ERROR, "%a - Writing to file failed! %r\n", __FUNCTION__, Status));
+    DEBUG ((DEBUG_ERROR, "%a - Writing to file failed! %r\n", __func__, Status));
   } else {
-    DEBUG ((DEBUG_INFO, "%a - SUCCESS!\n", __FUNCTION__));
+    DEBUG ((DEBUG_INFO, "%a - SUCCESS!\n", __func__));
   }
 
   //
@@ -368,7 +368,7 @@ LoadUnitTestCache (
              0
              );
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "%a - Opening file for writing failed! %r\n", __FUNCTION__, Status));
+    DEBUG ((DEBUG_ERROR, "%a - Opening file for writing failed! %r\n", __func__, Status));
     goto Exit;
   } else {
     IsFileOpened = TRUE;
@@ -379,7 +379,7 @@ LoadUnitTestCache (
   //
   Status = ShellGetFileSize (FileHandle, &LargeFileSize);
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "%a - Failed to determine file size! %r\n", __FUNCTION__, Status));
+    DEBUG ((DEBUG_ERROR, "%a - Failed to determine file size! %r\n", __func__, Status));
     goto Exit;
   }
 
@@ -390,7 +390,7 @@ LoadUnitTestCache (
   *SaveStateSize = FileSize;
   Buffer         = AllocatePool (FileSize);
   if (Buffer == NULL) {
-    DEBUG ((DEBUG_ERROR, "%a - Failed to allocate a pool to hold the file contents! %r\n", __FUNCTION__, Status));
+    DEBUG ((DEBUG_ERROR, "%a - Failed to allocate a pool to hold the file contents! %r\n", __func__, Status));
     Status = EFI_OUT_OF_RESOURCES;
     goto Exit;
   }
@@ -400,7 +400,7 @@ LoadUnitTestCache (
   //
   Status = ShellReadFile (FileHandle, &FileSize, Buffer);
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "%a - Failed to read the file contents! %r\n", __FUNCTION__, Status));
+    DEBUG ((DEBUG_ERROR, "%a - Failed to read the file contents! %r\n", __func__, Status));
   }
 
 Exit:
diff --git a/UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultReportLib.c b/UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultReportLib.c
index d088b927a6c2..5e2973beb3e1 100644
--- a/UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultReportLib.c
+++ b/UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultReportLib.c
@@ -102,7 +102,7 @@ GetStringForFailureType (
   //
   // Return last entry if no match found.
   //
-  DEBUG ((DEBUG_INFO, "%a Failure Type does not have string defined 0x%X\n", __FUNCTION__, (UINT32)Failure));
+  DEBUG ((DEBUG_INFO, "%a Failure Type does not have string defined 0x%X\n", __func__, (UINT32)Failure));
   return mFailureTypeStrings[Index].String;
 }
 
diff --git a/UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultReportLibConOut.c b/UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultReportLibConOut.c
index aba00fe7b962..3bcbf557a168 100644
--- a/UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultReportLibConOut.c
+++ b/UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultReportLibConOut.c
@@ -25,7 +25,7 @@ ReportPrint (
   VA_START (Marker, Format);
   Length = UnicodeVSPrintAsciiFormat (String, sizeof (String), Format, Marker);
   if (Length == 0) {
-    DEBUG ((DEBUG_ERROR, "%a formatted string is too long\n", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a formatted string is too long\n", __func__));
   } else {
     gST->ConOut->OutputString (gST->ConOut, String);
   }
diff --git a/UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultReportLibDebugLib.c b/UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultReportLibDebugLib.c
index ac330861fd40..eb78554f9101 100644
--- a/UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultReportLibDebugLib.c
+++ b/UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultReportLibDebugLib.c
@@ -24,7 +24,7 @@ ReportPrint (
   VA_START (Marker, Format);
   Length = AsciiVSPrint (String, sizeof (String), Format, Marker);
   if (Length == 0) {
-    DEBUG ((DEBUG_ERROR, "%a formatted string is too long\n", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a formatted string is too long\n", __func__));
   } else {
     DEBUG ((DEBUG_INFO, String));
   }
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 11/18] PrmPkg: Update code to be more C11 compliant by using __func__
  2023-04-06 22:23 [PATCH 00/18] Replace pre-standard macro __FUNCTION__ with C99 __func__ throughout edk2 Rebecca Cran
                   ` (9 preceding siblings ...)
  2023-04-06 22:23 ` [PATCH 10/18] UnitTestFrameworkPkg: Update " Rebecca Cran
@ 2023-04-06 22:23 ` Rebecca Cran
  2023-04-06 22:23 ` [PATCH 12/18] StandaloneMmPkg: " Rebecca Cran
                   ` (9 subsequent siblings)
  20 siblings, 0 replies; 34+ messages in thread
From: Rebecca Cran @ 2023-04-06 22:23 UTC (permalink / raw)
  To: devel, Liming Gao, Michael D Kinney, Guomin Jiang, Wei6 Xu,
	Guo Dong, Ray Ni, Sean Rhodes, James Lu, Gua Guo, Andrew Fish,
	Hao A Wu, Maciej Rabeda, Siyuan Fu, Jiewen Yao, Jian J Wang,
	Xiaoyu Lu, Ard Biesheuvel, Sami Mujawar, Supreeth Venkatesh,
	Michael Kubacki, Nate DeSimone, Sean Brogan
  Cc: Rebecca Cran, Leif Lindholm, Abner Chang, Nickle Wang,
	Igor Kulchytskyy, Daniel Schaefer, Min Xu, Jordan Justen,
	Gerd Hoffmann, Peter Grehan, Erdem Aktas, James Bottomley,
	Tom Lendacky, Michael Roth, Sunil V L, Andrei Warkentin

__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
PrmPkg.

Visual Studio versions before VS 2015 don't support __func__ and so
will fail to compile. A workaround is to define __func__ as
__FUNCTION__ :

  #define __func__ __FUNCTION__

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
---
 PrmPkg/Application/PrmInfo/PrmInfo.c                                            |  6 +--
 PrmPkg/Library/DxePrmContextBufferLib/DxePrmContextBufferLib.c                  | 10 ++---
 PrmPkg/Library/DxePrmContextBufferLib/UnitTest/DxePrmContextBufferLibUnitTest.c |  2 +-
 PrmPkg/Library/DxePrmModuleDiscoveryLib/DxePrmModuleDiscoveryLib.c              | 14 +++----
 PrmPkg/Library/DxePrmPeCoffLib/DxePrmPeCoffLib.c                                | 40 +++++++++---------
 PrmPkg/PrmConfigDxe/PrmConfigDxe.c                                              | 44 ++++++++++----------
 PrmPkg/PrmLoaderDxe/PrmLoaderDxe.c                                              | 22 +++++-----
 PrmPkg/PrmSsdtInstallDxe/PrmSsdtInstallDxe.c                                    |  4 +-
 8 files changed, 71 insertions(+), 71 deletions(-)

diff --git a/PrmPkg/Application/PrmInfo/PrmInfo.c b/PrmPkg/Application/PrmInfo/PrmInfo.c
index 0cde2fad3b4b..d7ce0d03be60 100644
--- a/PrmPkg/Application/PrmInfo/PrmInfo.c
+++ b/PrmPkg/Application/PrmInfo/PrmInfo.c
@@ -493,7 +493,7 @@ ExecutePrmHandlerByGuid (
         DEBUG_ERROR,
         "%a - %a: An error occurred creating a context buffer for handler %g\n",
         gEfiCallerBaseName,
-        __FUNCTION__,
+        __func__,
         HandlerContext->Guid
         ));
     }
@@ -628,7 +628,7 @@ ParseParameterList (
       DEBUG_ERROR,
       "%a - %a: An error occurred during PRM module discovery (%r)\n",
       gEfiCallerBaseName,
-      __FUNCTION__,
+      __func__,
       Status
       ));
     ReturnStatus = Status;
@@ -719,7 +719,7 @@ UefiMain (
       DEBUG_ERROR,
       "%a - %a: An error occurred parsing user-provided arguments (%r)\n",
       gEfiCallerBaseName,
-      __FUNCTION__,
+      __func__,
       Status
       ));
   }
diff --git a/PrmPkg/Library/DxePrmContextBufferLib/DxePrmContextBufferLib.c b/PrmPkg/Library/DxePrmContextBufferLib/DxePrmContextBufferLib.c
index 3036aa503ec8..a6ad141556a4 100644
--- a/PrmPkg/Library/DxePrmContextBufferLib/DxePrmContextBufferLib.c
+++ b/PrmPkg/Library/DxePrmContextBufferLib/DxePrmContextBufferLib.c
@@ -40,7 +40,7 @@ FindContextBufferInModuleBuffers (
 {
   UINTN  Index;
 
-  DEBUG ((DEBUG_INFO, "    %a %a - Entry.\n", _DBGMSGID_, __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "    %a %a - Entry.\n", _DBGMSGID_, __func__));
 
   if ((HandlerGuid == NULL) || (ModuleContextBuffers == NULL) || (ContextBuffer == NULL)) {
     return EFI_INVALID_PARAMETER;
@@ -89,7 +89,7 @@ GetModuleContextBuffers (
   PRM_CONFIG_PROTOCOL       *PrmConfigProtocol;
   CONST PRM_CONTEXT_BUFFER  *PrmContextBuffer;
 
-  DEBUG ((DEBUG_INFO, "    %a %a - Entry.\n", _DBGMSGID_, __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "    %a %a - Entry.\n", _DBGMSGID_, __func__));
 
   if ((Guid == NULL) || (PrmModuleContextBuffers == NULL)) {
     return EFI_INVALID_PARAMETER;
@@ -122,7 +122,7 @@ GetModuleContextBuffers (
             DEBUG_INFO,
             "      %a %a: Found a PRM configuration protocol for PRM module %g.\n",
             _DBGMSGID_,
-            __FUNCTION__,
+            __func__,
             Guid
             ));
 
@@ -143,7 +143,7 @@ GetModuleContextBuffers (
     DEBUG_INFO,
     "      %a %a: Could not locate a PRM configuration protocol for PRM handler %g.\n",
     _DBGMSGID_,
-    __FUNCTION__,
+    __func__,
     Guid
     ));
 
@@ -176,7 +176,7 @@ GetContextBuffer (
   EFI_STATUS                        Status;
   CONST PRM_MODULE_CONTEXT_BUFFERS  *ContextBuffers;
 
-  DEBUG ((DEBUG_INFO, "    %a %a - Entry.\n", _DBGMSGID_, __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "    %a %a - Entry.\n", _DBGMSGID_, __func__));
 
   if ((PrmHandlerGuid == NULL) || (PrmContextBuffer == NULL)) {
     return EFI_INVALID_PARAMETER;
diff --git a/PrmPkg/Library/DxePrmContextBufferLib/UnitTest/DxePrmContextBufferLibUnitTest.c b/PrmPkg/Library/DxePrmContextBufferLib/UnitTest/DxePrmContextBufferLibUnitTest.c
index fdc32993b82d..212c4cf6aaba 100644
--- a/PrmPkg/Library/DxePrmContextBufferLib/UnitTest/DxePrmContextBufferLibUnitTest.c
+++ b/PrmPkg/Library/DxePrmContextBufferLib/UnitTest/DxePrmContextBufferLibUnitTest.c
@@ -384,7 +384,7 @@ VerifyGetModuleContextBuffers (
     UT_ASSERT_TRUE (CompareGuid (TestContext->ExpectedModuleGuid, &ContextBuffers->ModuleGuid));
     UT_LOG_INFO (
       "%a: Searching by %a GUID ({%g}) returned ContextBuffers at 0x%x\n",
-      __FUNCTION__,
+      __func__,
       ((TestContext->GuidSearchType == ByModuleGuid) ? "module" : "handler"),
       TestContext->Guid,
       (UINTN)ContextBuffers
diff --git a/PrmPkg/Library/DxePrmModuleDiscoveryLib/DxePrmModuleDiscoveryLib.c b/PrmPkg/Library/DxePrmModuleDiscoveryLib/DxePrmModuleDiscoveryLib.c
index e6bea47bc583..efd9f231baa0 100644
--- a/PrmPkg/Library/DxePrmModuleDiscoveryLib/DxePrmModuleDiscoveryLib.c
+++ b/PrmPkg/Library/DxePrmModuleDiscoveryLib/DxePrmModuleDiscoveryLib.c
@@ -48,7 +48,7 @@ GetNextPrmModuleEntry (
   PRM_MODULE_IMAGE_CONTEXT_LIST_ENTRY  *CurrentListEntry;
   PRM_MODULE_IMAGE_CONTEXT_LIST_ENTRY  *ForwardListEntry;
 
-  DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __func__));
 
   if (ModuleImageContext == NULL) {
     return EFI_INVALID_PARAMETER;
@@ -94,7 +94,7 @@ CreateNewPrmModuleImageContextListEntry (
 {
   PRM_MODULE_IMAGE_CONTEXT_LIST_ENTRY  *PrmModuleImageContextListEntry;
 
-  DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __func__));
 
   PrmModuleImageContextListEntry = AllocateZeroPool (sizeof (*PrmModuleImageContextListEntry));
   if (PrmModuleImageContextListEntry == NULL) {
@@ -105,7 +105,7 @@ CreateNewPrmModuleImageContextListEntry (
     DEBUG_INFO,
     "  %a %a: Allocated PrmModuleImageContextListEntry at 0x%x of size 0x%x bytes.\n",
     _DBGMSGID_,
-    __FUNCTION__,
+    __func__,
     (UINTN)PrmModuleImageContextListEntry,
     sizeof (*PrmModuleImageContextListEntry)
     ));
@@ -186,7 +186,7 @@ DiscoverPrmModules (
   EFI_MMRAM_DESCRIPTOR                 *MmramRanges;
   UINTN                                MmramRangeCount;
 
-  DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __func__));
 
   PrmHandlerCount = 0;
   PrmModuleCount  = 0;
@@ -203,7 +203,7 @@ DiscoverPrmModules (
                   &HandleBuffer
                   );
   if (EFI_ERROR (Status) && (HandleCount == 0)) {
-    DEBUG ((DEBUG_ERROR, "%a %a: No LoadedImageProtocol instances found!\n", _DBGMSGID_, __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a %a: No LoadedImageProtocol instances found!\n", _DBGMSGID_, __func__));
     return EFI_NOT_FOUND;
   }
 
@@ -255,7 +255,7 @@ DiscoverPrmModules (
         DEBUG_WARN,
         "%a %a: ImageHandle 0x%016lx is not a valid PE/COFF image. It cannot be considered a PRM module.\n",
         _DBGMSGID_,
-        __FUNCTION__,
+        __func__,
         (EFI_PHYSICAL_ADDRESS)(UINTN)LoadedImageProtocol->ImageBase
         ));
       continue;
@@ -304,7 +304,7 @@ DiscoverPrmModules (
     InsertTailList (&mPrmModuleList, &PrmModuleImageContextListEntry->Link);
     PrmHandlerCount += TempPrmModuleImageContext.ExportDescriptor->Header.NumberPrmHandlers;
     PrmModuleCount++;
-    DEBUG ((DEBUG_INFO, "%a %a: New PRM Module inserted into list to be processed.\n", _DBGMSGID_, __FUNCTION__));
+    DEBUG ((DEBUG_INFO, "%a %a: New PRM Module inserted into list to be processed.\n", _DBGMSGID_, __func__));
   }
 
   if (HandlerCount != NULL) {
diff --git a/PrmPkg/Library/DxePrmPeCoffLib/DxePrmPeCoffLib.c b/PrmPkg/Library/DxePrmPeCoffLib/DxePrmPeCoffLib.c
index d535c2c10596..15792777b74b 100644
--- a/PrmPkg/Library/DxePrmPeCoffLib/DxePrmPeCoffLib.c
+++ b/PrmPkg/Library/DxePrmPeCoffLib/DxePrmPeCoffLib.c
@@ -51,7 +51,7 @@ GetPrmModuleExportDescriptorTable (
   UINT32                               *ExportAddressTable;
   PRM_MODULE_EXPORT_DESCRIPTOR_STRUCT  *TempExportDescriptor;
 
-  DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __func__));
 
   if ((ImageExportDirectory == NULL) ||
       (PeCoffLoaderImageContext == NULL) ||
@@ -67,7 +67,7 @@ GetPrmModuleExportDescriptorTable (
     DEBUG_INFO,
     "  %a %a: %d exported names found in this image.\n",
     _DBGMSGID_,
-    __FUNCTION__,
+    __func__,
     ImageExportDirectory->NumberOfNames
     ));
 
@@ -85,7 +85,7 @@ GetPrmModuleExportDescriptorTable (
       DEBUG_INFO,
       "  %a %a: Export Name[0x%x] - %a.\n",
       _DBGMSGID_,
-      __FUNCTION__,
+      __func__,
       Index,
       CurrentExportName
       ));
@@ -101,29 +101,29 @@ GetPrmModuleExportDescriptorTable (
         DEBUG_INFO,
         "  %a %a: PRM Module Export Descriptor found. Ordinal = %d.\n",
         _DBGMSGID_,
-        __FUNCTION__,
+        __func__,
         PrmModuleExportDescriptorOrdinal
         ));
       if (PrmModuleExportDescriptorOrdinal >= ImageExportDirectory->NumberOfFunctions) {
-        DEBUG ((DEBUG_ERROR, "%a %a: The PRM Module Export Descriptor ordinal value is invalid.\n", _DBGMSGID_, __FUNCTION__));
+        DEBUG ((DEBUG_ERROR, "%a %a: The PRM Module Export Descriptor ordinal value is invalid.\n", _DBGMSGID_, __func__));
         return EFI_NOT_FOUND;
       }
 
       TempExportDescriptor = (PRM_MODULE_EXPORT_DESCRIPTOR_STRUCT *)((UINTN)CurrentImageAddress + ExportAddressTable[PrmModuleExportDescriptorOrdinal]);
       if (TempExportDescriptor->Header.Signature == PRM_MODULE_EXPORT_DESCRIPTOR_SIGNATURE) {
         *ExportDescriptor = TempExportDescriptor;
-        DEBUG ((DEBUG_INFO, "  %a %a: PRM Module Export Descriptor found at 0x%x.\n", _DBGMSGID_, __FUNCTION__, (UINTN)ExportDescriptor));
+        DEBUG ((DEBUG_INFO, "  %a %a: PRM Module Export Descriptor found at 0x%x.\n", _DBGMSGID_, __func__, (UINTN)ExportDescriptor));
       } else {
         DEBUG ((
           DEBUG_INFO,
           "  %a %a: PRM Module Export Descriptor found at 0x%x but signature check failed.\n",
           _DBGMSGID_,
-          __FUNCTION__,
+          __func__,
           (UINTN)TempExportDescriptor
           ));
       }
 
-      DEBUG ((DEBUG_INFO, "  %a %a: Exiting export iteration since export descriptor found.\n", _DBGMSGID_, __FUNCTION__));
+      DEBUG ((DEBUG_INFO, "  %a %a: Exiting export iteration since export descriptor found.\n", _DBGMSGID_, __func__));
       return EFI_SUCCESS;
     }
   }
@@ -194,7 +194,7 @@ GetExportDirectoryInPeCoffImage (
         DEBUG_WARN,
         "%a %a: The machine type for this image is not valid for a PRM module.\n",
         _DBGMSGID_,
-        __FUNCTION__
+        __func__
         ));
       return EFI_UNSUPPORTED;
   }
@@ -208,7 +208,7 @@ GetExportDirectoryInPeCoffImage (
   // Check the PE/COFF Header Signature. Determine if the image is valid and/or a TE image.
   //
   if (OptionalHeaderPtrUnion.Pe32->Signature != EFI_IMAGE_NT_SIGNATURE) {
-    DEBUG ((DEBUG_ERROR, "%a %a: The PE signature is not valid for the current image.\n", _DBGMSGID_, __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a %a: The PE signature is not valid for the current image.\n", _DBGMSGID_, __func__));
     return EFI_UNSUPPORTED;
   }
 
@@ -237,18 +237,18 @@ GetExportDirectoryInPeCoffImage (
     //
     // The directory address overflows
     //
-    DEBUG ((DEBUG_ERROR, "%a %a: The export directory entry in this image results in overflow.\n", _DBGMSGID_, __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a %a: The export directory entry in this image results in overflow.\n", _DBGMSGID_, __func__));
     return EFI_UNSUPPORTED;
   } else {
-    DEBUG ((DEBUG_INFO, "%a %a: Export Directory Entry found in the image at 0x%x.\n", _DBGMSGID_, __FUNCTION__, (UINTN)OptionalHeaderPtrUnion.Pe32));
-    DEBUG ((DEBUG_INFO, "  %a %a: Directory Entry Virtual Address = 0x%x.\n", _DBGMSGID_, __FUNCTION__, DirectoryEntry->VirtualAddress));
+    DEBUG ((DEBUG_INFO, "%a %a: Export Directory Entry found in the image at 0x%x.\n", _DBGMSGID_, __func__, (UINTN)OptionalHeaderPtrUnion.Pe32));
+    DEBUG ((DEBUG_INFO, "  %a %a: Directory Entry Virtual Address = 0x%x.\n", _DBGMSGID_, __func__, DirectoryEntry->VirtualAddress));
 
     ExportDirectory = (EFI_IMAGE_EXPORT_DIRECTORY *)((UINTN)Image + DirectoryEntry->VirtualAddress);
     DEBUG ((
       DEBUG_INFO,
       "  %a %a: Export Directory Table found successfully at 0x%x. Name address = 0x%x. Name = %a.\n",
       _DBGMSGID_,
-      __FUNCTION__,
+      __func__,
       (UINTN)ExportDirectory,
       ((UINTN)Image + ExportDirectory->Name),
       (CHAR8 *)((UINTN)Image + ExportDirectory->Name)
@@ -287,7 +287,7 @@ GetImageVersionInPeCoffImage (
   EFI_IMAGE_OPTIONAL_HEADER_PTR_UNION  OptionalHeaderPtrUnion;
   UINT16                               Magic;
 
-  DEBUG ((DEBUG_INFO, "    %a %a - Entry.\n", _DBGMSGID_, __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "    %a %a - Entry.\n", _DBGMSGID_, __func__));
 
   if ((Image == NULL) || (PeCoffLoaderImageContext == NULL) || (ImageMajorVersion == NULL) || (ImageMinorVersion == NULL)) {
     return EFI_INVALID_PARAMETER;
@@ -320,7 +320,7 @@ GetImageVersionInPeCoffImage (
         DEBUG_WARN,
         "%a %a: The machine type for this image is not valid for a PRM module.\n",
         _DBGMSGID_,
-        __FUNCTION__
+        __func__
         ));
       return EFI_UNSUPPORTED;
   }
@@ -333,7 +333,7 @@ GetImageVersionInPeCoffImage (
   // Check the PE/COFF Header Signature. Determine if the image is valid and/or a TE image.
   //
   if (OptionalHeaderPtrUnion.Pe32->Signature != EFI_IMAGE_NT_SIGNATURE) {
-    DEBUG ((DEBUG_ERROR, "%a %a: The PE signature is not valid for the current image.\n", _DBGMSGID_, __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a %a: The PE signature is not valid for the current image.\n", _DBGMSGID_, __func__));
     return EFI_UNSUPPORTED;
   }
 
@@ -351,8 +351,8 @@ GetImageVersionInPeCoffImage (
     *ImageMinorVersion = OptionalHeaderPtrUnion.Pe32Plus->OptionalHeader.MinorImageVersion;
   }
 
-  DEBUG ((DEBUG_INFO, "      %a %a - Image Major Version: 0x%02x.\n", _DBGMSGID_, __FUNCTION__, *ImageMajorVersion));
-  DEBUG ((DEBUG_INFO, "      %a %a - Image Minor Version: 0x%02x.\n", _DBGMSGID_, __FUNCTION__, *ImageMinorVersion));
+  DEBUG ((DEBUG_INFO, "      %a %a - Image Major Version: 0x%02x.\n", _DBGMSGID_, __func__, *ImageMajorVersion));
+  DEBUG ((DEBUG_INFO, "      %a %a - Image Minor Version: 0x%02x.\n", _DBGMSGID_, __func__, *ImageMinorVersion));
 
   return EFI_SUCCESS;
 }
@@ -404,7 +404,7 @@ GetExportEntryAddress (
 
       ASSERT (CurrentExportOrdinal < ImageExportDirectory->NumberOfFunctions);
       if (CurrentExportOrdinal >= ImageExportDirectory->NumberOfFunctions) {
-        DEBUG ((DEBUG_ERROR, "  %a %a: The export ordinal value is invalid.\n", _DBGMSGID_, __FUNCTION__));
+        DEBUG ((DEBUG_ERROR, "  %a %a: The export ordinal value is invalid.\n", _DBGMSGID_, __func__));
         break;
       }
 
diff --git a/PrmPkg/PrmConfigDxe/PrmConfigDxe.c b/PrmPkg/PrmConfigDxe/PrmConfigDxe.c
index c175ee2183ce..550ee64b4c53 100644
--- a/PrmPkg/PrmConfigDxe/PrmConfigDxe.c
+++ b/PrmPkg/PrmConfigDxe/PrmConfigDxe.c
@@ -71,7 +71,7 @@ SetRuntimeMemoryRangeAttributes (
   UINTN                            Index;
   EFI_GCD_MEMORY_SPACE_DESCRIPTOR  Descriptor;
 
-  DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __func__));
 
   if ((RuntimeMmioRanges == NULL) || (RuntimeMmioRanges->Count == 0)) {
     return;
@@ -82,14 +82,14 @@ SetRuntimeMemoryRangeAttributes (
       DEBUG_INFO,
       "      %a %a: Runtime MMIO Range [%d].\n",
       _DBGMSGID_,
-      __FUNCTION__,
+      __func__,
       Index
       ));
     DEBUG ((
       DEBUG_INFO,
       "      %a %a: Physical address = 0x%016x. Length = 0x%x.\n",
       _DBGMSGID_,
-      __FUNCTION__,
+      __func__,
       RuntimeMmioRanges->Range[Index].PhysicalBaseAddress,
       RuntimeMmioRanges->Range[Index].Length
       ));
@@ -141,7 +141,7 @@ SetRuntimeMemoryRangeAttributes (
         DEBUG_ERROR,
         "      %a %a: Error [%r] finding descriptor for runtime memory range 0x%016x.\n",
         _DBGMSGID_,
-        __FUNCTION__,
+        __func__,
         Status,
         RuntimeMmioRanges->Range[Index].PhysicalBaseAddress
         ));
@@ -163,12 +163,12 @@ SetRuntimeMemoryRangeAttributes (
         DEBUG_ERROR,
         "      %a %a: Error [%r] setting descriptor for runtime memory range 0x%016x.\n",
         _DBGMSGID_,
-        __FUNCTION__,
+        __func__,
         Status,
         RuntimeMmioRanges->Range[Index].PhysicalBaseAddress
         ));
     } else {
-      DEBUG ((DEBUG_INFO, "      %a %a: Successfully set runtime attribute for the MMIO range.\n", _DBGMSGID_, __FUNCTION__));
+      DEBUG ((DEBUG_INFO, "      %a %a: Successfully set runtime attribute for the MMIO range.\n", _DBGMSGID_, __func__));
     }
   }
 }
@@ -189,7 +189,7 @@ StoreVirtualMemoryAddressChangePointers (
   EFI_HANDLE           *HandleBuffer;
   PRM_CONFIG_PROTOCOL  *PrmConfigProtocol;
 
-  DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __func__));
 
   RangeIndex = 0;
 
@@ -199,7 +199,7 @@ StoreVirtualMemoryAddressChangePointers (
       DEBUG_ERROR,
       "  %a %a: Memory allocation for runtime MMIO pointer array failed.\n",
       _DBGMSGID_,
-      __FUNCTION__
+      __func__
       ));
     ASSERT (FALSE);
     return;
@@ -232,7 +232,7 @@ StoreVirtualMemoryAddressChangePointers (
             DEBUG_ERROR,
             "  %a %a: Index out of bounds - Actual count (%d) of runtime MMIO ranges exceeds maximum count (%d).\n",
             _DBGMSGID_,
-            __FUNCTION__,
+            __func__,
             RangeIndex + 1,
             mMaxRuntimeMmioRangeCount
             ));
@@ -248,7 +248,7 @@ StoreVirtualMemoryAddressChangePointers (
       DEBUG_INFO,
       "  %a %a: %d MMIO ranges buffers saved for future virtual memory conversion.\n",
       _DBGMSGID_,
-      __FUNCTION__,
+      __func__,
       RangeIndex
       ));
   }
@@ -277,12 +277,12 @@ ValidatePrmDataBuffer (
   }
 
   if (PrmDataBuffer->Header.Signature != PRM_DATA_BUFFER_HEADER_SIGNATURE) {
-    DEBUG ((DEBUG_ERROR, "  %a %a: The PRM data buffer signature is invalid. PRM module.\n", _DBGMSGID_, __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "  %a %a: The PRM data buffer signature is invalid. PRM module.\n", _DBGMSGID_, __func__));
     return EFI_NOT_FOUND;
   }
 
   if (PrmDataBuffer->Header.Length < sizeof (PRM_DATA_BUFFER_HEADER)) {
-    DEBUG ((DEBUG_ERROR, "  %a %a: The PRM data buffer length is invalid.\n", _DBGMSGID_, __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "  %a %a: The PRM data buffer length is invalid.\n", _DBGMSGID_, __func__));
     return EFI_BUFFER_TOO_SMALL;
   }
 
@@ -311,12 +311,12 @@ ValidatePrmContextBuffer (
   }
 
   if (PrmContextBuffer->Signature != PRM_CONTEXT_BUFFER_SIGNATURE) {
-    DEBUG ((DEBUG_ERROR, "  %a %a: The PRM context buffer signature is invalid.\n", _DBGMSGID_, __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "  %a %a: The PRM context buffer signature is invalid.\n", _DBGMSGID_, __func__));
     return EFI_NOT_FOUND;
   }
 
   if (IsZeroGuid (&PrmContextBuffer->HandlerGuid)) {
-    DEBUG ((DEBUG_ERROR, "  %a %a: The PRM context buffer GUID is zero.\n", _DBGMSGID_, __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "  %a %a: The PRM context buffer GUID is zero.\n", _DBGMSGID_, __func__));
     return EFI_NOT_FOUND;
   }
 
@@ -325,7 +325,7 @@ ValidatePrmContextBuffer (
       DEBUG_ERROR,
       "    %a %a: Error in static buffer for PRM handler %g.\n",
       _DBGMSGID_,
-      __FUNCTION__,
+      __func__,
       &PrmContextBuffer->HandlerGuid
       ));
     return EFI_NOT_FOUND;
@@ -387,7 +387,7 @@ PrmConfigEndOfDxeNotification (
   PRM_CONTEXT_BUFFER   *CurrentContextBuffer;
   PRM_CONFIG_PROTOCOL  *PrmConfigProtocol;
 
-  DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __func__));
 
   HandleBuffer = NULL;
   Status       = gBS->LocateHandleBuffer (
@@ -413,11 +413,11 @@ PrmConfigEndOfDxeNotification (
         DEBUG_INFO,
         "  %a %a: Found PRM configuration protocol for PRM module %g.\n",
         _DBGMSGID_,
-        __FUNCTION__,
+        __func__,
         &PrmConfigProtocol->ModuleContextBuffers.ModuleGuid
         ));
 
-      DEBUG ((DEBUG_INFO, "      %a %a: Validating module context buffers...\n", _DBGMSGID_, __FUNCTION__));
+      DEBUG ((DEBUG_INFO, "      %a %a: Validating module context buffers...\n", _DBGMSGID_, __func__));
       for (BufferIndex = 0; BufferIndex < PrmConfigProtocol->ModuleContextBuffers.BufferCount; BufferIndex++) {
         CurrentContextBuffer = &(PrmConfigProtocol->ModuleContextBuffers.Buffer[BufferIndex]);
 
@@ -427,20 +427,20 @@ PrmConfigEndOfDxeNotification (
             DEBUG_ERROR,
             "        %a %a: Context buffer validation failed for PRM handler %g.\n",
             _DBGMSGID_,
-            __FUNCTION__,
+            __func__,
             CurrentContextBuffer->HandlerGuid
             ));
         }
       }
 
-      DEBUG ((DEBUG_INFO, "      %a %a: Module context buffer validation complete.\n", _DBGMSGID_, __FUNCTION__));
+      DEBUG ((DEBUG_INFO, "      %a %a: Module context buffer validation complete.\n", _DBGMSGID_, __func__));
 
       if (PrmConfigProtocol->ModuleContextBuffers.RuntimeMmioRanges != NULL) {
         DEBUG ((
           DEBUG_INFO,
           "    %a %a: Found %d PRM runtime MMIO ranges.\n",
           _DBGMSGID_,
-          __FUNCTION__,
+          __func__,
           PrmConfigProtocol->ModuleContextBuffers.RuntimeMmioRanges->Count
           ));
         SetRuntimeMemoryRangeAttributes (PrmConfigProtocol->ModuleContextBuffers.RuntimeMmioRanges);
@@ -478,7 +478,7 @@ PrmConfigEntryPoint (
   EFI_STATUS  Status;
   EFI_EVENT   Event;
 
-  DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __func__));
 
   //
   // Register a notification function to change memory attributes at end of DXE
diff --git a/PrmPkg/PrmLoaderDxe/PrmLoaderDxe.c b/PrmPkg/PrmLoaderDxe/PrmLoaderDxe.c
index 5a223d783d80..477c24c8b8ff 100644
--- a/PrmPkg/PrmLoaderDxe/PrmLoaderDxe.c
+++ b/PrmPkg/PrmLoaderDxe/PrmLoaderDxe.c
@@ -73,7 +73,7 @@ ProcessPrmModules (
 
   UINT64  HandlerPhysicalAddress;
 
-  DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __func__));
 
   if (PrmAcpiDescriptionTable == NULL) {
     return EFI_INVALID_PARAMETER;
@@ -89,19 +89,19 @@ ProcessPrmModules (
       DEBUG_ERROR,
       "  %a %a: The Platform GUID in the DSC file must be set to a unique non-zero value.\n",
       _DBGMSGID_,
-      __FUNCTION__
+      __func__
       ));
     ASSERT (!CompareGuid (&gEdkiiDscPlatformGuid, &gZeroGuid));
   }
 
-  DEBUG ((DEBUG_INFO, "  %a %a: %d total PRM modules to process.\n", _DBGMSGID_, __FUNCTION__, mPrmModuleCount));
-  DEBUG ((DEBUG_INFO, "  %a %a: %d total PRM handlers to process.\n", _DBGMSGID_, __FUNCTION__, mPrmHandlerCount));
+  DEBUG ((DEBUG_INFO, "  %a %a: %d total PRM modules to process.\n", _DBGMSGID_, __func__, mPrmModuleCount));
+  DEBUG ((DEBUG_INFO, "  %a %a: %d total PRM handlers to process.\n", _DBGMSGID_, __func__, mPrmHandlerCount));
 
   PrmAcpiDescriptionTableBufferSize = (UINT32)(OFFSET_OF (PRM_ACPI_DESCRIPTION_TABLE, PrmModuleInfoStructure) +
                                                (OFFSET_OF (PRM_MODULE_INFORMATION_STRUCT, HandlerInfoStructure) *  mPrmModuleCount) +
                                                (sizeof (PRM_HANDLER_INFORMATION_STRUCT) * mPrmHandlerCount)
                                                );
-  DEBUG ((DEBUG_INFO, "  %a %a: Total PRM ACPI table size: 0x%x.\n", _DBGMSGID_, __FUNCTION__, PrmAcpiDescriptionTableBufferSize));
+  DEBUG ((DEBUG_INFO, "  %a %a: Total PRM ACPI table size: 0x%x.\n", _DBGMSGID_, __func__, PrmAcpiDescriptionTableBufferSize));
 
   PrmAcpiTable = AllocateZeroPool ((UINTN)PrmAcpiDescriptionTableBufferSize);
   if (PrmAcpiTable == NULL) {
@@ -139,7 +139,7 @@ ProcessPrmModules (
       DEBUG_INFO,
       "  %a %a: PRM Module - %a with %d handlers.\n",
       _DBGMSGID_,
-      __FUNCTION__,
+      __func__,
       (CHAR8 *)((UINTN)CurrentImageAddress + CurrentImageExportDirectory->Name),
       CurrentExportDescriptorStruct->Header.NumberPrmHandlers
       ));
@@ -212,7 +212,7 @@ ProcessPrmModules (
           DEBUG_INFO,
           "    %a %a: Found %a handler physical address at 0x%016x.\n",
           _DBGMSGID_,
-          __FUNCTION__,
+          __func__,
           CurrentExportDescriptorHandlerName,
           CurrentHandlerInfoStruct->PhysicalAddress
           ));
@@ -279,7 +279,7 @@ PublishPrmAcpiTable (
                                   &TableKey
                                   );
     if (!EFI_ERROR (Status)) {
-      DEBUG ((DEBUG_INFO, "%a %a: The PRMT ACPI table was installed successfully.\n", _DBGMSGID_, __FUNCTION__));
+      DEBUG ((DEBUG_INFO, "%a %a: The PRMT ACPI table was installed successfully.\n", _DBGMSGID_, __func__));
     }
   }
 
@@ -316,7 +316,7 @@ PrmLoaderEndOfDxeNotification (
   EFI_STATUS                  Status;
   PRM_ACPI_DESCRIPTION_TABLE  *PrmAcpiDescriptionTable;
 
-  DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __func__));
 
   Status = DiscoverPrmModules (&mPrmModuleCount, &mPrmHandlerCount);
   ASSERT_EFI_ERROR (Status);
@@ -354,7 +354,7 @@ PrmLoaderEntryPoint (
   EFI_STATUS  Status;
   EFI_EVENT   EndOfDxeEvent;
 
-  DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __func__));
 
   //
   // Discover and process installed PRM modules at the End of DXE
@@ -369,7 +369,7 @@ PrmLoaderEntryPoint (
                   &EndOfDxeEvent
                   );
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "%a %a: EndOfDxe callback registration failed! %r.\n", _DBGMSGID_, __FUNCTION__, Status));
+    DEBUG ((DEBUG_ERROR, "%a %a: EndOfDxe callback registration failed! %r.\n", _DBGMSGID_, __func__, Status));
     ASSERT_EFI_ERROR (Status);
   }
 
diff --git a/PrmPkg/PrmSsdtInstallDxe/PrmSsdtInstallDxe.c b/PrmPkg/PrmSsdtInstallDxe/PrmSsdtInstallDxe.c
index e8bf4cfb8f2d..80ad7d37587d 100644
--- a/PrmPkg/PrmSsdtInstallDxe/PrmSsdtInstallDxe.c
+++ b/PrmPkg/PrmSsdtInstallDxe/PrmSsdtInstallDxe.c
@@ -42,7 +42,7 @@ InstallPrmSsdt (
   EFI_ACPI_TABLE_PROTOCOL      *AcpiTableProtocol;
   EFI_ACPI_DESCRIPTION_HEADER  *Ssdt;
 
-  DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __func__));
 
   if (OemId == NULL) {
     return EFI_INVALID_PARAMETER;
@@ -61,7 +61,7 @@ InstallPrmSsdt (
                 &SsdtSize
                 );
     ASSERT_EFI_ERROR (Status);
-    DEBUG ((DEBUG_INFO, "%a %a: SSDT loaded...\n", _DBGMSGID_, __FUNCTION__));
+    DEBUG ((DEBUG_INFO, "%a %a: SSDT loaded...\n", _DBGMSGID_, __func__));
 
     //
     // Update OEM ID in the SSDT
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 12/18] StandaloneMmPkg: Update code to be more C11 compliant by using __func__
  2023-04-06 22:23 [PATCH 00/18] Replace pre-standard macro __FUNCTION__ with C99 __func__ throughout edk2 Rebecca Cran
                   ` (10 preceding siblings ...)
  2023-04-06 22:23 ` [PATCH 11/18] PrmPkg: Update code " Rebecca Cran
@ 2023-04-06 22:23 ` Rebecca Cran
  2023-04-06 22:23 ` [PATCH 13/18] CryptoPkg: " Rebecca Cran
                   ` (8 subsequent siblings)
  20 siblings, 0 replies; 34+ messages in thread
From: Rebecca Cran @ 2023-04-06 22:23 UTC (permalink / raw)
  To: devel, Liming Gao, Michael D Kinney, Guomin Jiang, Wei6 Xu,
	Guo Dong, Ray Ni, Sean Rhodes, James Lu, Gua Guo, Andrew Fish,
	Hao A Wu, Maciej Rabeda, Siyuan Fu, Jiewen Yao, Jian J Wang,
	Xiaoyu Lu, Ard Biesheuvel, Sami Mujawar, Supreeth Venkatesh,
	Michael Kubacki, Nate DeSimone, Sean Brogan
  Cc: Rebecca Cran, Leif Lindholm, Abner Chang, Nickle Wang,
	Igor Kulchytskyy, Daniel Schaefer, Min Xu, Jordan Justen,
	Gerd Hoffmann, Peter Grehan, Erdem Aktas, James Bottomley,
	Tom Lendacky, Michael Roth, Sunil V L, Andrei Warkentin

__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
StandaloneMmPkg.

Visual Studio versions before VS 2015 don't support __func__ and so
will fail to compile. A workaround is to define __func__ as
__FUNCTION__ :

  #define __func__ __FUNCTION__

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
---
 StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/SetPermissions.c                             | 22 ++++++++++----------
 StandaloneMmPkg/Library/StandaloneMmMemLib/X86StandaloneMmMemLibInternal.c                          |  2 +-
 StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/AArch64/StandaloneMmPeCoffExtraActionLib.c | 16 +++++++-------
 3 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/SetPermissions.c b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/SetPermissions.c
index 8f2833a13512..5c6bd0e1d7d2 100644
--- a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/SetPermissions.c
+++ b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/SetPermissions.c
@@ -80,7 +80,7 @@ UpdateMmFoundationPeCoffPermissions (
       DEBUG ((
         DEBUG_ERROR,
         "%a: ImageContext->ImageRead () failed (Status = %r)\n",
-        __FUNCTION__,
+        __func__,
         Status
         ));
       return Status;
@@ -89,7 +89,7 @@ UpdateMmFoundationPeCoffPermissions (
     DEBUG ((
       DEBUG_INFO,
       "%a: Section %d of image at 0x%lx has 0x%x permissions\n",
-      __FUNCTION__,
+      __func__,
       Index,
       ImageContext->ImageAddress,
       SectionHeader.Characteristics
@@ -97,7 +97,7 @@ UpdateMmFoundationPeCoffPermissions (
     DEBUG ((
       DEBUG_INFO,
       "%a: Section %d of image at 0x%lx has %a name\n",
-      __FUNCTION__,
+      __func__,
       Index,
       ImageContext->ImageAddress,
       SectionHeader.Name
@@ -105,7 +105,7 @@ UpdateMmFoundationPeCoffPermissions (
     DEBUG ((
       DEBUG_INFO,
       "%a: Section %d of image at 0x%lx has 0x%x address\n",
-      __FUNCTION__,
+      __func__,
       Index,
       ImageContext->ImageAddress,
       ImageContext->ImageAddress + SectionHeader.VirtualAddress
@@ -113,7 +113,7 @@ UpdateMmFoundationPeCoffPermissions (
     DEBUG ((
       DEBUG_INFO,
       "%a: Section %d of image at 0x%lx has 0x%x data\n",
-      __FUNCTION__,
+      __func__,
       Index,
       ImageContext->ImageAddress,
       SectionHeader.PointerToRawData
@@ -133,7 +133,7 @@ UpdateMmFoundationPeCoffPermissions (
         DEBUG ((
           DEBUG_INFO,
           "%a: Mapping section %d of image at 0x%lx with RW-XN permissions\n",
-          __FUNCTION__,
+          __func__,
           Index,
           ImageContext->ImageAddress
           ));
@@ -141,7 +141,7 @@ UpdateMmFoundationPeCoffPermissions (
         DEBUG ((
           DEBUG_INFO,
           "%a: Mapping section %d of image at 0x%lx with RO-XN permissions\n",
-          __FUNCTION__,
+          __func__,
           Index,
           ImageContext->ImageAddress
           ));
@@ -150,7 +150,7 @@ UpdateMmFoundationPeCoffPermissions (
       DEBUG ((
         DEBUG_INFO,
         "%a: Ignoring section %d of image at 0x%lx with 0x%x permissions\n",
-        __FUNCTION__,
+        __func__,
         Index,
         ImageContext->ImageAddress,
         SectionHeader.Characteristics
@@ -251,7 +251,7 @@ GetPeCoffSectionInformation (
     DEBUG ((
       DEBUG_ERROR,
       "%a: PeCoffLoaderGetImageInfo () failed (Status == %r)\n",
-      __FUNCTION__,
+      __func__,
       Status
       ));
     return Status;
@@ -266,7 +266,7 @@ GetPeCoffSectionInformation (
       DEBUG ((
         DEBUG_WARN,
         "%a: non-TE Image at 0x%lx has SectionAlignment < 4 KB (%lu)\n",
-        __FUNCTION__,
+        __func__,
         ImageContext->ImageAddress,
         ImageContext->SectionAlignment
         ));
@@ -296,7 +296,7 @@ GetPeCoffSectionInformation (
     DEBUG ((
       DEBUG_ERROR,
       "%a: TmpContext->ImageRead () failed (Status = %r)\n",
-      __FUNCTION__,
+      __func__,
       Status
       ));
     return Status;
diff --git a/StandaloneMmPkg/Library/StandaloneMmMemLib/X86StandaloneMmMemLibInternal.c b/StandaloneMmPkg/Library/StandaloneMmMemLib/X86StandaloneMmMemLibInternal.c
index c309d1bc6a56..0b4b1174de18 100644
--- a/StandaloneMmPkg/Library/StandaloneMmMemLib/X86StandaloneMmMemLibInternal.c
+++ b/StandaloneMmPkg/Library/StandaloneMmMemLib/X86StandaloneMmMemLibInternal.c
@@ -95,7 +95,7 @@ MmMemLibInternalPopulateMmramRanges (
   EFI_MMRAM_DESCRIPTOR            *MmramDescriptors;
 
   HobStart = GetHobList ();
-  DEBUG ((DEBUG_INFO, "%a - 0x%x\n", __FUNCTION__, HobStart));
+  DEBUG ((DEBUG_INFO, "%a - 0x%x\n", __func__, HobStart));
 
   //
   // Extract MM Core Private context from the Hob. If absent search for
diff --git a/StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/AArch64/StandaloneMmPeCoffExtraActionLib.c b/StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/AArch64/StandaloneMmPeCoffExtraActionLib.c
index 426fd8dd74ac..492252843e12 100644
--- a/StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/AArch64/StandaloneMmPeCoffExtraActionLib.c
+++ b/StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/AArch64/StandaloneMmPeCoffExtraActionLib.c
@@ -55,7 +55,7 @@ UpdatePeCoffPermissions (
       DEBUG ((
         DEBUG_ERROR,
         "%a: PeCoffLoaderGetImageInfo () failed (Status = %r)\n",
-        __FUNCTION__,
+        __func__,
         Status
         ));
       return Status;
@@ -68,7 +68,7 @@ UpdatePeCoffPermissions (
     DEBUG ((
       DEBUG_INFO,
       "%a: ignoring XIP TE image at 0x%lx\n",
-      __FUNCTION__,
+      __func__,
       ImageContext->ImageAddress
       ));
     return RETURN_SUCCESS;
@@ -84,7 +84,7 @@ UpdatePeCoffPermissions (
       DEBUG ((
         DEBUG_WARN,
         "%a: non-TE Image at 0x%lx has SectionAlignment < 4 KB (%lu)\n",
-        __FUNCTION__,
+        __func__,
         ImageContext->ImageAddress,
         TmpContext.SectionAlignment
         ));
@@ -114,7 +114,7 @@ UpdatePeCoffPermissions (
     DEBUG ((
       DEBUG_ERROR,
       "%a: TmpContext.ImageRead () failed (Status = %r)\n",
-      __FUNCTION__,
+      __func__,
       Status
       ));
     return Status;
@@ -156,7 +156,7 @@ UpdatePeCoffPermissions (
       DEBUG ((
         DEBUG_ERROR,
         "%a: TmpContext.ImageRead () failed (Status = %r)\n",
-        __FUNCTION__,
+        __func__,
         Status
         ));
       return Status;
@@ -169,7 +169,7 @@ UpdatePeCoffPermissions (
         DEBUG ((
           DEBUG_INFO,
           "%a: Mapping section %d of image at 0x%lx with RO-XN permissions and size 0x%x\n",
-          __FUNCTION__,
+          __func__,
           Index,
           Base,
           SectionHeader.Misc.VirtualSize
@@ -179,7 +179,7 @@ UpdatePeCoffPermissions (
         DEBUG ((
           DEBUG_WARN,
           "%a: Mapping section %d of image at 0x%lx with RW-XN permissions and size 0x%x\n",
-          __FUNCTION__,
+          __func__,
           Index,
           Base,
           SectionHeader.Misc.VirtualSize
@@ -189,7 +189,7 @@ UpdatePeCoffPermissions (
       DEBUG ((
         DEBUG_INFO,
         "%a: Mapping section %d of image at 0x%lx with RO-X permissions and size 0x%x\n",
-        __FUNCTION__,
+        __func__,
         Index,
         Base,
         SectionHeader.Misc.VirtualSize
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 13/18] CryptoPkg: Update code to be more C11 compliant by using __func__
  2023-04-06 22:23 [PATCH 00/18] Replace pre-standard macro __FUNCTION__ with C99 __func__ throughout edk2 Rebecca Cran
                   ` (11 preceding siblings ...)
  2023-04-06 22:23 ` [PATCH 12/18] StandaloneMmPkg: " Rebecca Cran
@ 2023-04-06 22:23 ` Rebecca Cran
  2023-04-06 22:23 ` [PATCH 14/18] NetworkPkg: " Rebecca Cran
                   ` (7 subsequent siblings)
  20 siblings, 0 replies; 34+ messages in thread
From: Rebecca Cran @ 2023-04-06 22:23 UTC (permalink / raw)
  To: devel, Liming Gao, Michael D Kinney, Guomin Jiang, Wei6 Xu,
	Guo Dong, Ray Ni, Sean Rhodes, James Lu, Gua Guo, Andrew Fish,
	Hao A Wu, Maciej Rabeda, Siyuan Fu, Jiewen Yao, Jian J Wang,
	Xiaoyu Lu, Ard Biesheuvel, Sami Mujawar, Supreeth Venkatesh,
	Michael Kubacki, Nate DeSimone, Sean Brogan
  Cc: Rebecca Cran, Leif Lindholm, Abner Chang, Nickle Wang,
	Igor Kulchytskyy, Daniel Schaefer, Min Xu, Jordan Justen,
	Gerd Hoffmann, Peter Grehan, Erdem Aktas, James Bottomley,
	Tom Lendacky, Michael Roth, Sunil V L, Andrei Warkentin

__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
CryptoPkg.

Visual Studio versions before VS 2015 don't support __func__ and so
will fail to compile. A workaround is to define __func__ as
__FUNCTION__ :

  #define __func__ __FUNCTION__

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
---
 CryptoPkg/Library/TlsLib/TlsConfig.c  | 8 ++++----
 CryptoPkg/Library/TlsLib/TlsProcess.c | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/CryptoPkg/Library/TlsLib/TlsConfig.c b/CryptoPkg/Library/TlsLib/TlsConfig.c
index 60559de4a7f3..fdda73690ae5 100644
--- a/CryptoPkg/Library/TlsLib/TlsConfig.c
+++ b/CryptoPkg/Library/TlsLib/TlsConfig.c
@@ -331,7 +331,7 @@ TlsSetCipherList (
         DEBUG_VERBOSE,
         "%a:%a: skipping CipherId=0x%04x\n",
         gEfiCallerBaseName,
-        __FUNCTION__,
+        __func__,
         CipherId[Index]
         ));
       //
@@ -380,7 +380,7 @@ TlsSetCipherList (
       DEBUG_ERROR,
       "%a:%a: no CipherId could be mapped\n",
       gEfiCallerBaseName,
-      __FUNCTION__
+      __func__
       ));
     Status = EFI_UNSUPPORTED;
     goto FreeMappedCipher;
@@ -441,7 +441,7 @@ TlsSetCipherList (
     DEBUG_VERBOSE,
     "%a:%a: CipherString={\n",
     gEfiCallerBaseName,
-    __FUNCTION__
+    __func__
     ));
   for (CipherStringPosition = CipherString;
        CipherStringPosition < CipherString + FullLength;
@@ -610,7 +610,7 @@ TlsSetVerifyHost (
       "%a:%a: parsed \"%a\" as an IPv%c address "
       "literal\n",
       gEfiCallerBaseName,
-      __FUNCTION__,
+      __func__,
       HostName,
       (UINTN)((BinaryAddressSize == NS_IN6ADDRSZ) ? '6' : '4')
       ));
diff --git a/CryptoPkg/Library/TlsLib/TlsProcess.c b/CryptoPkg/Library/TlsLib/TlsProcess.c
index a803d86c4f4e..db296053fd2c 100644
--- a/CryptoPkg/Library/TlsLib/TlsProcess.c
+++ b/CryptoPkg/Library/TlsLib/TlsProcess.c
@@ -127,7 +127,7 @@ TlsDoHandshake (
       DEBUG ((
         DEBUG_ERROR,
         "%a SSL_HANDSHAKE_ERROR State=0x%x SSL_ERROR_%a\n",
-        __FUNCTION__,
+        __func__,
         SSL_get_state (TlsConn->Ssl),
         Ret == SSL_ERROR_SSL ? "SSL" : Ret == SSL_ERROR_SYSCALL ? "SYSCALL" : "ZERO_RETURN"
         ));
@@ -141,7 +141,7 @@ TlsDoHandshake (
         DEBUG ((
           DEBUG_ERROR,
           "%a ERROR 0x%x=L%x:F%x:R%x\n",
-          __FUNCTION__,
+          __func__,
           ErrorCode,
           ERR_GET_LIB (ErrorCode),
           ERR_GET_FUNC (ErrorCode),
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 14/18] NetworkPkg: Update code to be more C11 compliant by using __func__
  2023-04-06 22:23 [PATCH 00/18] Replace pre-standard macro __FUNCTION__ with C99 __func__ throughout edk2 Rebecca Cran
                   ` (12 preceding siblings ...)
  2023-04-06 22:23 ` [PATCH 13/18] CryptoPkg: " Rebecca Cran
@ 2023-04-06 22:23 ` Rebecca Cran
  2023-04-06 22:23 ` [PATCH 15/18] SourceLevelDebugPkg: " Rebecca Cran
                   ` (6 subsequent siblings)
  20 siblings, 0 replies; 34+ messages in thread
From: Rebecca Cran @ 2023-04-06 22:23 UTC (permalink / raw)
  To: devel, Liming Gao, Michael D Kinney, Guomin Jiang, Wei6 Xu,
	Guo Dong, Ray Ni, Sean Rhodes, James Lu, Gua Guo, Andrew Fish,
	Hao A Wu, Maciej Rabeda, Siyuan Fu, Jiewen Yao, Jian J Wang,
	Xiaoyu Lu, Ard Biesheuvel, Sami Mujawar, Supreeth Venkatesh,
	Michael Kubacki, Nate DeSimone, Sean Brogan
  Cc: Rebecca Cran, Leif Lindholm, Abner Chang, Nickle Wang,
	Igor Kulchytskyy, Daniel Schaefer, Min Xu, Jordan Justen,
	Gerd Hoffmann, Peter Grehan, Erdem Aktas, James Bottomley,
	Tom Lendacky, Michael Roth, Sunil V L, Andrei Warkentin

__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
NetworkPkg.

Visual Studio versions before VS 2015 don't support __func__ and so
will fail to compile. A workaround is to define __func__ as
__FUNCTION__ :

  #define __func__ __FUNCTION__

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
---
 NetworkPkg/HttpDxe/HttpsSupport.c | 16 ++++++++--------
 NetworkPkg/IScsiDxe/IScsiMisc.c   |  4 ++--
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/NetworkPkg/HttpDxe/HttpsSupport.c b/NetworkPkg/HttpDxe/HttpsSupport.c
index ad611e7c3836..7330be42c006 100644
--- a/NetworkPkg/HttpDxe/HttpsSupport.c
+++ b/NetworkPkg/HttpDxe/HttpsSupport.c
@@ -436,7 +436,7 @@ TlsConfigCertificate (
       DEBUG ((
         DEBUG_ERROR,
         "%a: truncated EFI_SIGNATURE_LIST header\n",
-        __FUNCTION__
+        __func__
         ));
       goto FreeCACert;
     }
@@ -447,7 +447,7 @@ TlsConfigCertificate (
       DEBUG ((
         DEBUG_ERROR,
         "%a: SignatureListSize too small for EFI_SIGNATURE_LIST\n",
-        __FUNCTION__
+        __func__
         ));
       goto FreeCACert;
     }
@@ -456,7 +456,7 @@ TlsConfigCertificate (
       DEBUG ((
         DEBUG_ERROR,
         "%a: truncated EFI_SIGNATURE_LIST body\n",
-        __FUNCTION__
+        __func__
         ));
       goto FreeCACert;
     }
@@ -465,7 +465,7 @@ TlsConfigCertificate (
       DEBUG ((
         DEBUG_ERROR,
         "%a: only X509 certificates are supported\n",
-        __FUNCTION__
+        __func__
         ));
       Status = EFI_UNSUPPORTED;
       goto FreeCACert;
@@ -475,7 +475,7 @@ TlsConfigCertificate (
       DEBUG ((
         DEBUG_ERROR,
         "%a: SignatureHeaderSize must be 0 for X509\n",
-        __FUNCTION__
+        __func__
         ));
       goto FreeCACert;
     }
@@ -484,7 +484,7 @@ TlsConfigCertificate (
       DEBUG ((
         DEBUG_ERROR,
         "%a: SignatureSize too small for EFI_SIGNATURE_DATA\n",
-        __FUNCTION__
+        __func__
         ));
       goto FreeCACert;
     }
@@ -495,7 +495,7 @@ TlsConfigCertificate (
       DEBUG ((
         DEBUG_ERROR,
         "%a: EFI_SIGNATURE_DATA array not a multiple of SignatureSize\n",
-        __FUNCTION__
+        __func__
         ));
       goto FreeCACert;
     }
@@ -505,7 +505,7 @@ TlsConfigCertificate (
   }
 
   if (CertCount == 0) {
-    DEBUG ((DEBUG_ERROR, "%a: no X509 certificates provided\n", __FUNCTION__));
+    DEBUG ((DEBUG_ERROR, "%a: no X509 certificates provided\n", __func__));
     goto FreeCACert;
   }
 
diff --git a/NetworkPkg/IScsiDxe/IScsiMisc.c b/NetworkPkg/IScsiDxe/IScsiMisc.c
index b3ea90158f51..78dc5c73d35a 100644
--- a/NetworkPkg/IScsiDxe/IScsiMisc.c
+++ b/NetworkPkg/IScsiDxe/IScsiMisc.c
@@ -875,7 +875,7 @@ IScsiCreateAttempts (
         DEBUG_ERROR,
         "%a: Failed to set 'InitialAttemptOrder' with Guid (%g): "
         "%r\n",
-        __FUNCTION__,
+        __func__,
         &gIScsiConfigGuid,
         Status
         ));
@@ -926,7 +926,7 @@ IScsiCreateAttempts (
         DEBUG_ERROR,
         "%a: Failed to set variable (mPrivate->PortString) with Guid (%g): "
         "%r\n",
-        __FUNCTION__,
+        __func__,
         &gEfiIScsiInitiatorNameProtocolGuid,
         Status
         ));
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 15/18] SourceLevelDebugPkg: Update code to be more C11 compliant by using __func__
  2023-04-06 22:23 [PATCH 00/18] Replace pre-standard macro __FUNCTION__ with C99 __func__ throughout edk2 Rebecca Cran
                   ` (13 preceding siblings ...)
  2023-04-06 22:23 ` [PATCH 14/18] NetworkPkg: " Rebecca Cran
@ 2023-04-06 22:23 ` Rebecca Cran
  2023-04-07  3:08   ` Ni, Ray
  2023-04-06 22:23 ` [PATCH 16/18] EmulatorPkg: " Rebecca Cran
                   ` (5 subsequent siblings)
  20 siblings, 1 reply; 34+ messages in thread
From: Rebecca Cran @ 2023-04-06 22:23 UTC (permalink / raw)
  To: devel, Liming Gao, Michael D Kinney, Guomin Jiang, Wei6 Xu,
	Guo Dong, Ray Ni, Sean Rhodes, James Lu, Gua Guo, Andrew Fish,
	Hao A Wu, Maciej Rabeda, Siyuan Fu, Jiewen Yao, Jian J Wang,
	Xiaoyu Lu, Ard Biesheuvel, Sami Mujawar, Supreeth Venkatesh,
	Michael Kubacki, Nate DeSimone, Sean Brogan
  Cc: Rebecca Cran, Leif Lindholm, Abner Chang, Nickle Wang,
	Igor Kulchytskyy, Daniel Schaefer, Min Xu, Jordan Justen,
	Gerd Hoffmann, Peter Grehan, Erdem Aktas, James Bottomley,
	Tom Lendacky, Michael Roth, Sunil V L, Andrei Warkentin

__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
SourceLevelDebugPkg.

Visual Studio versions before VS 2015 don't support __func__ and so
will fail to compile. A workaround is to define __func__ as
__FUNCTION__ :

  #define __func__ __FUNCTION__

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
---
 SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCommunicationLibUsb3Dxe.c | 4 ++--
 SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCommunicationLibUsb3Pei.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCommunicationLibUsb3Dxe.c b/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCommunicationLibUsb3Dxe.c
index 4490526273c9..d37fb991f1f2 100644
--- a/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCommunicationLibUsb3Dxe.c
+++ b/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCommunicationLibUsb3Dxe.c
@@ -186,7 +186,7 @@ Usb3DxeSmmReadyToLockNotify (
 {
   USB3_DEBUG_PORT_HANDLE  *Instance;
 
-  DEBUG ((DEBUG_INFO, "%a()\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a()\n", __func__));
 
   Instance = GetUsb3DebugPortInstance ();
   ASSERT (Instance != NULL);
@@ -290,7 +290,7 @@ Usb3PciIoNotify (
         //
         // Found the PciIo for USB3 debug port.
         //
-        DEBUG ((DEBUG_INFO, "%a()\n", __FUNCTION__));
+        DEBUG ((DEBUG_INFO, "%a()\n", __func__));
         if (Usb3GetIoMmu () != NULL) {
           Instance = GetUsb3DebugPortInstance ();
           ASSERT (Instance != NULL);
diff --git a/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCommunicationLibUsb3Pei.c b/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCommunicationLibUsb3Pei.c
index 15842a317ef0..aa04442918d2 100644
--- a/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCommunicationLibUsb3Pei.c
+++ b/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCommunicationLibUsb3Pei.c
@@ -35,7 +35,7 @@ Usb3IoMmuPpiNotify (
 {
   USB3_DEBUG_PORT_HANDLE  *Instance;
 
-  DEBUG ((DEBUG_INFO, "%a()\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a()\n", __func__));
 
   Instance = GetUsb3DebugPortInstance ();
   ASSERT (Instance != NULL);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 16/18] EmulatorPkg: Update code to be more C11 compliant by using __func__
  2023-04-06 22:23 [PATCH 00/18] Replace pre-standard macro __FUNCTION__ with C99 __func__ throughout edk2 Rebecca Cran
                   ` (14 preceding siblings ...)
  2023-04-06 22:23 ` [PATCH 15/18] SourceLevelDebugPkg: " Rebecca Cran
@ 2023-04-06 22:23 ` Rebecca Cran
  2023-04-07  3:08   ` Ni, Ray
  2023-04-07  8:23   ` Chang, Abner
  2023-04-06 22:23 ` [PATCH 17/18] UefiPayloadPkg: " Rebecca Cran
                   ` (4 subsequent siblings)
  20 siblings, 2 replies; 34+ messages in thread
From: Rebecca Cran @ 2023-04-06 22:23 UTC (permalink / raw)
  To: devel, Liming Gao, Michael D Kinney, Guomin Jiang, Wei6 Xu,
	Guo Dong, Ray Ni, Sean Rhodes, James Lu, Gua Guo, Andrew Fish,
	Hao A Wu, Maciej Rabeda, Siyuan Fu, Jiewen Yao, Jian J Wang,
	Xiaoyu Lu, Ard Biesheuvel, Sami Mujawar, Supreeth Venkatesh,
	Michael Kubacki, Nate DeSimone, Sean Brogan
  Cc: Rebecca Cran, Leif Lindholm, Abner Chang, Nickle Wang,
	Igor Kulchytskyy, Daniel Schaefer, Min Xu, Jordan Justen,
	Gerd Hoffmann, Peter Grehan, Erdem Aktas, James Bottomley,
	Tom Lendacky, Michael Roth, Sunil V L, Andrei Warkentin

__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
EmulatorPkg.

Visual Studio versions before VS 2015 don't support __func__ and so
will fail to compile. A workaround is to define __func__ as
__FUNCTION__ :

  #define __func__ __FUNCTION__

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
---
 EmulatorPkg/Library/RedfishPlatformHostInterfaceLib/RedfishPlatformHostInterfaceLib.c | 2 +-
 EmulatorPkg/Win/Host/WinPacketFilter.c                                                | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/EmulatorPkg/Library/RedfishPlatformHostInterfaceLib/RedfishPlatformHostInterfaceLib.c b/EmulatorPkg/Library/RedfishPlatformHostInterfaceLib/RedfishPlatformHostInterfaceLib.c
index 4361bd4170e3..4332caa71016 100644
--- a/EmulatorPkg/Library/RedfishPlatformHostInterfaceLib/RedfishPlatformHostInterfaceLib.c
+++ b/EmulatorPkg/Library/RedfishPlatformHostInterfaceLib/RedfishPlatformHostInterfaceLib.c
@@ -538,7 +538,7 @@ RedfishPlatformHostInterfaceConstructor (
   EFI_STATUS  Status;
 
   Status = GetRedfishRecordFromVariable (&mRedfishOverIpProtocolData, &mRedfishProtocolDataSize);
-  DEBUG ((DEBUG_INFO, "%a: GetRedfishRecordFromVariable() - %r\n", __FUNCTION__, Status));
+  DEBUG ((DEBUG_INFO, "%a: GetRedfishRecordFromVariable() - %r\n", __func__, Status));
   if (!EFI_ERROR (Status)) {
     DumpRedfishIpProtocolData (mRedfishOverIpProtocolData, mRedfishProtocolDataSize);
   }
diff --git a/EmulatorPkg/Win/Host/WinPacketFilter.c b/EmulatorPkg/Win/Host/WinPacketFilter.c
index 21859897c85f..a71c7e8c131b 100644
--- a/EmulatorPkg/Win/Host/WinPacketFilter.c
+++ b/EmulatorPkg/Win/Host/WinPacketFilter.c
@@ -966,7 +966,7 @@ WintNtInitializeNetUtilityData (
     goto ErrorReturn;
   }
 
-  DEBUG ((DEBUG_INFO, "%a, total %d interface(s) found\n", __FUNCTION__, InterfaceCount));
+  DEBUG ((DEBUG_INFO, "%a, total %d interface(s) found\n", __func__, InterfaceCount));
   //
   // Active interface index is set to first interface if given instance does
   // not exist.
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 17/18] UefiPayloadPkg: Update code to be more C11 compliant by using __func__
  2023-04-06 22:23 [PATCH 00/18] Replace pre-standard macro __FUNCTION__ with C99 __func__ throughout edk2 Rebecca Cran
                   ` (15 preceding siblings ...)
  2023-04-06 22:23 ` [PATCH 16/18] EmulatorPkg: " Rebecca Cran
@ 2023-04-06 22:23 ` Rebecca Cran
  2023-04-07  5:57   ` Guo, Gua
  2023-04-07  7:55   ` Lu, James
  2023-04-06 22:23 ` [PATCH 18/18] FmpDevicePkg: " Rebecca Cran
                   ` (3 subsequent siblings)
  20 siblings, 2 replies; 34+ messages in thread
From: Rebecca Cran @ 2023-04-06 22:23 UTC (permalink / raw)
  To: devel, Liming Gao, Michael D Kinney, Guomin Jiang, Wei6 Xu,
	Guo Dong, Ray Ni, Sean Rhodes, James Lu, Gua Guo, Andrew Fish,
	Hao A Wu, Maciej Rabeda, Siyuan Fu, Jiewen Yao, Jian J Wang,
	Xiaoyu Lu, Ard Biesheuvel, Sami Mujawar, Supreeth Venkatesh,
	Michael Kubacki, Nate DeSimone, Sean Brogan
  Cc: Rebecca Cran, Leif Lindholm, Abner Chang, Nickle Wang,
	Igor Kulchytskyy, Daniel Schaefer, Min Xu, Jordan Justen,
	Gerd Hoffmann, Peter Grehan, Erdem Aktas, James Bottomley,
	Tom Lendacky, Michael Roth, Sunil V L, Andrei Warkentin

__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
UefiPayloadPkg.

Visual Studio versions before VS 2015 don't support __func__ and so
will fail to compile. A workaround is to define __func__ as
__FUNCTION__ :

  #define __func__ __FUNCTION__

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
---
 UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c | 4 ++--
 UefiPayloadPkg/UefiPayloadEntry/Ia32/DxeLoadFunc.c         | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c b/UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c
index 790e6109c03e..57274754141d 100644
--- a/UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c
+++ b/UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c
@@ -135,7 +135,7 @@ InitRootBridge (
                  &mRootBridgeDevicePathTemplate
                  );
   if (DevicePath == NULL) {
-    DEBUG ((DEBUG_ERROR, "%a: %r\n", __FUNCTION__, EFI_OUT_OF_RESOURCES));
+    DEBUG ((DEBUG_ERROR, "%a: %r\n", __func__, EFI_OUT_OF_RESOURCES));
     return EFI_OUT_OF_RESOURCES;
   }
 
@@ -145,7 +145,7 @@ InitRootBridge (
   DEBUG ((
     DEBUG_INFO,
     "%a: populated root bus %d, with room for %d subordinate bus(es)\n",
-    __FUNCTION__,
+    __func__,
     RootBusNumber,
     MaxSubBusNumber - RootBusNumber
     ));
diff --git a/UefiPayloadPkg/UefiPayloadEntry/Ia32/DxeLoadFunc.c b/UefiPayloadPkg/UefiPayloadEntry/Ia32/DxeLoadFunc.c
index c66e56aee15a..61a9f01ec9e7 100644
--- a/UefiPayloadPkg/UefiPayloadEntry/Ia32/DxeLoadFunc.c
+++ b/UefiPayloadPkg/UefiPayloadEntry/Ia32/DxeLoadFunc.c
@@ -355,7 +355,7 @@ HandOffToDxeCore (
     DEBUG ((
       DEBUG_INFO,
       "%a() Stack Base: 0x%lx, Stack Size: 0x%x\n",
-      __FUNCTION__,
+      __func__,
       BaseOfStack,
       STACK_SIZE
       ));
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 18/18] FmpDevicePkg: Update code to be more C11 compliant by using __func__
  2023-04-06 22:23 [PATCH 00/18] Replace pre-standard macro __FUNCTION__ with C99 __func__ throughout edk2 Rebecca Cran
                   ` (16 preceding siblings ...)
  2023-04-06 22:23 ` [PATCH 17/18] UefiPayloadPkg: " Rebecca Cran
@ 2023-04-06 22:23 ` Rebecca Cran
  2023-04-10  1:05   ` Xu, Wei6
  2023-04-07 10:09 ` [edk2-devel] [PATCH 00/18] Replace pre-standard macro __FUNCTION__ with C99 __func__ throughout edk2 Ard Biesheuvel
                   ` (2 subsequent siblings)
  20 siblings, 1 reply; 34+ messages in thread
From: Rebecca Cran @ 2023-04-06 22:23 UTC (permalink / raw)
  To: devel, Liming Gao, Michael D Kinney, Guomin Jiang, Wei6 Xu,
	Guo Dong, Ray Ni, Sean Rhodes, James Lu, Gua Guo, Andrew Fish,
	Hao A Wu, Maciej Rabeda, Siyuan Fu, Jiewen Yao, Jian J Wang,
	Xiaoyu Lu, Ard Biesheuvel, Sami Mujawar, Supreeth Venkatesh,
	Michael Kubacki, Nate DeSimone, Sean Brogan
  Cc: Rebecca Cran, Leif Lindholm, Abner Chang, Nickle Wang,
	Igor Kulchytskyy, Daniel Schaefer, Min Xu, Jordan Justen,
	Gerd Hoffmann, Peter Grehan, Erdem Aktas, James Bottomley,
	Tom Lendacky, Michael Roth, Sunil V L, Andrei Warkentin

__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
FmpDevicePkg.

Visual Studio versions before VS 2015 don't support __func__ and so
will fail to compile. A workaround is to define __func__ as
__FUNCTION__ :

  #define __func__ __FUNCTION__

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
---
 FmpDevicePkg/FmpDxe/VariableSupport.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/FmpDevicePkg/FmpDxe/VariableSupport.c b/FmpDevicePkg/FmpDxe/VariableSupport.c
index 541e5e0f5fc7..5126c5e2d556 100644
--- a/FmpDevicePkg/FmpDxe/VariableSupport.c
+++ b/FmpDevicePkg/FmpDxe/VariableSupport.c
@@ -832,7 +832,7 @@ LockAllFmpVariables (
   // Locate the VariablePolicy protocol.
   Status = gBS->LocateProtocol (&gEdkiiVariablePolicyProtocolGuid, NULL, (VOID **)&VariablePolicy);
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "FmpDxe %a - Could not locate VariablePolicy protocol! %r\n", __FUNCTION__, Status));
+    DEBUG ((DEBUG_ERROR, "FmpDxe %a - Could not locate VariablePolicy protocol! %r\n", __func__, Status));
     return Status;
   }
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* Re: [PATCH 16/18] EmulatorPkg: Update code to be more C11 compliant by using __func__
  2023-04-06 22:23 ` [PATCH 16/18] EmulatorPkg: " Rebecca Cran
@ 2023-04-07  3:08   ` Ni, Ray
  2023-04-07  8:23   ` Chang, Abner
  1 sibling, 0 replies; 34+ messages in thread
From: Ni, Ray @ 2023-04-07  3:08 UTC (permalink / raw)
  To: Rebecca Cran, devel@edk2.groups.io, Gao, Liming,
	Kinney, Michael D, Jiang, Guomin, Xu, Wei6, Dong, Guo,
	Rhodes, Sean, Lu, James, Guo, Gua, Andrew Fish, Wu, Hao A,
	Maciej Rabeda, Siyuan Fu, Yao, Jiewen, Wang, Jian J, Lu, Xiaoyu1,
	Ard Biesheuvel, Sami Mujawar, Supreeth Venkatesh, Michael Kubacki,
	Desimone, Nathaniel L, Sean Brogan
  Cc: Leif Lindholm, Abner Chang, Nickle Wang, Igor Kulchytskyy,
	Daniel Schaefer, Xu, Min M, Justen, Jordan L, Gerd Hoffmann,
	Peter Grehan, Aktas, Erdem, James Bottomley, Tom Lendacky,
	Michael Roth, Sunil V L, Warkentin, Andrei

Reviewed-by: Ray Ni <ray.ni@intel.com>

> -----Original Message-----
> From: Rebecca Cran <rebecca@bsdio.com>
> Sent: Friday, April 7, 2023 6:23 AM
> To: devel@edk2.groups.io; Gao, Liming <gaoliming@byosoft.com.cn>;
> Kinney, Michael D <michael.d.kinney@intel.com>; Jiang, Guomin
> <guomin.jiang@intel.com>; Xu, Wei6 <wei6.xu@intel.com>; Dong, Guo
> <guo.dong@intel.com>; Ni, Ray <ray.ni@intel.com>; Rhodes, Sean
> <sean@starlabs.systems>; Lu, James <james.lu@intel.com>; Guo, Gua
> <gua.guo@intel.com>; Andrew Fish <afish@apple.com>; Wu, Hao A
> <hao.a.wu@intel.com>; Maciej Rabeda <maciej.rabeda@linux.intel.com>;
> Siyuan Fu <siyuan.fu@intel.com>; Yao, Jiewen <jiewen.yao@intel.com>;
> Wang, Jian J <jian.j.wang@intel.com>; Lu, Xiaoyu1 <xiaoyu1.lu@intel.com>;
> Ard Biesheuvel <ardb+tianocore@kernel.org>; Sami Mujawar
> <sami.mujawar@arm.com>; Supreeth Venkatesh
> <supreeth.venkatesh@arm.com>; Michael Kubacki
> <mikuback@linux.microsoft.com>; Desimone, Nathaniel L
> <nathaniel.l.desimone@intel.com>; Sean Brogan
> <sean.brogan@microsoft.com>
> Cc: Rebecca Cran <rebecca@bsdio.com>; Leif Lindholm
> <quic_llindhol@quicinc.com>; Abner Chang <abner.chang@amd.com>;
> Nickle Wang <nicklew@nvidia.com>; Igor Kulchytskyy <igork@ami.com>;
> Daniel Schaefer <git@danielschaefer.me>; Xu, Min M
> <min.m.xu@intel.com>; Justen, Jordan L <jordan.l.justen@intel.com>; Gerd
> Hoffmann <kraxel@redhat.com>; Peter Grehan <grehan@freebsd.org>;
> Aktas, Erdem <erdemaktas@google.com>; James Bottomley
> <jejb@linux.ibm.com>; Tom Lendacky <thomas.lendacky@amd.com>;
> Michael Roth <michael.roth@amd.com>; Sunil V L
> <sunilvl@ventanamicro.com>; Warkentin, Andrei
> <andrei.warkentin@intel.com>
> Subject: [PATCH 16/18] EmulatorPkg: 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
> EmulatorPkg.
> 
> Visual Studio versions before VS 2015 don't support __func__ and so
> will fail to compile. A workaround is to define __func__ as
> __FUNCTION__ :
> 
>   #define __func__ __FUNCTION__
> 
> Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
> ---
> 
> EmulatorPkg/Library/RedfishPlatformHostInterfaceLib/RedfishPlatformHostI
> nterfaceLib.c | 2 +-
>  EmulatorPkg/Win/Host/WinPacketFilter.c                                                | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git
> a/EmulatorPkg/Library/RedfishPlatformHostInterfaceLib/RedfishPlatformHo
> stInterfaceLib.c
> b/EmulatorPkg/Library/RedfishPlatformHostInterfaceLib/RedfishPlatformHo
> stInterfaceLib.c
> index 4361bd4170e3..4332caa71016 100644
> ---
> a/EmulatorPkg/Library/RedfishPlatformHostInterfaceLib/RedfishPlatformHo
> stInterfaceLib.c
> +++
> b/EmulatorPkg/Library/RedfishPlatformHostInterfaceLib/RedfishPlatformHo
> stInterfaceLib.c
> @@ -538,7 +538,7 @@ RedfishPlatformHostInterfaceConstructor (
>    EFI_STATUS  Status;
> 
>    Status = GetRedfishRecordFromVariable (&mRedfishOverIpProtocolData,
> &mRedfishProtocolDataSize);
> -  DEBUG ((DEBUG_INFO, "%a: GetRedfishRecordFromVariable() - %r\n",
> __FUNCTION__, Status));
> +  DEBUG ((DEBUG_INFO, "%a: GetRedfishRecordFromVariable() - %r\n",
> __func__, Status));
>    if (!EFI_ERROR (Status)) {
>      DumpRedfishIpProtocolData (mRedfishOverIpProtocolData,
> mRedfishProtocolDataSize);
>    }
> diff --git a/EmulatorPkg/Win/Host/WinPacketFilter.c
> b/EmulatorPkg/Win/Host/WinPacketFilter.c
> index 21859897c85f..a71c7e8c131b 100644
> --- a/EmulatorPkg/Win/Host/WinPacketFilter.c
> +++ b/EmulatorPkg/Win/Host/WinPacketFilter.c
> @@ -966,7 +966,7 @@ WintNtInitializeNetUtilityData (
>      goto ErrorReturn;
>    }
> 
> -  DEBUG ((DEBUG_INFO, "%a, total %d interface(s) found\n",
> __FUNCTION__, InterfaceCount));
> +  DEBUG ((DEBUG_INFO, "%a, total %d interface(s) found\n", __func__,
> InterfaceCount));
>    //
>    // Active interface index is set to first interface if given instance does
>    // not exist.
> --
> 2.34.1


^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 15/18] SourceLevelDebugPkg: Update code to be more C11 compliant by using __func__
  2023-04-06 22:23 ` [PATCH 15/18] SourceLevelDebugPkg: " Rebecca Cran
@ 2023-04-07  3:08   ` Ni, Ray
  0 siblings, 0 replies; 34+ messages in thread
From: Ni, Ray @ 2023-04-07  3:08 UTC (permalink / raw)
  To: Rebecca Cran, devel@edk2.groups.io, Gao, Liming,
	Kinney, Michael D, Jiang, Guomin, Xu, Wei6, Dong, Guo,
	Rhodes, Sean, Lu, James, Guo, Gua, Andrew Fish, Wu, Hao A,
	Maciej Rabeda, Siyuan Fu, Yao, Jiewen, Wang, Jian J, Lu, Xiaoyu1,
	Ard Biesheuvel, Sami Mujawar, Supreeth Venkatesh, Michael Kubacki,
	Desimone, Nathaniel L, Sean Brogan
  Cc: Leif Lindholm, Abner Chang, Nickle Wang, Igor Kulchytskyy,
	Daniel Schaefer, Xu, Min M, Justen, Jordan L, Gerd Hoffmann,
	Peter Grehan, Aktas, Erdem, James Bottomley, Tom Lendacky,
	Michael Roth, Sunil V L, Warkentin, Andrei

Reviewed-by: Ray Ni <ray.ni@intel.com>

> -----Original Message-----
> From: Rebecca Cran <rebecca@bsdio.com>
> Sent: Friday, April 7, 2023 6:23 AM
> To: devel@edk2.groups.io; Gao, Liming <gaoliming@byosoft.com.cn>;
> Kinney, Michael D <michael.d.kinney@intel.com>; Jiang, Guomin
> <guomin.jiang@intel.com>; Xu, Wei6 <wei6.xu@intel.com>; Dong, Guo
> <guo.dong@intel.com>; Ni, Ray <ray.ni@intel.com>; Rhodes, Sean
> <sean@starlabs.systems>; Lu, James <james.lu@intel.com>; Guo, Gua
> <gua.guo@intel.com>; Andrew Fish <afish@apple.com>; Wu, Hao A
> <hao.a.wu@intel.com>; Maciej Rabeda <maciej.rabeda@linux.intel.com>;
> Siyuan Fu <siyuan.fu@intel.com>; Yao, Jiewen <jiewen.yao@intel.com>;
> Wang, Jian J <jian.j.wang@intel.com>; Lu, Xiaoyu1 <xiaoyu1.lu@intel.com>;
> Ard Biesheuvel <ardb+tianocore@kernel.org>; Sami Mujawar
> <sami.mujawar@arm.com>; Supreeth Venkatesh
> <supreeth.venkatesh@arm.com>; Michael Kubacki
> <mikuback@linux.microsoft.com>; Desimone, Nathaniel L
> <nathaniel.l.desimone@intel.com>; Sean Brogan
> <sean.brogan@microsoft.com>
> Cc: Rebecca Cran <rebecca@bsdio.com>; Leif Lindholm
> <quic_llindhol@quicinc.com>; Abner Chang <abner.chang@amd.com>;
> Nickle Wang <nicklew@nvidia.com>; Igor Kulchytskyy <igork@ami.com>;
> Daniel Schaefer <git@danielschaefer.me>; Xu, Min M
> <min.m.xu@intel.com>; Justen, Jordan L <jordan.l.justen@intel.com>; Gerd
> Hoffmann <kraxel@redhat.com>; Peter Grehan <grehan@freebsd.org>;
> Aktas, Erdem <erdemaktas@google.com>; James Bottomley
> <jejb@linux.ibm.com>; Tom Lendacky <thomas.lendacky@amd.com>;
> Michael Roth <michael.roth@amd.com>; Sunil V L
> <sunilvl@ventanamicro.com>; Warkentin, Andrei
> <andrei.warkentin@intel.com>
> Subject: [PATCH 15/18] SourceLevelDebugPkg: 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
> SourceLevelDebugPkg.
> 
> Visual Studio versions before VS 2015 don't support __func__ and so
> will fail to compile. A workaround is to define __func__ as
> __FUNCTION__ :
> 
>   #define __func__ __FUNCTION__
> 
> Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
> ---
> 
> SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCommu
> nicationLibUsb3Dxe.c | 4 ++--
> 
> SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCommu
> nicationLibUsb3Pei.c | 2 +-
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git
> a/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCom
> municationLibUsb3Dxe.c
> b/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCom
> municationLibUsb3Dxe.c
> index 4490526273c9..d37fb991f1f2 100644
> ---
> a/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCom
> municationLibUsb3Dxe.c
> +++
> b/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCom
> municationLibUsb3Dxe.c
> @@ -186,7 +186,7 @@ Usb3DxeSmmReadyToLockNotify (
>  {
>    USB3_DEBUG_PORT_HANDLE  *Instance;
> 
> -  DEBUG ((DEBUG_INFO, "%a()\n", __FUNCTION__));
> +  DEBUG ((DEBUG_INFO, "%a()\n", __func__));
> 
>    Instance = GetUsb3DebugPortInstance ();
>    ASSERT (Instance != NULL);
> @@ -290,7 +290,7 @@ Usb3PciIoNotify (
>          //
>          // Found the PciIo for USB3 debug port.
>          //
> -        DEBUG ((DEBUG_INFO, "%a()\n", __FUNCTION__));
> +        DEBUG ((DEBUG_INFO, "%a()\n", __func__));
>          if (Usb3GetIoMmu () != NULL) {
>            Instance = GetUsb3DebugPortInstance ();
>            ASSERT (Instance != NULL);
> diff --git
> a/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCom
> municationLibUsb3Pei.c
> b/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCom
> municationLibUsb3Pei.c
> index 15842a317ef0..aa04442918d2 100644
> ---
> a/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCom
> municationLibUsb3Pei.c
> +++
> b/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCom
> municationLibUsb3Pei.c
> @@ -35,7 +35,7 @@ Usb3IoMmuPpiNotify (
>  {
>    USB3_DEBUG_PORT_HANDLE  *Instance;
> 
> -  DEBUG ((DEBUG_INFO, "%a()\n", __FUNCTION__));
> +  DEBUG ((DEBUG_INFO, "%a()\n", __func__));
> 
>    Instance = GetUsb3DebugPortInstance ();
>    ASSERT (Instance != NULL);
> --
> 2.34.1


^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 03/18] UefiCpuPkg: Update code to be more C11 compliant by using __func__
  2023-04-06 22:23 ` [PATCH 03/18] UefiCpuPkg: " Rebecca Cran
@ 2023-04-07  3:09   ` Ni, Ray
  2023-04-07 11:24   ` Sunil V L
  1 sibling, 0 replies; 34+ messages in thread
From: Ni, Ray @ 2023-04-07  3:09 UTC (permalink / raw)
  To: Rebecca Cran, devel@edk2.groups.io, Gao, Liming,
	Kinney, Michael D, Jiang, Guomin, Xu, Wei6, Dong, Guo,
	Rhodes, Sean, Lu, James, Guo, Gua, Andrew Fish, Wu, Hao A,
	Maciej Rabeda, Siyuan Fu, Yao, Jiewen, Wang, Jian J, Lu, Xiaoyu1,
	Ard Biesheuvel, Sami Mujawar, Supreeth Venkatesh, Michael Kubacki,
	Desimone, Nathaniel L, Sean Brogan
  Cc: Leif Lindholm, Abner Chang, Nickle Wang, Igor Kulchytskyy,
	Daniel Schaefer, Xu, Min M, Justen, Jordan L, Gerd Hoffmann,
	Peter Grehan, Aktas, Erdem, James Bottomley, Tom Lendacky,
	Michael Roth, Sunil V L, Warkentin, Andrei

Reviewed-by: Ray Ni <ray.ni@intel.com>

> -----Original Message-----
> From: Rebecca Cran <rebecca@bsdio.com>
> Sent: Friday, April 7, 2023 6:23 AM
> To: devel@edk2.groups.io; Gao, Liming <gaoliming@byosoft.com.cn>;
> Kinney, Michael D <michael.d.kinney@intel.com>; Jiang, Guomin
> <guomin.jiang@intel.com>; Xu, Wei6 <wei6.xu@intel.com>; Dong, Guo
> <guo.dong@intel.com>; Ni, Ray <ray.ni@intel.com>; Rhodes, Sean
> <sean@starlabs.systems>; Lu, James <james.lu@intel.com>; Guo, Gua
> <gua.guo@intel.com>; Andrew Fish <afish@apple.com>; Wu, Hao A
> <hao.a.wu@intel.com>; Maciej Rabeda <maciej.rabeda@linux.intel.com>;
> Siyuan Fu <siyuan.fu@intel.com>; Yao, Jiewen <jiewen.yao@intel.com>;
> Wang, Jian J <jian.j.wang@intel.com>; Lu, Xiaoyu1 <xiaoyu1.lu@intel.com>;
> Ard Biesheuvel <ardb+tianocore@kernel.org>; Sami Mujawar
> <sami.mujawar@arm.com>; Supreeth Venkatesh
> <supreeth.venkatesh@arm.com>; Michael Kubacki
> <mikuback@linux.microsoft.com>; Desimone, Nathaniel L
> <nathaniel.l.desimone@intel.com>; Sean Brogan
> <sean.brogan@microsoft.com>
> Cc: Rebecca Cran <rebecca@bsdio.com>; Leif Lindholm
> <quic_llindhol@quicinc.com>; Abner Chang <abner.chang@amd.com>;
> Nickle Wang <nicklew@nvidia.com>; Igor Kulchytskyy <igork@ami.com>;
> Daniel Schaefer <git@danielschaefer.me>; Xu, Min M
> <min.m.xu@intel.com>; Justen, Jordan L <jordan.l.justen@intel.com>; Gerd
> Hoffmann <kraxel@redhat.com>; Peter Grehan <grehan@freebsd.org>;
> Aktas, Erdem <erdemaktas@google.com>; James Bottomley
> <jejb@linux.ibm.com>; Tom Lendacky <thomas.lendacky@amd.com>;
> Michael Roth <michael.roth@amd.com>; Sunil V L
> <sunilvl@ventanamicro.com>; Warkentin, Andrei
> <andrei.warkentin@intel.com>
> Subject: [PATCH 03/18] UefiCpuPkg: 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
> UefiCpuPkg.
> 
> Visual Studio versions before VS 2015 don't support __func__ and so
> will fail to compile. A workaround is to define __func__ as
> __FUNCTION__ :
> 
>   #define __func__ __FUNCTION__
> 
> Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
> ---
>  UefiCpuPkg/CpuDxe/CpuDxe.c                                                         |  8 ++++----
>  UefiCpuPkg/CpuDxeRiscV64/CpuDxe.c                                                  |  6 +++---
>  UefiCpuPkg/CpuS3DataDxe/CpuS3Data.c                                                |  2 +-
> 
> UefiCpuPkg/Library/BaseRiscV64CpuExceptionHandlerLib/CpuExceptionHan
> dlerLib.c      |  2 +-
> 
> UefiCpuPkg/Library/CpuExceptionHandlerLib/UnitTest/CpuExceptionHandler
> TestCommon.c |  2 +-
>  UefiCpuPkg/Library/MpInitLib/DxeMpLib.c                                            |  2 +-
>  UefiCpuPkg/Library/MpInitLib/Microcode.c                                           |  8 ++++---
> -
>  UefiCpuPkg/Library/MpInitLib/MpLib.c                                               |  2 +-
>  UefiCpuPkg/Library/MpInitLib/PeiMpLib.c                                            |  2 +-
>  UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c                                                  |  2 +-
>  UefiCpuPkg/SecCore/SecMain.c                                                       | 10 +++++-----
> 
> UefiCpuPkg/Test/UnitTest/EfiMpServicesPpiProtocol/EfiMpServicesUnitTest
> Commom.c    | 16 ++++++++--------
>  UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c                                  |  2
> +-
>  13 files changed, 32 insertions(+), 32 deletions(-)
> 
> diff --git a/UefiCpuPkg/CpuDxe/CpuDxe.c b/UefiCpuPkg/CpuDxe/CpuDxe.c
> index 3febd59d99e0..804ef5d1fe8e 100644
> --- a/UefiCpuPkg/CpuDxe/CpuDxe.c
> +++ b/UefiCpuPkg/CpuDxe/CpuDxe.c
> @@ -1078,7 +1078,7 @@ IntersectMemoryDescriptor (
>        EFI_ERROR (Status) ? DEBUG_ERROR : DEBUG_VERBOSE,
>        "%a: %a: add [%Lx, %Lx): %r\n",
>        gEfiCallerBaseName,
> -      __FUNCTION__,
> +      __func__,
>        IntersectionBase,
>        IntersectionEnd,
>        Status
> @@ -1091,7 +1091,7 @@ IntersectMemoryDescriptor (
>      "%a: %a: desc [%Lx, %Lx) type %u cap %Lx conflicts "
>      "with aperture [%Lx, %Lx) cap %Lx\n",
>      gEfiCallerBaseName,
> -    __FUNCTION__,
> +    __func__,
>      Descriptor->BaseAddress,
>      Descriptor->BaseAddress + Descriptor->Length,
>      (UINT32)Descriptor->GcdMemoryType,
> @@ -1132,7 +1132,7 @@ AddMemoryMappedIoSpace (
>        DEBUG_ERROR,
>        "%a: %a: GetMemorySpaceMap(): %r\n",
>        gEfiCallerBaseName,
> -      __FUNCTION__,
> +      __func__,
>        Status
>        ));
>      return Status;
> @@ -1215,7 +1215,7 @@ AddLocalApicMemorySpace (
>        DEBUG_INFO,
>        "%a: %a: AllocateMemorySpace() Status - %r\n",
>        gEfiCallerBaseName,
> -      __FUNCTION__,
> +      __func__,
>        Status
>        ));
>    }
> diff --git a/UefiCpuPkg/CpuDxeRiscV64/CpuDxe.c
> b/UefiCpuPkg/CpuDxeRiscV64/CpuDxe.c
> index 7551e0653603..25fe3f54c325 100644
> --- a/UefiCpuPkg/CpuDxeRiscV64/CpuDxe.c
> +++ b/UefiCpuPkg/CpuDxeRiscV64/CpuDxe.c
> @@ -296,7 +296,7 @@ CpuSetMemoryAttributes (
>    IN UINT64                 Attributes
>    )
>  {
> -  DEBUG ((DEBUG_INFO, "%a: Set memory attributes not supported yet\n",
> __FUNCTION__));
> +  DEBUG ((DEBUG_INFO, "%a: Set memory attributes not supported yet\n",
> __func__));
>    return EFI_SUCCESS;
>  }
> 
> @@ -328,10 +328,10 @@ InitializeCpu (
>      return EFI_NOT_FOUND;
>    }
> 
> -  DEBUG ((DEBUG_INFO, " %a: Firmware Context is at 0x%x.\n",
> __FUNCTION__, FirmwareContext));
> +  DEBUG ((DEBUG_INFO, " %a: Firmware Context is at 0x%x.\n", __func__,
> FirmwareContext));
> 
>    mBootHartId = FirmwareContext->BootHartId;
> -  DEBUG ((DEBUG_INFO, " %a: mBootHartId = 0x%x.\n", __FUNCTION__,
> mBootHartId));
> +  DEBUG ((DEBUG_INFO, " %a: mBootHartId = 0x%x.\n", __func__,
> mBootHartId));
> 
>    InitializeCpuExceptionHandlers (NULL);
> 
> diff --git a/UefiCpuPkg/CpuS3DataDxe/CpuS3Data.c
> b/UefiCpuPkg/CpuS3DataDxe/CpuS3Data.c
> index 59a5d932eee2..86ce5303cab4 100644
> --- a/UefiCpuPkg/CpuS3DataDxe/CpuS3Data.c
> +++ b/UefiCpuPkg/CpuS3DataDxe/CpuS3Data.c
> @@ -127,7 +127,7 @@ CpuS3DataOnEndOfDxe (
>                                                      );
>    ASSERT_EFI_ERROR (Status);
> 
> -  DEBUG ((DEBUG_VERBOSE, "%a\n", __FUNCTION__));
> +  DEBUG ((DEBUG_VERBOSE, "%a\n", __func__));
>    MtrrGetAllMtrrs (&AcpiCpuDataEx->MtrrTable);
> 
>    //
> diff --git
> a/UefiCpuPkg/Library/BaseRiscV64CpuExceptionHandlerLib/CpuExceptionHa
> ndlerLib.c
> b/UefiCpuPkg/Library/BaseRiscV64CpuExceptionHandlerLib/CpuExceptionHa
> ndlerLib.c
> index bce089feb0da..73a9dd57658c 100644
> ---
> a/UefiCpuPkg/Library/BaseRiscV64CpuExceptionHandlerLib/CpuExceptionHa
> ndlerLib.c
> +++
> b/UefiCpuPkg/Library/BaseRiscV64CpuExceptionHandlerLib/CpuExceptionHa
> ndlerLib.c
> @@ -230,7 +230,7 @@ RegisterCpuInterruptHandler (
>    IN EFI_CPU_INTERRUPT_HANDLER  InterruptHandler
>    )
>  {
> -  DEBUG ((DEBUG_INFO, "%a: Type:%x Handler: %x\n", __FUNCTION__,
> ExceptionType, InterruptHandler));
> +  DEBUG ((DEBUG_INFO, "%a: Type:%x Handler: %x\n", __func__,
> ExceptionType, InterruptHandler));
>    if (EXCEPT_RISCV_IS_IRQ (ExceptionType)) {
>      if (EXCEPT_RISCV_IRQ_INDEX (ExceptionType) >
> EXCEPT_RISCV_MAX_IRQS) {
>        return EFI_UNSUPPORTED;
> diff --git
> a/UefiCpuPkg/Library/CpuExceptionHandlerLib/UnitTest/CpuExceptionHandl
> erTestCommon.c
> b/UefiCpuPkg/Library/CpuExceptionHandlerLib/UnitTest/CpuExceptionHand
> lerTestCommon.c
> index 17afb592d3c8..9ba70c5b7340 100644
> ---
> a/UefiCpuPkg/Library/CpuExceptionHandlerLib/UnitTest/CpuExceptionHandl
> erTestCommon.c
> +++
> b/UefiCpuPkg/Library/CpuExceptionHandlerLib/UnitTest/CpuExceptionHand
> lerTestCommon.c
> @@ -292,7 +292,7 @@ GetBspStackBase (
>        DEBUG ((
>          DEBUG_INFO,
>          "%a: Bsp StackBase = 0x%016lx  StackSize = 0x%016lx\n",
> -        __FUNCTION__,
> +        __func__,
>          MemoryHob->AllocDescriptor.MemoryBaseAddress,
>          MemoryHob->AllocDescriptor.MemoryLength
>          ));
> diff --git a/UefiCpuPkg/Library/MpInitLib/DxeMpLib.c
> b/UefiCpuPkg/Library/MpInitLib/DxeMpLib.c
> index 330676b700d1..57ddb86600a7 100644
> --- a/UefiCpuPkg/Library/MpInitLib/DxeMpLib.c
> +++ b/UefiCpuPkg/Library/MpInitLib/DxeMpLib.c
> @@ -463,7 +463,7 @@ MpInitChangeApLoopCallback (
>        );
>    }
> 
> -  DEBUG ((DEBUG_INFO, "%a() done!\n", __FUNCTION__));
> +  DEBUG ((DEBUG_INFO, "%a() done!\n", __func__));
>  }
> 
>  /**
> diff --git a/UefiCpuPkg/Library/MpInitLib/Microcode.c
> b/UefiCpuPkg/Library/MpInitLib/Microcode.c
> index f9f070fa8bf2..11720560afee 100644
> --- a/UefiCpuPkg/Library/MpInitLib/Microcode.c
> +++ b/UefiCpuPkg/Library/MpInitLib/Microcode.c
> @@ -170,7 +170,7 @@ ShadowMicrocodePatchWorker (
>    DEBUG ((
>      DEBUG_INFO,
>      "%a: Required microcode patches have been loaded at 0x%lx, with size
> 0x%lx.\n",
> -    __FUNCTION__,
> +    __func__,
>      CpuMpData->MicrocodePatchAddress,
>      CpuMpData->MicrocodePatchRegionSize
>      ));
> @@ -305,7 +305,7 @@ ShadowMicrocodePatchByPcd (
>      DEBUG ((
>        DEBUG_INFO,
>        "%a: 0x%x microcode patches will be loaded into memory, with size
> 0x%x.\n",
> -      __FUNCTION__,
> +      __func__,
>        PatchCount,
>        TotalLoadSize
>        ));
> @@ -365,7 +365,7 @@ GetMicrocodePatchInfoFromHob (
> 
>    GuidHob = GetFirstGuidHob (&gEdkiiMicrocodePatchHobGuid);
>    if (GuidHob == NULL) {
> -    DEBUG ((DEBUG_INFO, "%a: Microcode patch cache HOB is not found.\n",
> __FUNCTION__));
> +    DEBUG ((DEBUG_INFO, "%a: Microcode patch cache HOB is not found.\n",
> __func__));
>      return FALSE;
>    }
> 
> @@ -377,7 +377,7 @@ GetMicrocodePatchInfoFromHob (
>    DEBUG ((
>      DEBUG_INFO,
>      "%a: MicrocodeBase = 0x%lx, MicrocodeSize = 0x%lx\n",
> -    __FUNCTION__,
> +    __func__,
>      *Address,
>      *RegionSize
>      ));
> diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c
> b/UefiCpuPkg/Library/MpInitLib/MpLib.c
> index e5dc852ed95f..f1f284071441 100644
> --- a/UefiCpuPkg/Library/MpInitLib/MpLib.c
> +++ b/UefiCpuPkg/Library/MpInitLib/MpLib.c
> @@ -1537,7 +1537,7 @@ TimedWaitForApFinish (
>      DEBUG ((
>        DEBUG_VERBOSE,
>        "%a: reached FinishedApLimit=%u in %Lu microseconds\n",
> -      __FUNCTION__,
> +      __func__,
>        FinishedApLimit,
>        DivU64x64Remainder (
>          MultU64x32 (CpuMpData->TotalTime, 1000000),
> diff --git a/UefiCpuPkg/Library/MpInitLib/PeiMpLib.c
> b/UefiCpuPkg/Library/MpInitLib/PeiMpLib.c
> index e732371ddd21..013f89b197d0 100644
> --- a/UefiCpuPkg/Library/MpInitLib/PeiMpLib.c
> +++ b/UefiCpuPkg/Library/MpInitLib/PeiMpLib.c
> @@ -758,7 +758,7 @@ PlatformShadowMicrocode (
>    DEBUG ((
>      DEBUG_INFO,
>      "%a: Required microcode patches have been loaded at 0x%lx, with size
> 0x%lx.\n",
> -    __FUNCTION__,
> +    __func__,
>      CpuMpData->MicrocodePatchAddress,
>      CpuMpData->MicrocodePatchRegionSize
>      ));
> diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c
> b/UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c
> index 240eee6a7d2f..0f7ee0372dbd 100644
> --- a/UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c
> +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c
> @@ -932,7 +932,7 @@ InitSmmS3ResumeState (
>      DEBUG ((
>        DEBUG_ERROR,
>        "ERROR:%a(): HOB(gEfiAcpiVariableGuid=%g) needed by S3 resume
> doesn't exist!\n",
> -      __FUNCTION__,
> +      __func__,
>        &gEfiAcpiVariableGuid
>        ));
>      CpuDeadLoop ();
> diff --git a/UefiCpuPkg/SecCore/SecMain.c
> b/UefiCpuPkg/SecCore/SecMain.c
> index fe03d8019a40..95375850ec76 100644
> --- a/UefiCpuPkg/SecCore/SecMain.c
> +++ b/UefiCpuPkg/SecCore/SecMain.c
> @@ -170,7 +170,7 @@ SecStartup (
>    DEBUG ((
>      DEBUG_INFO,
>      "%a() TempRAM Base: 0x%x, TempRAM Size: 0x%x, BootFirmwareVolume
> 0x%x\n",
> -    __FUNCTION__,
> +    __func__,
>      TempRamBase,
>      SizeOfRam,
>      BootFirmwareVolume
> @@ -242,7 +242,7 @@ SecStartup (
>    DEBUG ((
>      DEBUG_INFO,
>      "%a() BFV Base: 0x%x, BFV Size: 0x%x, TempRAM Base: 0x%x, TempRAM
> Size: 0x%x, PeiTempRamBase: 0x%x, PeiTempRamSize: 0x%x, StackBase:
> 0x%x, StackSize: 0x%x\n",
> -    __FUNCTION__,
> +    __func__,
>      SecCoreData.BootFirmwareVolumeBase,
>      SecCoreData.BootFirmwareVolumeSize,
>      SecCoreData.TemporaryRamBase,
> @@ -345,7 +345,7 @@ SecStartupPhase2 (
>    DEBUG ((
>      DEBUG_INFO,
>      "%a() PeiCoreEntryPoint: 0x%x\n",
> -    __FUNCTION__,
> +    __func__,
>      PeiCoreEntryPoint
>      ));
> 
> @@ -394,7 +394,7 @@ SecStartupPhase2 (
>      DEBUG ((
>        DEBUG_INFO,
>        "%a() PeiTemporaryRamBase: 0x%x, PeiTemporaryRamSize: 0x%x\n",
> -      __FUNCTION__,
> +      __func__,
>        SecCoreData->PeiTemporaryRamBase,
>        SecCoreData->PeiTemporaryRamSize
>        ));
> @@ -408,7 +408,7 @@ SecStartupPhase2 (
>    DEBUG ((
>      DEBUG_INFO,
>      "%a() Stack Base: 0x%p, Stack Size: 0x%x\n",
> -    __FUNCTION__,
> +    __func__,
>      SecCoreData->StackBase,
>      (UINT32)SecCoreData->StackSize
>      ));
> diff --git
> a/UefiCpuPkg/Test/UnitTest/EfiMpServicesPpiProtocol/EfiMpServicesUnitTe
> stCommom.c
> b/UefiCpuPkg/Test/UnitTest/EfiMpServicesPpiProtocol/EfiMpServicesUnitT
> estCommom.c
> index ff79c5e8d43b..7cd3f48d761f 100644
> ---
> a/UefiCpuPkg/Test/UnitTest/EfiMpServicesPpiProtocol/EfiMpServicesUnitTe
> stCommom.c
> +++
> b/UefiCpuPkg/Test/UnitTest/EfiMpServicesPpiProtocol/EfiMpServicesUnitT
> estCommom.c
> @@ -45,7 +45,7 @@ InitUTContext (
> 
>    Status = MpServicesUnitTestWhoAmI (LocalContext->MpServices,
> &BspNumber);
>    UT_ASSERT_NOT_EFI_ERROR (Status);
> -  DEBUG ((DEBUG_INFO, "%a: BspNumber = 0x%x\n", __FUNCTION__,
> BspNumber));
> +  DEBUG ((DEBUG_INFO, "%a: BspNumber = 0x%x\n", __func__,
> BspNumber));
> 
>    Status = MpServicesUnitTestGetNumberOfProcessors (
>               LocalContext->MpServices,
> @@ -56,7 +56,7 @@ InitUTContext (
>    DEBUG ((
>      DEBUG_INFO,
>      "%a: NumberOfProcessors = 0x%x, NumberOfEnabledProcessors =
> 0x%x\n",
> -    __FUNCTION__,
> +    __func__,
>      NumberOfProcessors,
>      NumberOfEnabledProcessors
>      ));
> @@ -89,7 +89,7 @@ InitUTContext (
>          LocalContext->DisabledApNumber[IndexOfDisabledAPs] =
> ProcessorNumber;
>          IndexOfDisabledAPs++;
> 
> -        DEBUG ((DEBUG_INFO, "%a: AP(0x%x) is disabled and temporarily
> enable it.\n", __FUNCTION__, ProcessorNumber));
> +        DEBUG ((DEBUG_INFO, "%a: AP(0x%x) is disabled and temporarily
> enable it.\n", __func__, ProcessorNumber));
>          Status = MpServicesUnitTestEnableDisableAP (
>                     LocalContext->MpServices,
>                     ProcessorNumber,
> @@ -134,7 +134,7 @@ CheckUTContext (
> 
>    if (BspNumber != LocalContext->BspNumber) {
>      LocalContext->BspNumber = BspNumber;
> -    DEBUG ((DEBUG_INFO, "%a: New BspNumber = 0x%x\n",
> __FUNCTION__, BspNumber));
> +    DEBUG ((DEBUG_INFO, "%a: New BspNumber = 0x%x\n", __func__,
> BspNumber));
>    }
> 
>    ASSERT (BspNumber == LocalContext->BspNumber);
> @@ -148,11 +148,11 @@ CheckUTContext (
> 
>    if (NumberOfProcessors != LocalContext->NumberOfProcessors) {
>      LocalContext->NumberOfProcessors = NumberOfProcessors;
> -    DEBUG ((DEBUG_INFO, "%a: New NumberOfProcessors = 0x%x\n",
> __FUNCTION__, NumberOfProcessors));
> +    DEBUG ((DEBUG_INFO, "%a: New NumberOfProcessors = 0x%x\n",
> __func__, NumberOfProcessors));
>    }
> 
>    if (NumberOfEnabledProcessors != LocalContext->NumberOfProcessors) {
> -    DEBUG ((DEBUG_INFO, "%a: New NumberOfEnabledProcessors =
> 0x%x\n", __FUNCTION__, NumberOfEnabledProcessors));
> +    DEBUG ((DEBUG_INFO, "%a: New NumberOfEnabledProcessors =
> 0x%x\n", __func__, NumberOfEnabledProcessors));
> 
>      for (ProcessorNumber = 0; ProcessorNumber < LocalContext-
> >NumberOfProcessors; ProcessorNumber++) {
>        Status = MpServicesUnitTestGetProcessorInfo (
> @@ -163,7 +163,7 @@ CheckUTContext (
>        ASSERT_EFI_ERROR (Status);
> 
>        if (!(ProcessorInfoBuffer.StatusFlag & PROCESSOR_ENABLED_BIT)) {
> -        DEBUG ((DEBUG_INFO, "%a: AP(0x%x) is disabled unexpectedly and
> reenable it.\n", __FUNCTION__, ProcessorNumber));
> +        DEBUG ((DEBUG_INFO, "%a: AP(0x%x) is disabled unexpectedly and
> reenable it.\n", __func__, ProcessorNumber));
>          Status = MpServicesUnitTestEnableDisableAP (
>                     LocalContext->MpServices,
>                     ProcessorNumber,
> @@ -204,7 +204,7 @@ FreeUTContext (
>        DEBUG ((
>          DEBUG_INFO,
>          "%a: Disable AP(0x%x) to restore its state.\n",
> -        __FUNCTION__,
> +        __func__,
>          LocalContext->DisabledApNumber[IndexOfDisabledAPs]
>          ));
> 
> diff --git a/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c
> b/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c
> index e82f179569e9..9ea5f6f4e5e5 100644
> --- a/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c
> +++ b/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c
> @@ -509,7 +509,7 @@ S3ResumeBootOs (
>      DEBUG ((
>        DEBUG_INFO,
>        "%a() Stack Base: 0x%x, Stack Size: 0x%x\n",
> -      __FUNCTION__,
> +      __func__,
>        TempStackTop,
>        sizeof (TempStack)
>        ));
> --
> 2.34.1


^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 08/18] RedfishPkg: Update code to be more C11 compliant by using __func__
  2023-04-06 22:23 ` [PATCH 08/18] RedfishPkg: " Rebecca Cran
@ 2023-04-07  5:39   ` Nickle Wang
  0 siblings, 0 replies; 34+ messages in thread
From: Nickle Wang @ 2023-04-07  5:39 UTC (permalink / raw)
  To: Rebecca Cran, devel@edk2.groups.io, Liming Gao, Michael D Kinney,
	Guomin Jiang, Wei6 Xu, Guo Dong, Ray Ni, Sean Rhodes, James Lu,
	Gua Guo, Andrew Fish, Hao A Wu, Maciej Rabeda, Siyuan Fu,
	Jiewen Yao, Jian J Wang, Xiaoyu Lu, Ard Biesheuvel, Sami Mujawar,
	Supreeth Venkatesh, Michael Kubacki, Nate DeSimone, Sean Brogan
  Cc: Leif Lindholm, Abner Chang, Igor Kulchytskyy, Daniel Schaefer,
	Min Xu, Jordan Justen, Gerd Hoffmann, Peter Grehan, Erdem Aktas,
	James Bottomley, Tom Lendacky, Michael Roth, Sunil V L,
	Andrei Warkentin

Reviewed-by: Nickle Wang <nicklew@nvidia.com>

Regards,
Nickle

> -----Original Message-----
> From: Rebecca Cran <rebecca@bsdio.com>
> Sent: Friday, April 7, 2023 6:23 AM
> To: devel@edk2.groups.io; Liming Gao <gaoliming@byosoft.com.cn>; Michael
> D Kinney <michael.d.kinney@intel.com>; Guomin Jiang
> <guomin.jiang@intel.com>; Wei6 Xu <wei6.xu@intel.com>; Guo Dong
> <guo.dong@intel.com>; Ray Ni <ray.ni@intel.com>; Sean Rhodes
> <sean@starlabs.systems>; James Lu <james.lu@intel.com>; Gua Guo
> <gua.guo@intel.com>; Andrew Fish <afish@apple.com>; Hao A Wu
> <hao.a.wu@intel.com>; Maciej Rabeda <maciej.rabeda@linux.intel.com>;
> Siyuan Fu <siyuan.fu@intel.com>; Jiewen Yao <jiewen.yao@intel.com>; Jian J
> Wang <jian.j.wang@intel.com>; Xiaoyu Lu <xiaoyu1.lu@intel.com>; Ard
> Biesheuvel <ardb+tianocore@kernel.org>; Sami Mujawar
> <sami.mujawar@arm.com>; Supreeth Venkatesh
> <supreeth.venkatesh@arm.com>; Michael Kubacki
> <mikuback@linux.microsoft.com>; Nate DeSimone
> <nathaniel.l.desimone@intel.com>; Sean Brogan
> <sean.brogan@microsoft.com>
> Cc: Rebecca Cran <rebecca@bsdio.com>; Leif Lindholm
> <quic_llindhol@quicinc.com>; Abner Chang <abner.chang@amd.com>; Nickle
> Wang <nicklew@nvidia.com>; Igor Kulchytskyy <igork@ami.com>; Daniel
> Schaefer <git@danielschaefer.me>; Min Xu <min.m.xu@intel.com>; Jordan
> Justen <jordan.l.justen@intel.com>; Gerd Hoffmann <kraxel@redhat.com>;
> Peter Grehan <grehan@freebsd.org>; Erdem Aktas <erdemaktas@google.com>;
> James Bottomley <jejb@linux.ibm.com>; Tom Lendacky
> <thomas.lendacky@amd.com>; Michael Roth <michael.roth@amd.com>; Sunil
> V L <sunilvl@ventanamicro.com>; Andrei Warkentin
> <andrei.warkentin@intel.com>
> Subject: [PATCH 08/18] RedfishPkg: Update code to be more C11 compliant by
> using __func__
> 
> External email: Use caution opening links or attachments
> 
> 
> __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
> RedfishPkg.
> 
> Visual Studio versions before VS 2015 don't support __func__ and so
> will fail to compile. A workaround is to define __func__ as
> __FUNCTION__ :
> 
>   #define __func__ __FUNCTION__
> 
> Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
> ---
> 
> RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterface
> BmcUsbNicLib.c | 36 ++++++------
> 
> RedfishPkg/Library/RedfishPlatformCredentialIpmiLib/RedfishPlatformCredentia
> lIpmiLib.c   | 28 ++++-----
>  RedfishPkg/PrivateLibrary/RedfishLib/RedfishLib.c                                        |  2 +-
>  RedfishPkg/PrivateLibrary/RedfishLib/edk2libredfish/src/service.c                        |
> 4 +-
>  RedfishPkg/RedfishConfigHandler/RedfishConfigHandlerCommon.c
> |  6 +-
>  RedfishPkg/RedfishConfigHandler/RedfishConfigHandlerDriver.c
> | 20 +++----
>  RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c                                       | 62
> ++++++++++----------
>  RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.c
> | 14 ++---
>  RedfishPkg/RedfishRestExDxe/RedfishRestExImpl.c                                          | 14
> ++---
>  9 files changed, 93 insertions(+), 93 deletions(-)
> 
> diff --git
> a/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfa
> ceBmcUsbNicLib.c
> b/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfa
> ceBmcUsbNicLib.c
> index 122473dbe446..4bd01850af93 100644
> ---
> a/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfa
> ceBmcUsbNicLib.c
> +++
> b/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfa
> ceBmcUsbNicLib.c
> @@ -37,7 +37,7 @@ ProbeRedfishCredentialBootstrap (
>    UINT32                                      ResponseSize;
>    BOOLEAN                                     ReturnBool;
> 
> -  DEBUG ((DEBUG_INFO, "%a: Entry\n", __FUNCTION__));
> +  DEBUG ((DEBUG_INFO, "%a: Entry\n", __func__));
> 
>    //
>    // IPMI callout to NetFn 2C, command 02
> @@ -65,10 +65,10 @@ ProbeRedfishCredentialBootstrap (
>         (ResponseData.CompletionCode ==
> REDFISH_IPMI_COMP_CODE_BOOTSTRAP_CREDENTIAL_DISABLED)
>        ))
>    {
> -    DEBUG ((DEBUG_REDFISH_HOST_INTERFACE, "    Redfish Credentail
> Bootstrapping is supported\n", __FUNCTION__));
> +    DEBUG ((DEBUG_REDFISH_HOST_INTERFACE, "    Redfish Credentail
> Bootstrapping is supported\n", __func__));
>      ReturnBool = TRUE;
>    } else {
> -    DEBUG ((DEBUG_REDFISH_HOST_INTERFACE, "    Redfish Credentail
> Bootstrapping is not supported\n", __FUNCTION__));
> +    DEBUG ((DEBUG_REDFISH_HOST_INTERFACE, "    Redfish Credentail
> Bootstrapping is not supported\n", __func__));
>      ReturnBool = FALSE;
>    }
> 
> @@ -94,7 +94,7 @@ RedfishPlatformHostInterfaceDeviceDescriptor (
>    HOST_INTERFACE_BMC_USB_NIC_INFO  *ThisInstance;
>    REDFISH_INTERFACE_DATA           *InterfaceData;
> 
> -  DEBUG ((DEBUG_INFO, "%a: Entry\n", __FUNCTION__));
> +  DEBUG ((DEBUG_INFO, "%a: Entry\n", __func__));
> 
>    if (IsListEmpty (&mBmcUsbNic)) {
>      return EFI_NOT_FOUND;
> @@ -166,7 +166,7 @@ RedfishPlatformHostInterfaceProtocolData (
>    UINT8                              HostNameLength;
>    CHAR8                              *HostNameString;
> 
> -  DEBUG ((DEBUG_INFO, "%a: Entry\n", __FUNCTION__));
> +  DEBUG ((DEBUG_INFO, "%a: Entry\n", __func__));
> 
>    if (IsListEmpty (&mBmcUsbNic) || (IndexOfProtocolData > 0)) {
>      return EFI_NOT_FOUND;
> @@ -300,7 +300,7 @@ RetrievedBmcUsbNicInfo (
>    IPMI_LAN_VLAN_ID                                *LanVlanId;
>    EFI_USB_DEVICE_DESCRIPTOR                       UsbDeviceDescriptor;
> 
> -  DEBUG ((DEBUG_INFO, "%a: Entry\n", __FUNCTION__));
> +  DEBUG ((DEBUG_INFO, "%a: Entry\n", __func__));
> 
>    if (IsListEmpty (&mBmcUsbNic)) {
>      return EFI_NOT_FOUND;
> @@ -605,7 +605,7 @@ HostInterfaceIpmiCheckMacAddress (
>    EFI_MAC_ADDRESS                                 IpmiLanChannelMacAddress;
>    BOOLEAN                                         AlreadyCached;
> 
> -  DEBUG ((DEBUG_INFO, "%a: Entry.\n", __FUNCTION__));
> +  DEBUG ((DEBUG_INFO, "%a: Entry.\n", __func__));
> 
>    GetLanConfigReps = NULL;
>    AlreadyCached    = FALSE;
> @@ -823,7 +823,7 @@ UsbNicSearchUsbIo (
>    EFI_DEVICE_PATH_PROTOCOL  *ThisUsbDevicePath;
>    EFI_DEVICE_PATH_PROTOCOL  *ThisUsbDevicePathEnd;
> 
> -  DEBUG ((DEBUG_INFO, "%a: Entry.\n", __FUNCTION__));
> +  DEBUG ((DEBUG_INFO, "%a: Entry.\n", __func__));
>    DEBUG ((DEBUG_REDFISH_HOST_INTERFACE, "Device path on the EFI handle
> which has UsbIo and SNP instaleld on it.\n"));
>    DevicePathStr = ConvertDevicePathToText (UsbDevicePath, FALSE, FALSE);
>    if (DevicePathStr != NULL) {
> @@ -987,7 +987,7 @@ IdentifyUsbNicBmcChannel (
>    EFI_USB_IO_PROTOCOL              *UsbIo;
>    HOST_INTERFACE_BMC_USB_NIC_INFO  *BmcUsbNic;
> 
> -  DEBUG ((DEBUG_INFO, "%a: Entry.\n", __FUNCTION__));
> +  DEBUG ((DEBUG_INFO, "%a: Entry.\n", __func__));
>    Status = gBS->HandleProtocol (
>                    Handle,
>                    &gEfiSimpleNetworkProtocolGuid,
> @@ -1074,7 +1074,7 @@ CheckBmcUsbNicOnHandles (
>      return EFI_INVALID_PARAMETER;
>    }
> 
> -  DEBUG ((DEBUG_INFO, "%a: Entry, #%d SNP handle\n", __FUNCTION__,
> HandleNumer));
> +  DEBUG ((DEBUG_INFO, "%a: Entry, #%d SNP handle\n", __func__,
> HandleNumer));
> 
>    GotOneUsbNIc = FALSE;
>    for (Index = 0; Index < HandleNumer; Index++) {
> @@ -1084,7 +1084,7 @@ CheckBmcUsbNicOnHandles (
>                      (VOID **)&DevicePath
>                      );
>      if (EFI_ERROR (Status)) {
> -      DEBUG ((DEBUG_ERROR, "    Failed to locate SNP on %d handle.\n",
> __FUNCTION__, Index));
> +      DEBUG ((DEBUG_ERROR, "    Failed to locate SNP on %d handle.\n",
> __func__, Index));
>        continue;
>      }
> 
> @@ -1137,7 +1137,7 @@ CheckBmcUsbNic (
>    UINTN       BufferSize;
>    EFI_HANDLE  *HandleBuffer;
> 
> -  DEBUG ((DEBUG_INFO, "%a: Entry, the registration key - 0x%08x.\n",
> __FUNCTION__, Registration));
> +  DEBUG ((DEBUG_INFO, "%a: Entry, the registration key - 0x%08x.\n",
> __func__, Registration));
> 
>    Handle     = NULL;
>    Status     = EFI_SUCCESS;
> @@ -1213,7 +1213,7 @@ PlatformHostInterfaceSnpCallback (
>    IN  VOID       *Context
>    )
>  {
> -  DEBUG ((DEBUG_INFO, "%a: Entry.\n", __FUNCTION__));
> +  DEBUG ((DEBUG_INFO, "%a: Entry.\n", __func__));
> 
>    CheckBmcUsbNic (mPlatformHostInterfaceSnpRegistration);
>    return;
> @@ -1241,7 +1241,7 @@ RedfishPlatformHostInterfaceNotification (
>  {
>    EFI_STATUS  Status;
> 
> -  DEBUG ((DEBUG_INFO, "%a: Entry\n", __FUNCTION__));
> +  DEBUG ((DEBUG_INFO, "%a: Entry\n", __func__));
> 
>    *InformationReadinessGuid = NULL;
>    InitializeListHead (&mBmcUsbNic);
> @@ -1257,7 +1257,7 @@ RedfishPlatformHostInterfaceNotification (
>    }
> 
>    if (Status == EFI_NOT_FOUND) {
> -    DEBUG ((DEBUG_REDFISH_HOST_INTERFACE, "%a: BMC USB NIC is not
> found. Register the notification.\n", __FUNCTION__));
> +    DEBUG ((DEBUG_REDFISH_HOST_INTERFACE, "%a: BMC USB NIC is not
> found. Register the notification.\n", __func__));
> 
>      // Register the notification of SNP installation.
>      Status = gBS->CreateEvent (
> @@ -1268,7 +1268,7 @@ RedfishPlatformHostInterfaceNotification (
>                      &mPlatformHostInterfaceSnpEvent
>                      );
>      if (EFI_ERROR (Status)) {
> -      DEBUG ((DEBUG_ERROR, "%a: Fail to create event for the installation of
> SNP protocol.", __FUNCTION__));
> +      DEBUG ((DEBUG_ERROR, "%a: Fail to create event for the installation of
> SNP protocol.", __func__));
>        return Status;
>      }
> 
> @@ -1278,7 +1278,7 @@ RedfishPlatformHostInterfaceNotification (
>                      &mPlatformHostInterfaceSnpRegistration
>                      );
>      if (EFI_ERROR (Status)) {
> -      DEBUG ((DEBUG_ERROR, "%a: Fail to register event for the installation of
> SNP protocol.", __FUNCTION__));
> +      DEBUG ((DEBUG_ERROR, "%a: Fail to register event for the installation of
> SNP protocol.", __func__));
>        return Status;
>      }
> 
> @@ -1286,6 +1286,6 @@ RedfishPlatformHostInterfaceNotification (
>      return EFI_SUCCESS;
>    }
> 
> -  DEBUG ((DEBUG_ERROR, "%a: Something wrong when look for BMC USB
> NIC.\n", __FUNCTION__));
> +  DEBUG ((DEBUG_ERROR, "%a: Something wrong when look for BMC USB
> NIC.\n", __func__));
>    return Status;
>  }
> diff --git
> a/RedfishPkg/Library/RedfishPlatformCredentialIpmiLib/RedfishPlatformCreden
> tialIpmiLib.c
> b/RedfishPkg/Library/RedfishPlatformCredentialIpmiLib/RedfishPlatformCreden
> tialIpmiLib.c
> index dacb09bb2399..3b34dafbaf60 100644
> ---
> a/RedfishPkg/Library/RedfishPlatformCredentialIpmiLib/RedfishPlatformCreden
> tialIpmiLib.c
> +++
> b/RedfishPkg/Library/RedfishPlatformCredentialIpmiLib/RedfishPlatformCreden
> tialIpmiLib.c
> @@ -63,10 +63,10 @@ LibStopRedfishService (
>    //
>    Status = SetBootstrapAccountCredentialsToVariable (NULL, NULL, TRUE);
>    if (EFI_ERROR (Status)) {
> -    DEBUG ((DEBUG_ERROR, "%a: fail to remove bootstrap credential: %r\n",
> __FUNCTION__, Status));
> +    DEBUG ((DEBUG_ERROR, "%a: fail to remove bootstrap credential: %r\n",
> __func__, Status));
>    }
> 
> -  DEBUG ((DEBUG_INFO, "%a: bootstrap credential service stopped\n",
> __FUNCTION__));
> +  DEBUG ((DEBUG_INFO, "%a: bootstrap credential service stopped\n",
> __func__));
> 
>    return EFI_SUCCESS;
>  }
> @@ -153,7 +153,7 @@ GetBootstrapAccountCredentials (
>      return EFI_INVALID_PARAMETER;
>    }
> 
> -  DEBUG ((DEBUG_VERBOSE, "%a: Disable bootstrap control: 0x%x\n",
> __FUNCTION__, DisableBootstrapControl));
> +  DEBUG ((DEBUG_VERBOSE, "%a: Disable bootstrap control: 0x%x\n",
> __func__, DisableBootstrapControl));
> 
>    //
>    // IPMI callout to NetFn 2C, command 02
> @@ -183,19 +183,19 @@ GetBootstrapAccountCredentials (
>               );
> 
>    if (EFI_ERROR (Status)) {
> -    DEBUG ((DEBUG_ERROR, "%a: IPMI transaction failure. Returning\n",
> __FUNCTION__));
> +    DEBUG ((DEBUG_ERROR, "%a: IPMI transaction failure. Returning\n",
> __func__));
>      return Status;
>    } else {
>      if (ResponseData.CompletionCode != IPMI_COMP_CODE_NORMAL) {
>        if (ResponseData.CompletionCode ==
> REDFISH_IPMI_COMP_CODE_BOOTSTRAP_CREDENTIAL_DISABLED) {
> -        DEBUG ((DEBUG_ERROR, "%a: bootstrap credential support was
> disabled\n", __FUNCTION__));
> +        DEBUG ((DEBUG_ERROR, "%a: bootstrap credential support was
> disabled\n", __func__));
>          return EFI_ACCESS_DENIED;
>        }
> 
> -      DEBUG ((DEBUG_ERROR, "%a: Completion code = 0x%x. Returning\n",
> __FUNCTION__, ResponseData.CompletionCode));
> +      DEBUG ((DEBUG_ERROR, "%a: Completion code = 0x%x. Returning\n",
> __func__, ResponseData.CompletionCode));
>        return EFI_PROTOCOL_ERROR;
>      } else if (ResponseData.GroupExtensionId !=
> REDFISH_IPMI_GROUP_EXTENSION) {
> -      DEBUG ((DEBUG_ERROR, "%a: Group Extension Response = 0x%x.
> Returning\n", __FUNCTION__, ResponseData.GroupExtensionId));
> +      DEBUG ((DEBUG_ERROR, "%a: Group Extension Response = 0x%x.
> Returning\n", __func__, ResponseData.GroupExtensionId));
>        return EFI_DEVICE_ERROR;
>      } else {
>        if (BootstrapUsername != NULL) {
> @@ -216,7 +216,7 @@ GetBootstrapAccountCredentials (
>      }
>    }
> 
> -  DEBUG ((DEBUG_INFO, "%a: get bootstrap credential via IPMI: %r\n",
> __FUNCTION__, Status));
> +  DEBUG ((DEBUG_INFO, "%a: get bootstrap credential via IPMI: %r\n",
> __func__, Status));
> 
>    return Status;
>  }
> @@ -269,7 +269,7 @@ GetBootstrapAccountCredentialsFromVariable (
>    }
> 
>    if (DataSize != sizeof (BOOTSTRAP_CREDENTIALS_VARIABLE)) {
> -    DEBUG ((DEBUG_ERROR, "%a: data corruption. returned size: %d != structure
> size: %d\n", __FUNCTION__, DataSize, sizeof
> (BOOTSTRAP_CREDENTIALS_VARIABLE)));
> +    DEBUG ((DEBUG_ERROR, "%a: data corruption. returned size: %d !=
> structure size: %d\n", __func__, DataSize, sizeof
> (BOOTSTRAP_CREDENTIALS_VARIABLE)));
>      FreePool (Data);
>      return EFI_NOT_FOUND;
>    }
> @@ -284,7 +284,7 @@ GetBootstrapAccountCredentialsFromVariable (
> 
>    FreePool (Data);
> 
> -  DEBUG ((DEBUG_INFO, "%a: get bootstrap credential from variable\n",
> __FUNCTION__));
> +  DEBUG ((DEBUG_INFO, "%a: get bootstrap credential from variable\n",
> __func__));
> 
>    return EFI_SUCCESS;
>  }
> @@ -412,7 +412,7 @@ LibCredentialGetAuthInfo (
>    DisableCredentialService = PcdGetBool
> (PcdRedfishDisableBootstrapCredentialService);
> 
>    if (mRedfishServiceStopped) {
> -    DEBUG ((DEBUG_ERROR, "%a: credential service is stopped due to security
> reason\n", __FUNCTION__));
> +    DEBUG ((DEBUG_ERROR, "%a: credential service is stopped due to security
> reason\n", __func__));
>      return EFI_ACCESS_DENIED;
>    }
> 
> @@ -441,17 +441,17 @@ LibCredentialGetAuthInfo (
>    //
>    Status = GetBootstrapAccountCredentials (DisableCredentialService, *UserId,
> USERNAME_MAX_SIZE, *Password, PASSWORD_MAX_SIZE);
>    if (EFI_ERROR (Status)) {
> -    DEBUG ((DEBUG_ERROR, "%a: fail to get bootstrap credential: %r\n",
> __FUNCTION__, Status));
> +    DEBUG ((DEBUG_ERROR, "%a: fail to get bootstrap credential: %r\n",
> __func__, Status));
>      return Status;
>    }
> 
>    if (DisableCredentialService) {
> -    DEBUG ((DEBUG_INFO, "%a: credential bootstrapping control disabled\n",
> __FUNCTION__));
> +    DEBUG ((DEBUG_INFO, "%a: credential bootstrapping control disabled\n",
> __func__));
>    }
> 
>    Status = SetBootstrapAccountCredentialsToVariable (*UserId, *Password,
> FALSE);
>    if (EFI_ERROR (Status)) {
> -    DEBUG ((DEBUG_ERROR, "%a: fail to cache bootstrap credential: %r\n",
> __FUNCTION__, Status));
> +    DEBUG ((DEBUG_ERROR, "%a: fail to cache bootstrap credential: %r\n",
> __func__, Status));
>    }
> 
>    return EFI_SUCCESS;
> diff --git a/RedfishPkg/PrivateLibrary/RedfishLib/RedfishLib.c
> b/RedfishPkg/PrivateLibrary/RedfishLib/RedfishLib.c
> index 51a85a73360d..0a0a4e645872 100644
> --- a/RedfishPkg/PrivateLibrary/RedfishLib/RedfishLib.c
> +++ b/RedfishPkg/PrivateLibrary/RedfishLib/RedfishLib.c
> @@ -1101,7 +1101,7 @@ RedfishIsValidOdataType (
>      }
>    }
> 
> -  DEBUG ((DEBUG_INFO, "%a: This Odata type is not in the list.\n",
> __FUNCTION__));
> +  DEBUG ((DEBUG_INFO, "%a: This Odata type is not in the list.\n", __func__));
>    return FALSE;
>  }
> 
> diff --git a/RedfishPkg/PrivateLibrary/RedfishLib/edk2libredfish/src/service.c
> b/RedfishPkg/PrivateLibrary/RedfishLib/edk2libredfish/src/service.c
> index cbd4330a0ed0..206094d87d0f 100644
> --- a/RedfishPkg/PrivateLibrary/RedfishLib/edk2libredfish/src/service.c
> +++ b/RedfishPkg/PrivateLibrary/RedfishLib/edk2libredfish/src/service.c
> @@ -521,7 +521,7 @@ getUriFromService (
>        //
>        Status = DecodeResponseContent (ContentEncodedHeader->FieldValue,
> &ResponseMsg.Body, &ResponseMsg.BodyLength);
>        if (EFI_ERROR (Status)) {
> -        DEBUG ((DEBUG_ERROR, "%a: Failed to decompress the response content
> %r\n.", __FUNCTION__, Status));
> +        DEBUG ((DEBUG_ERROR, "%a: Failed to decompress the response content
> %r\n.", __func__, Status));
>          ret = NULL;
>          goto ON_EXIT;
>        }
> @@ -656,7 +656,7 @@ patchUriFromService (
>    //
>    Status = EncodeRequestContent ((CHAR8 *)HTTP_CONTENT_ENCODING_GZIP,
> (CHAR8 *)content, (VOID **)&EncodedContent, &EncodedContentLen);
>    if (Status == EFI_INVALID_PARAMETER) {
> -    DEBUG ((DEBUG_ERROR, "%a: Error to encode content.\n", __FUNCTION__));
> +    DEBUG ((DEBUG_ERROR, "%a: Error to encode content.\n", __func__));
>      ret = NULL;
>      goto ON_EXIT;
>    } else if (Status == EFI_UNSUPPORTED) {
> diff --git a/RedfishPkg/RedfishConfigHandler/RedfishConfigHandlerCommon.c
> b/RedfishPkg/RedfishConfigHandler/RedfishConfigHandlerCommon.c
> index 96aac125ee22..b51b558a487d 100644
> --- a/RedfishPkg/RedfishConfigHandler/RedfishConfigHandlerCommon.c
> +++ b/RedfishPkg/RedfishConfigHandler/RedfishConfigHandlerCommon.c
> @@ -122,7 +122,7 @@ RedfishConfigCommonInit (
>    //
>    Status = gBS->LocateProtocol (&gEdkIIRedfishCredentialProtocolGuid, NULL,
> (VOID **)&gCredential);
>    if (EFI_ERROR (Status)) {
> -    DEBUG ((DEBUG_INFO, "%a: No Redfish Credential Protocol is installed on
> system.", __FUNCTION__));
> +    DEBUG ((DEBUG_INFO, "%a: No Redfish Credential Protocol is installed on
> system.", __func__));
>      return Status;
>    }
> 
> @@ -138,7 +138,7 @@ RedfishConfigCommonInit (
>                    &gEndOfDxeEvent
>                    );
>    if (EFI_ERROR (Status)) {
> -    DEBUG ((DEBUG_ERROR, "%a: Fail to register End Of DXE event.",
> __FUNCTION__));
> +    DEBUG ((DEBUG_ERROR, "%a: Fail to register End Of DXE event.", __func__));
>      return Status;
>    }
> 
> @@ -156,7 +156,7 @@ RedfishConfigCommonInit (
>    if (EFI_ERROR (Status)) {
>      gBS->CloseEvent (gEndOfDxeEvent);
>      gEndOfDxeEvent = NULL;
> -    DEBUG ((DEBUG_ERROR, "%a: Fail to register Exit Boot Service event.",
> __FUNCTION__));
> +    DEBUG ((DEBUG_ERROR, "%a: Fail to register Exit Boot Service event.",
> __func__));
>      return Status;
>    }
> 
> diff --git a/RedfishPkg/RedfishConfigHandler/RedfishConfigHandlerDriver.c
> b/RedfishPkg/RedfishConfigHandler/RedfishConfigHandlerDriver.c
> index 96ac70f418c8..993ad338b6eb 100644
> --- a/RedfishPkg/RedfishConfigHandler/RedfishConfigHandlerDriver.c
> +++ b/RedfishPkg/RedfishConfigHandler/RedfishConfigHandlerDriver.c
> @@ -372,7 +372,7 @@ RedfishDiscoverProtocolInstalled (
>    EFI_REDFISH_DISCOVER_NETWORK_INTERFACE  *ThisNetworkInterface;
>    EFI_REDFISH_DISCOVERED_TOKEN            *ThisRedfishDiscoveredToken;
> 
> -  DEBUG ((DEBUG_INFO, "%a: New network interface is installed on system by
> EFI Redfish discover driver.\n", __FUNCTION__));
> +  DEBUG ((DEBUG_INFO, "%a: New network interface is installed on system by
> EFI Redfish discover driver.\n", __func__));
> 
>    BufferSize = sizeof (EFI_HANDLE);
>    Status     = gBS->LocateHandle (
> @@ -383,7 +383,7 @@ RedfishDiscoverProtocolInstalled (
>                        &HandleBuffer
>                        );
>    if (EFI_ERROR (Status)) {
> -    DEBUG ((DEBUG_ERROR, "%a: Can't locate handle with
> EFI_REDFISH_DISCOVER_PROTOCOL installed.\n", __FUNCTION__));
> +    DEBUG ((DEBUG_ERROR, "%a: Can't locate handle with
> EFI_REDFISH_DISCOVER_PROTOCOL installed.\n", __func__));
>    }
> 
>    gRedfishDiscoverActivated = TRUE;
> @@ -403,7 +403,7 @@ RedfishDiscoverProtocolInstalled (
>      if (EFI_ERROR (Status)) {
>        gEfiRedfishDiscoverProtocol = NULL;
>        gRedfishDiscoverActivated   = FALSE;
> -      DEBUG ((DEBUG_ERROR, "%a: Can't locate
> EFI_REDFISH_DISCOVER_PROTOCOL.\n", __FUNCTION__));
> +      DEBUG ((DEBUG_ERROR, "%a: Can't locate
> EFI_REDFISH_DISCOVER_PROTOCOL.\n", __func__));
>        return;
>      }
>    }
> @@ -422,13 +422,13 @@ RedfishDiscoverProtocolInstalled (
>                                            &gNetworkInterfaceInstances
>                                            );
>    if (EFI_ERROR (Status) || (gNumberOfNetworkInterfaces == 0)) {
> -    DEBUG ((DEBUG_ERROR, "%a: No network interfaces found on the
> handle.\n", __FUNCTION__));
> +    DEBUG ((DEBUG_ERROR, "%a: No network interfaces found on the
> handle.\n", __func__));
>      return;
>    }
> 
>    gRedfishDiscoveredToken = AllocateZeroPool (gNumberOfNetworkInterfaces
> * sizeof (EFI_REDFISH_DISCOVERED_TOKEN));
>    if (gRedfishDiscoveredToken == NULL) {
> -    DEBUG ((DEBUG_ERROR, "%a: Not enough memory for
> EFI_REDFISH_DISCOVERED_TOKEN.\n", __FUNCTION__));
> +    DEBUG ((DEBUG_ERROR, "%a: Not enough memory for
> EFI_REDFISH_DISCOVERED_TOKEN.\n", __func__));
>      return;
>    }
> 
> @@ -449,7 +449,7 @@ RedfishDiscoverProtocolInstalled (
>                      &ThisRedfishDiscoveredToken->Event
>                      );
>      if (EFI_ERROR (Status)) {
> -      DEBUG ((DEBUG_ERROR, "%a: Failed to create event for Redfish discovered
> token.\n", __FUNCTION__));
> +      DEBUG ((DEBUG_ERROR, "%a: Failed to create event for Redfish discovered
> token.\n", __func__));
>        goto ErrorReturn;
>      }
> 
> @@ -472,7 +472,7 @@ RedfishDiscoverProtocolInstalled (
>    }
> 
>    if (EFI_ERROR (Status)) {
> -    DEBUG ((DEBUG_ERROR, "%a: Acquire Redfish service fail.\n",
> __FUNCTION__));
> +    DEBUG ((DEBUG_ERROR, "%a: Acquire Redfish service fail.\n", __func__));
>      goto ErrorReturn;
>    }
> 
> @@ -556,7 +556,7 @@ RedfishConfigHandlerDriverEntryPoint (
>                    &gEfiRedfishDiscoverProtocolEvent
>                    );
>    if (EFI_ERROR (Status)) {
> -    DEBUG ((DEBUG_ERROR, "%a: Fail to create event for the installation of
> EFI_REDFISH_DISCOVER_PROTOCOL.", __FUNCTION__));
> +    DEBUG ((DEBUG_ERROR, "%a: Fail to create event for the installation of
> EFI_REDFISH_DISCOVER_PROTOCOL.", __func__));
>      return Status;
>    }
> 
> @@ -566,7 +566,7 @@ RedfishConfigHandlerDriverEntryPoint (
>                    &gEfiRedfishDiscoverRegistration
>                    );
>    if (EFI_ERROR (Status)) {
> -    DEBUG ((DEBUG_ERROR, "%a: Fail to register event for the installation of
> EFI_REDFISH_DISCOVER_PROTOCOL.", __FUNCTION__));
> +    DEBUG ((DEBUG_ERROR, "%a: Fail to register event for the installation of
> EFI_REDFISH_DISCOVER_PROTOCOL.", __func__));
>      return Status;
>    }
> 
> @@ -593,7 +593,7 @@ RedfishConfigHandlerDriverEntryPoint (
>      gExitBootServiceEvent = NULL;
>      gBS->CloseEvent (gEfiRedfishDiscoverProtocolEvent);
>      gEfiRedfishDiscoverProtocolEvent = NULL;
> -    DEBUG ((DEBUG_ERROR, "%a: Fail to install EFI Binding Protocol of EFI
> Redfish Config driver.", __FUNCTION__));
> +    DEBUG ((DEBUG_ERROR, "%a: Fail to install EFI Binding Protocol of EFI
> Redfish Config driver.", __func__));
>      return Status;
>    }
> 
> diff --git a/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c
> b/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c
> index f64c79088f63..583c6f78e19c 100644
> --- a/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c
> +++ b/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c
> @@ -196,13 +196,13 @@ Tcp4GetSubnetInfo (
>    Tcp4Option.EnableNagle       = TRUE;
>    Status                       = Tcp4->Configure (Tcp4, &Tcp4CfgData);
>    if (EFI_ERROR (Status)) {
> -    DEBUG ((DEBUG_ERROR, "%a: Can't get subnet information\n",
> __FUNCTION__));
> +    DEBUG ((DEBUG_ERROR, "%a: Can't get subnet information\n", __func__));
>      return Status;
>    }
> 
>    Status = Tcp4->GetModeData (Tcp4, NULL, NULL, &IpModedata, NULL, NULL);
>    if (EFI_ERROR (Status)) {
> -    DEBUG ((DEBUG_ERROR, "%a: Can't get IP mode data information\n",
> __FUNCTION__));
> +    DEBUG ((DEBUG_ERROR, "%a: Can't get IP mode data information\n",
> __func__));
>      return Status;
>    }
> 
> @@ -265,12 +265,12 @@ Tcp6GetSubnetInfo (
>    ZeroMem ((VOID *)&IpModedata, sizeof (EFI_IP6_MODE_DATA));
>    Status = Tcp6->GetModeData (Tcp6, NULL, NULL, &IpModedata, NULL, NULL);
>    if (EFI_ERROR (Status)) {
> -    DEBUG ((DEBUG_ERROR, "%a: Can't get IP mode data information\n",
> __FUNCTION__));
> +    DEBUG ((DEBUG_ERROR, "%a: Can't get IP mode data information\n",
> __func__));
>      return Status;
>    }
> 
>    if (IpModedata.AddressCount == 0) {
> -    DEBUG ((DEBUG_INFO, "%a: No IPv6 address configured.\n",
> __FUNCTION__));
> +    DEBUG ((DEBUG_INFO, "%a: No IPv6 address configured.\n", __func__));
>      Instance->SubnetAddrInfoIPv6Number = 0;
>      return EFI_SUCCESS;
>    }
> @@ -282,7 +282,7 @@ Tcp6GetSubnetInfo (
> 
>    Instance->SubnetAddrInfoIPv6 = AllocateZeroPool (IpModedata.AddressCount
> * sizeof (EFI_IP6_ADDRESS_INFO));
>    if (Instance->SubnetAddrInfoIPv6 == NULL) {
> -    DEBUG ((DEBUG_ERROR, "%a: Failed to allocate memory for IPv6 subnet
> address information\n", __FUNCTION__));
> +    DEBUG ((DEBUG_ERROR, "%a: Failed to allocate memory for IPv6 subnet
> address information\n", __func__));
>      return EFI_OUT_OF_RESOURCES;
>    }
> 
> @@ -529,7 +529,7 @@ DiscoverRedfishHostInterface (
>        IP4_COPY_ADDRESS ((VOID *)&Instance->HostSubnetMask.v4, (VOID
> *)Data->HostIpMask);
> 
>        if (EFI_IP4_EQUAL (&Instance->HostIpAddress.v4, &mZeroIp4Addr)) {
> -        DEBUG ((DEBUG_ERROR, "%a: invalid host IP address: zero address\n",
> __FUNCTION__));
> +        DEBUG ((DEBUG_ERROR, "%a: invalid host IP address: zero address\n",
> __func__));
>          //
>          // Invalid IP address detected. Change address format to Unknown and use
> system default address.
>          //
> @@ -537,7 +537,7 @@ DiscoverRedfishHostInterface (
>        }
> 
>        if (!IP4_IS_VALID_NETMASK (EFI_IP4 (Instance->HostSubnetMask.v4))) {
> -        DEBUG ((DEBUG_ERROR, "%a: invalid subnet mask address\n",
> __FUNCTION__));
> +        DEBUG ((DEBUG_ERROR, "%a: invalid subnet mask address\n", __func__));
>          //
>          // Invalid subnet mast address detected. Change address format to
> Unknown and use system default address.
>          //
> @@ -551,14 +551,14 @@ DiscoverRedfishHostInterface (
>        IP4_COPY_ADDRESS ((VOID *)&Instance->TargetIpAddress.v4, (VOID *)Data-
> >RedfishServiceIpAddress);
> 
>        if (EFI_IP4_EQUAL (&Instance->TargetIpAddress.v4, &mZeroIp4Addr)) {
> -        DEBUG ((DEBUG_ERROR, "%a: invalid service IP address: zero address\n",
> __FUNCTION__));
> +        DEBUG ((DEBUG_ERROR, "%a: invalid service IP address: zero address\n",
> __func__));
>        }
>      } else {
>        IP6_COPY_ADDRESS ((VOID *)&Instance->TargetIpAddress.v6, (VOID *)Data-
> >RedfishServiceIpAddress);
>      }
> 
>      if (Instance->HostIntfValidation) {
> -      DEBUG ((DEBUG_ERROR, "%a:Send UPnP unicast SSDP to validate this
> Redfish Host Interface is not supported.\n", __FUNCTION__));
> +      DEBUG ((DEBUG_ERROR, "%a:Send UPnP unicast SSDP to validate this
> Redfish Host Interface is not supported.\n", __func__));
>        Status = EFI_UNSUPPORTED;
>      } else {
>        //
> @@ -682,7 +682,7 @@ AddAndSignalNewRedfishService (
>    RestExOpened = FALSE;
>    DeleteRestEx = FALSE;
> 
> -  DEBUG ((DEBUG_INFO, "%a:Add this instance to Redfish instance list.\n",
> __FUNCTION__));
> +  DEBUG ((DEBUG_INFO, "%a:Add this instance to Redfish instance list.\n",
> __func__));
> 
>    if (Uuid != NULL) {
>      Char16Uuid = (CHAR16 *)AllocateZeroPool (AsciiStrSize ((const CHAR8 *)Uuid)
> * sizeof (CHAR16));
> @@ -846,7 +846,7 @@ AddAndSignalNewRedfishService (
>      if (!InfoRefresh) {
>        Status = CreateRestExInstance (Instance, Instance->DiscoverToken); //
> Create REST EX child.
>        if (EFI_ERROR (Status)) {
> -        DEBUG ((DEBUG_ERROR, "%a:Can't create REST EX child instance.\n",
> __FUNCTION__));
> +        DEBUG ((DEBUG_ERROR, "%a:Can't create REST EX child instance.\n",
> __func__));
>          goto ON_EXIT;
>        }
> 
> @@ -906,7 +906,7 @@ AddAndSignalNewRedfishService (
>                           (EFI_REST_EX_CONFIG_DATA)(UINT8 *)RestExHttpConfigData
>                           );
>        if (EFI_ERROR (Status)) {
> -        DEBUG ((DEBUG_ERROR, "%a:REST EX configured..\n", __FUNCTION__));
> +        DEBUG ((DEBUG_ERROR, "%a:REST EX configured..\n", __func__));
>          DeleteRestEx = TRUE;
>          goto EXIT_FREE_ALL;
>        }
> @@ -927,7 +927,7 @@ AddAndSignalNewRedfishService (
> 
>      Status = gBS->SignalEvent (Instance->DiscoverToken->Event);
>      if (!EFI_ERROR (Status)) {
> -      DEBUG ((DEBUG_ERROR, "%a:No event to signal!\n", __FUNCTION__));
> +      DEBUG ((DEBUG_ERROR, "%a:No event to signal!\n", __func__));
>      }
>    }
> 
> @@ -997,13 +997,13 @@ NetworkInterfaceGetSubnetInfo (
>                                                 Instance
>                                                 );
>      if (EFI_ERROR (Status)) {
> -      DEBUG ((DEBUG_ERROR, "%a:Failed to get Subnet infomation.\n",
> __FUNCTION__));
> +      DEBUG ((DEBUG_ERROR, "%a:Failed to get Subnet infomation.\n",
> __func__));
>        return Status;
>      } else {
> -      DEBUG ((DEBUG_INFO, "%a:MAC address: %s\n", __FUNCTION__, Instance-
> >StrMacAddr));
> +      DEBUG ((DEBUG_INFO, "%a:MAC address: %s\n", __func__, Instance-
> >StrMacAddr));
>        if (CheckIsIpVersion6 (Instance)) {
>          if (Instance->SubnetAddrInfoIPv6Number == 0) {
> -          DEBUG ((DEBUG_ERROR, "%a: There is no Subnet infomation for IPv6
> network interface.\n", __FUNCTION__));
> +          DEBUG ((DEBUG_ERROR, "%a: There is no Subnet infomation for IPv6
> network interface.\n", __func__));
>            return EFI_NOT_FOUND;
>          }
> 
> @@ -1184,13 +1184,13 @@ RedfishServiceAcquireService (
>    UINTN                                            NetworkInterfacesIndex;
>    EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL
> *TargetNetworkInterfaceInternal;
> 
> -  DEBUG ((DEBUG_INFO, "%a:Entry.\n", __FUNCTION__));
> +  DEBUG ((DEBUG_INFO, "%a:Entry.\n", __func__));
> 
>    //
>    // Validate parameters.
>    //
>    if ((ImageHandle == NULL) || (Token == NULL) || ((Flags &
> ~EFI_REDFISH_DISCOVER_VALIDATION) == 0)) {
> -    DEBUG ((DEBUG_ERROR, "%a:Invalid parameters.\n", __FUNCTION__));
> +    DEBUG ((DEBUG_ERROR, "%a:Invalid parameters.\n", __func__));
>      return EFI_INVALID_PARAMETER;
>    }
> 
> @@ -1208,7 +1208,7 @@ RedfishServiceAcquireService (
>      TargetNetworkInterfaceInternal =
> (EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL *)GetFirstNode
> (&mEfiRedfishDiscoverNetworkInterface);
>      NumNetworkInterfaces           = NumberOfNetworkInterface ();
>      if (NumNetworkInterfaces == 0) {
> -      DEBUG ((DEBUG_ERROR, "%a:No network interface on platform.\n",
> __FUNCTION__));
> +      DEBUG ((DEBUG_ERROR, "%a:No network interface on platform.\n",
> __func__));
>        return EFI_UNSUPPORTED;
>      }
>    }
> @@ -1219,10 +1219,10 @@ RedfishServiceAcquireService (
>      NewInstance = FALSE;
>      Instance    = GetInstanceByOwner (ImageHandle,
> TargetNetworkInterfaceInternal, Flags &
> ~EFI_REDFISH_DISCOVER_VALIDATION); // Check if we can re-use previous
> instance.
>      if (Instance == NULL) {
> -      DEBUG ((DEBUG_INFO, "%a:Create new
> EFI_REDFISH_DISCOVERED_INTERNAL_INSTANCE.\n", __FUNCTION__));
> +      DEBUG ((DEBUG_INFO, "%a:Create new
> EFI_REDFISH_DISCOVERED_INTERNAL_INSTANCE.\n", __func__));
>        Instance = (EFI_REDFISH_DISCOVERED_INTERNAL_INSTANCE
> *)AllocateZeroPool (sizeof (EFI_REDFISH_DISCOVERED_INTERNAL_INSTANCE));
>        if (Instance == NULL) {
> -        DEBUG ((DEBUG_ERROR, "%a:Memory allocation fail.\n",
> __FUNCTION__));
> +        DEBUG ((DEBUG_ERROR, "%a:Memory allocation fail.\n", __func__));
>        }
> 
>        InitializeListHead (&Instance->Entry);
> @@ -1238,14 +1238,14 @@ RedfishServiceAcquireService (
>      }
> 
>      if (TargetNetworkInterfaceInternal->StrMacAddr != NULL) {
> -      DEBUG ((DEBUG_INFO, "%a:Acquire Redfish service on network interface
> MAC address:%s.\n", __FUNCTION__, TargetNetworkInterfaceInternal-
> >StrMacAddr));
> +      DEBUG ((DEBUG_INFO, "%a:Acquire Redfish service on network interface
> MAC address:%s.\n", __func__, TargetNetworkInterfaceInternal->StrMacAddr));
>      } else {
> -      DEBUG ((DEBUG_INFO, "%a:WARNING: No MAC address on this network
> interface.\n", __FUNCTION__));
> +      DEBUG ((DEBUG_INFO, "%a:WARNING: No MAC address on this network
> interface.\n", __func__));
>      }
> 
>      Instance->DiscoverToken = Token; // Always use the latest Token passed by
> caller.
>      if ((Flags & EFI_REDFISH_DISCOVER_HOST_INTERFACE) != 0) {
> -      DEBUG ((DEBUG_INFO, "%a:Redfish HOST interface discovery.\n",
> __FUNCTION__));
> +      DEBUG ((DEBUG_INFO, "%a:Redfish HOST interface discovery.\n",
> __func__));
>        Instance->HostIntfValidation = FALSE;
>        if ((Flags & EFI_REDFISH_DISCOVER_VALIDATION) != 0) {
>          Instance->HostIntfValidation = TRUE;
> @@ -1255,12 +1255,12 @@ RedfishServiceAcquireService (
>      }
> 
>      if ((Flags & EFI_REDFISH_DISCOVER_SSDP) != 0) {
> -      DEBUG ((DEBUG_ERROR, "%a:Redfish service discovery through SSDP is not
> supported\n", __FUNCTION__));
> +      DEBUG ((DEBUG_ERROR, "%a:Redfish service discovery through SSDP is not
> supported\n", __func__));
>        return EFI_UNSUPPORTED;
>      } else {
>        if (EFI_ERROR (Status1) && EFI_ERROR (Status2)) {
>          FreePool ((VOID *)Instance);
> -        DEBUG ((DEBUG_ERROR, "%a:Something wrong on Redfish service
> discovery Status1=%x, Status2=%x.\n", __FUNCTION__, Status1, Status2));
> +        DEBUG ((DEBUG_ERROR, "%a:Something wrong on Redfish service
> discovery Status1=%x, Status2=%x.\n", __func__, Status1, Status2));
>        } else {
>          if (NewInstance) {
>            InsertTailList (&mRedfishDiscoverList, &Instance->Entry);
> @@ -1326,7 +1326,7 @@ RedfishServiceReleaseService (
>    EFI_REDFISH_DISCOVERED_INTERNAL_LIST  *DiscoveredRedfishInstance;
> 
>    if (IsListEmpty (&mRedfishInstanceList)) {
> -    DEBUG ((DEBUG_ERROR, "%a:No any discovered Redfish service.\n",
> __FUNCTION__));
> +    DEBUG ((DEBUG_ERROR, "%a:No any discovered Redfish service.\n",
> __func__));
>      return EFI_NOT_FOUND;
>    }
> 
> @@ -1535,7 +1535,7 @@ TestForRequiredProtocols (
>                        );
>        if (EFI_ERROR (Status)) {
>          if (Index == ListCount - 1) {
> -          DEBUG ((DEBUG_ERROR, "%a: all required protocols are found on this
> controller handle: %p.\n", __FUNCTION__, ControllerHandle));
> +          DEBUG ((DEBUG_ERROR, "%a: all required protocols are found on this
> controller handle: %p.\n", __func__, ControllerHandle));
>            return EFI_SUCCESS;
>          }
>        }
> @@ -1706,7 +1706,7 @@ BuildupNetworkInterface (
>            if (!NewNetworkInterfaceInstalled) {
>              NetworkInterface = GetTargetNetworkInterfaceInternalByController
> (ControllerHandle);
>              if (NetworkInterface == NULL) {
> -              DEBUG ((DEBUG_ERROR, "%a: Can't find network interface by
> ControllerHandle\n", __FUNCTION__));
> +              DEBUG ((DEBUG_ERROR, "%a: Can't find network interface by
> ControllerHandle\n", __func__));
>                return Status;
>              }
>            }
> @@ -1720,10 +1720,10 @@ BuildupNetworkInterface (
>                                                                        (VOID *)&mRedfishDiscover
>                                                                        );
>            if (EFI_ERROR (Status)) {
> -            DEBUG ((DEBUG_ERROR, "%a: Fail to install
> EFI_REDFISH_DISCOVER_PROTOCOL\n", __FUNCTION__));
> +            DEBUG ((DEBUG_ERROR, "%a: Fail to install
> EFI_REDFISH_DISCOVER_PROTOCOL\n", __func__));
>            }
>          } else {
> -          DEBUG ((DEBUG_INFO, "%a: Not REST EX, continue with next\n",
> __FUNCTION__));
> +          DEBUG ((DEBUG_INFO, "%a: Not REST EX, continue with next\n",
> __func__));
>            Index++;
>            if (Index == (sizeof (gRequiredProtocol) / sizeof
> (REDFISH_DISCOVER_REQUIRED_PROTOCOL))) {
>              break;
> diff --git a/RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.c
> b/RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.c
> index 872cf3ae0609..45fc6e2182bc 100644
> --- a/RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.c
> +++ b/RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.c
> @@ -59,11 +59,11 @@ RedfishCreateSmbiosTable42 (
>    Status = RedfishPlatformHostInterfaceDeviceDescriptor (&DeviceType,
> &DeviceDescriptor);
>    if (EFI_ERROR (Status)) {
>      if (Status == EFI_NOT_FOUND) {
> -      DEBUG ((DEBUG_ERROR, "%a: No Redfish host interface descriptor is
> provided on this platform.", __FUNCTION__));
> +      DEBUG ((DEBUG_ERROR, "%a: No Redfish host interface descriptor is
> provided on this platform.", __func__));
>        return EFI_NOT_FOUND;
>      }
> 
> -    DEBUG ((DEBUG_ERROR, "%a: Fail to get device descriptor, %r.",
> __FUNCTION__, Status));
> +    DEBUG ((DEBUG_ERROR, "%a: Fail to get device descriptor, %r.", __func__,
> Status));
>      return Status;
>    }
> 
> @@ -71,7 +71,7 @@ RedfishCreateSmbiosTable42 (
>        (DeviceType != REDFISH_HOST_INTERFACE_DEVICE_TYPE_PCI_PCIE_V2)
>        )
>    {
> -    DEBUG ((DEBUG_ERROR, "%a: Only support either protocol type 04h or 05h
> as Redfish host interface.", __FUNCTION__));
> +    DEBUG ((DEBUG_ERROR, "%a: Only support either protocol type 04h or 05h
> as Redfish host interface.", __func__));
>      return EFI_UNSUPPORTED;
>    }
> 
> @@ -98,7 +98,7 @@ RedfishCreateSmbiosTable42 (
>      }
> 
>      if (EFI_ERROR (Status)) {
> -      DEBUG ((DEBUG_ERROR, "%a: Fail to get Redfish host interafce protocol
> type data.", __FUNCTION__));
> +      DEBUG ((DEBUG_ERROR, "%a: Fail to get Redfish host interafce protocol
> type data.", __func__));
>        if (ProtocolRecords != NULL) {
>          FreePool (ProtocolRecords);
>        }
> @@ -124,7 +124,7 @@ RedfishCreateSmbiosTable42 (
>      } else {
>        NewProtocolRecords = ReallocatePool (CurrentProtocolsDataLength,
> NewProtocolsDataLength, (VOID *)ProtocolRecords);
>        if (NewProtocolRecords == NULL) {
> -        DEBUG ((DEBUG_ERROR, "%a: Fail to allocate memory for Redfish host
> interface protocol data.", __FUNCTION__));
> +        DEBUG ((DEBUG_ERROR, "%a: Fail to allocate memory for Redfish host
> interface protocol data.", __func__));
>          FreePool (ProtocolRecords);
>          FreePool (ProtocolRecord);
>          return EFI_OUT_OF_RESOURCES;
> @@ -258,7 +258,7 @@ PlatformHostInterfaceInformationReady (
>    IN  VOID       *Context
>    )
>  {
> -  DEBUG ((DEBUG_INFO, "%a: Platform Redfish Host Interface informtion is
> ready\n", __FUNCTION__));
> +  DEBUG ((DEBUG_INFO, "%a: Platform Redfish Host Interface informtion is
> ready\n", __func__));
> 
>    RedfishCreateSmbiosTable42 ();
> 
> @@ -290,7 +290,7 @@ RedfishHostInterfaceDxeEntryPoint (
>    EFI_STATUS  Status;
>    EFI_GUID    *ReadyGuid;
> 
> -  DEBUG ((DEBUG_INFO, "%a: Entry\n.", __FUNCTION__));
> +  DEBUG ((DEBUG_INFO, "%a: Entry\n.", __func__));
> 
>    //
>    // Check if the Redfish Host Interface depends on
> diff --git a/RedfishPkg/RedfishRestExDxe/RedfishRestExImpl.c
> b/RedfishPkg/RedfishRestExDxe/RedfishRestExImpl.c
> index 75b3f1fab8fc..41f2b29c83be 100644
> --- a/RedfishPkg/RedfishRestExDxe/RedfishRestExImpl.c
> +++ b/RedfishPkg/RedfishRestExDxe/RedfishRestExImpl.c
> @@ -28,17 +28,17 @@ ResetHttpTslSession (
>  {
>    EFI_STATUS  Status;
> 
> -  DEBUG ((DEBUG_INFO, "%a: TCP connection is finished. Could be TSL session
> closure, reset HTTP instance for the new TLS session.\n", __FUNCTION__));
> +  DEBUG ((DEBUG_INFO, "%a: TCP connection is finished. Could be TSL session
> closure, reset HTTP instance for the new TLS session.\n", __func__));
> 
>    Status = Instance->HttpIo.Http->Configure (Instance->HttpIo.Http, NULL);
>    if (EFI_ERROR (Status)) {
> -    DEBUG ((DEBUG_ERROR, "%a: Error to reset HTTP instance.\n",
> __FUNCTION__));
> +    DEBUG ((DEBUG_ERROR, "%a: Error to reset HTTP instance.\n", __func__));
>      return Status;
>    }
> 
>    Status = Instance->HttpIo.Http->Configure (Instance->HttpIo.Http,
> &((EFI_REST_EX_HTTP_CONFIG_DATA *)Instance->ConfigData)-
> >HttpConfigData);
>    if (EFI_ERROR (Status)) {
> -    DEBUG ((DEBUG_ERROR, "%a: Error to re-initiate HTTP instance.\n",
> __FUNCTION__));
> +    DEBUG ((DEBUG_ERROR, "%a: Error to re-initiate HTTP instance.\n",
> __func__));
>    }
> 
>    return Status;
> @@ -70,7 +70,7 @@ RedfishCheckHttpReceiveStatus (
>      ReturnStatus = EFI_SUCCESS;
>    } else if (HttpIoReceiveStatus != EFI_CONNECTION_FIN) {
>      if ((Instance->Flags & RESTEX_INSTANCE_FLAGS_TCP_ERROR_RETRY) == 0) {
> -      DEBUG ((DEBUG_ERROR, "%a: TCP error, reset HTTP session.\n",
> __FUNCTION__));
> +      DEBUG ((DEBUG_ERROR, "%a: TCP error, reset HTTP session.\n",
> __func__));
>        Instance->Flags |= RESTEX_INSTANCE_FLAGS_TCP_ERROR_RETRY;
>        gBS->Stall (500);
>        Status = ResetHttpTslSession (Instance);
> @@ -78,20 +78,20 @@ RedfishCheckHttpReceiveStatus (
>          return EFI_NOT_READY;
>        }
> 
> -      DEBUG ((DEBUG_ERROR, "%a: Reset HTTP instance fail.\n",
> __FUNCTION__));
> +      DEBUG ((DEBUG_ERROR, "%a: Reset HTTP instance fail.\n", __func__));
>      }
> 
>      ReturnStatus = EFI_DEVICE_ERROR;
>    } else {
>      if ((Instance->Flags & RESTEX_INSTANCE_FLAGS_TLS_RETRY) != 0) {
> -      DEBUG ((DEBUG_ERROR, "%a: REST_EX Send and receive fail even with a
> new TLS session.\n", __FUNCTION__));
> +      DEBUG ((DEBUG_ERROR, "%a: REST_EX Send and receive fail even with a
> new TLS session.\n", __func__));
>        ReturnStatus = EFI_DEVICE_ERROR;
>      }
> 
>      Instance->Flags |= RESTEX_INSTANCE_FLAGS_TLS_RETRY;
>      Status           = ResetHttpTslSession (Instance);
>      if (EFI_ERROR (Status)) {
> -      DEBUG ((DEBUG_ERROR, "%a: Reset HTTP instance fail.\n",
> __FUNCTION__));
> +      DEBUG ((DEBUG_ERROR, "%a: Reset HTTP instance fail.\n", __func__));
>        ReturnStatus = EFI_DEVICE_ERROR;
>      }
> 
> --
> 2.34.1


^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 17/18] UefiPayloadPkg: Update code to be more C11 compliant by using __func__
  2023-04-06 22:23 ` [PATCH 17/18] UefiPayloadPkg: " Rebecca Cran
@ 2023-04-07  5:57   ` Guo, Gua
  2023-04-07  7:55   ` Lu, James
  1 sibling, 0 replies; 34+ messages in thread
From: Guo, Gua @ 2023-04-07  5:57 UTC (permalink / raw)
  To: Rebecca Cran, devel@edk2.groups.io, Gao, Liming,
	Kinney, Michael D, Jiang, Guomin, Xu, Wei6, Dong, Guo, Ni, Ray,
	Rhodes, Sean, Lu, James, Andrew Fish, Wu, Hao A, Maciej Rabeda,
	Siyuan Fu, Yao, Jiewen, Wang, Jian J, Lu, Xiaoyu1, Ard Biesheuvel,
	Sami Mujawar, Supreeth Venkatesh, Michael Kubacki,
	Desimone, Nathaniel L, Sean Brogan
  Cc: Leif Lindholm, Abner Chang, Nickle Wang, Igor Kulchytskyy,
	Daniel Schaefer, Xu, Min M, Justen, Jordan L, Gerd Hoffmann,
	Peter Grehan, Aktas, Erdem, James Bottomley, Tom Lendacky,
	Michael Roth, Sunil V L, Warkentin, Andrei

Reviewed-by: Gua Guo <gua.guo@intel.com>

-----Original Message-----
From: Rebecca Cran <rebecca@bsdio.com> 
Sent: Friday, April 7, 2023 6:23 AM
To: devel@edk2.groups.io; Gao, Liming <gaoliming@byosoft.com.cn>; Kinney, Michael D <michael.d.kinney@intel.com>; Jiang, Guomin <guomin.jiang@intel.com>; Xu, Wei6 <wei6.xu@intel.com>; Dong, Guo <guo.dong@intel.com>; Ni, Ray <ray.ni@intel.com>; Rhodes, Sean <sean@starlabs.systems>; Lu, James <james.lu@intel.com>; Guo, Gua <gua.guo@intel.com>; Andrew Fish <afish@apple.com>; Wu, Hao A <hao.a.wu@intel.com>; Maciej Rabeda <maciej.rabeda@linux.intel.com>; Siyuan Fu <siyuan.fu@intel.com>; Yao, Jiewen <jiewen.yao@intel.com>; Wang, Jian J <jian.j.wang@intel.com>; Lu, Xiaoyu1 <xiaoyu1.lu@intel.com>; Ard Biesheuvel <ardb+tianocore@kernel.org>; Sami Mujawar <sami.mujawar@arm.com>; Supreeth Venkatesh <supreeth.venkatesh@arm.com>; Michael Kubacki <mikuback@linux.microsoft.com>; Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>; Sean Brogan <sean.brogan@microsoft.com>
Cc: Rebecca Cran <rebecca@bsdio.com>; Leif Lindholm <quic_llindhol@quicinc.com>; Abner Chang <abner.chang@amd.com>; Nickle Wang <nicklew@nvidia.com>; Igor Kulchytskyy <igork@ami.com>; Daniel Schaefer <git@danielschaefer.me>; Xu, Min M <min.m.xu@intel.com>; Justen, Jordan L <jordan.l.justen@intel.com>; Gerd Hoffmann <kraxel@redhat.com>; Peter Grehan <grehan@freebsd.org>; Aktas, Erdem <erdemaktas@google.com>; James Bottomley <jejb@linux.ibm.com>; Tom Lendacky <thomas.lendacky@amd.com>; Michael Roth <michael.roth@amd.com>; Sunil V L <sunilvl@ventanamicro.com>; Warkentin, Andrei <andrei.warkentin@intel.com>
Subject: [PATCH 17/18] UefiPayloadPkg: 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 UefiPayloadPkg.

Visual Studio versions before VS 2015 don't support __func__ and so will fail to compile. A workaround is to define __func__ as __FUNCTION__ :

  #define __func__ __FUNCTION__

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
---
 UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c | 4 ++--
 UefiPayloadPkg/UefiPayloadEntry/Ia32/DxeLoadFunc.c         | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c b/UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c
index 790e6109c03e..57274754141d 100644
--- a/UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c
+++ b/UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c
@@ -135,7 +135,7 @@ InitRootBridge (
                  &mRootBridgeDevicePathTemplate
                  );
   if (DevicePath == NULL) {
-    DEBUG ((DEBUG_ERROR, "%a: %r\n", __FUNCTION__, EFI_OUT_OF_RESOURCES));
+    DEBUG ((DEBUG_ERROR, "%a: %r\n", __func__, EFI_OUT_OF_RESOURCES));
     return EFI_OUT_OF_RESOURCES;
   }
 
@@ -145,7 +145,7 @@ InitRootBridge (
   DEBUG ((
     DEBUG_INFO,
     "%a: populated root bus %d, with room for %d subordinate bus(es)\n",
-    __FUNCTION__,
+    __func__,
     RootBusNumber,
     MaxSubBusNumber - RootBusNumber
     ));
diff --git a/UefiPayloadPkg/UefiPayloadEntry/Ia32/DxeLoadFunc.c b/UefiPayloadPkg/UefiPayloadEntry/Ia32/DxeLoadFunc.c
index c66e56aee15a..61a9f01ec9e7 100644
--- a/UefiPayloadPkg/UefiPayloadEntry/Ia32/DxeLoadFunc.c
+++ b/UefiPayloadPkg/UefiPayloadEntry/Ia32/DxeLoadFunc.c
@@ -355,7 +355,7 @@ HandOffToDxeCore (
     DEBUG ((
       DEBUG_INFO,
       "%a() Stack Base: 0x%lx, Stack Size: 0x%x\n",
-      __FUNCTION__,
+      __func__,
       BaseOfStack,
       STACK_SIZE
       ));
--
2.34.1


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* Re: [PATCH 17/18] UefiPayloadPkg: Update code to be more C11 compliant by using __func__
  2023-04-06 22:23 ` [PATCH 17/18] UefiPayloadPkg: " Rebecca Cran
  2023-04-07  5:57   ` Guo, Gua
@ 2023-04-07  7:55   ` Lu, James
  1 sibling, 0 replies; 34+ messages in thread
From: Lu, James @ 2023-04-07  7:55 UTC (permalink / raw)
  To: Rebecca Cran, devel@edk2.groups.io, Gao, Liming,
	Kinney, Michael D, Jiang, Guomin, Xu, Wei6, Dong, Guo, Ni, Ray,
	Rhodes, Sean, Guo, Gua, Andrew Fish, Wu, Hao A, Maciej Rabeda,
	Siyuan Fu, Yao, Jiewen, Wang, Jian J, Lu, Xiaoyu1, Ard Biesheuvel,
	Sami Mujawar, Supreeth Venkatesh, Michael Kubacki,
	Desimone, Nathaniel L, Sean Brogan
  Cc: Leif Lindholm, Abner Chang, Nickle Wang, Igor Kulchytskyy,
	Daniel Schaefer, Xu, Min M, Justen, Jordan L, Gerd Hoffmann,
	Peter Grehan, Aktas, Erdem, James Bottomley, Tom Lendacky,
	Michael Roth, Sunil V L, Warkentin, Andrei

Reviewed-by: James Lu <james.lu@intel.com>


Thanks,
James

-----Original Message-----
From: Rebecca Cran <rebecca@bsdio.com> 
Sent: Friday, April 7, 2023 6:23 AM
To: devel@edk2.groups.io; Gao, Liming <gaoliming@byosoft.com.cn>; Kinney, Michael D <michael.d.kinney@intel.com>; Jiang, Guomin <guomin.jiang@intel.com>; Xu, Wei6 <wei6.xu@intel.com>; Dong, Guo <guo.dong@intel.com>; Ni, Ray <ray.ni@intel.com>; Rhodes, Sean <sean@starlabs.systems>; Lu, James <james.lu@intel.com>; Guo, Gua <gua.guo@intel.com>; Andrew Fish <afish@apple.com>; Wu, Hao A <hao.a.wu@intel.com>; Maciej Rabeda <maciej.rabeda@linux.intel.com>; Siyuan Fu <siyuan.fu@intel.com>; Yao, Jiewen <jiewen.yao@intel.com>; Wang, Jian J <jian.j.wang@intel.com>; Lu, Xiaoyu1 <xiaoyu1.lu@intel.com>; Ard Biesheuvel <ardb+tianocore@kernel.org>; Sami Mujawar <sami.mujawar@arm.com>; Supreeth Venkatesh <supreeth.venkatesh@arm.com>; Michael Kubacki <mikuback@linux.microsoft.com>; Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>; Sean Brogan <sean.brogan@microsoft.com>
Cc: Rebecca Cran <rebecca@bsdio.com>; Leif Lindholm <quic_llindhol@quicinc.com>; Abner Chang <abner.chang@amd.com>; Nickle Wang <nicklew@nvidia.com>; Igor Kulchytskyy <igork@ami.com>; Daniel Schaefer <git@danielschaefer.me>; Xu, Min M <min.m.xu@intel.com>; Justen, Jordan L <jordan.l.justen@intel.com>; Gerd Hoffmann <kraxel@redhat.com>; Peter Grehan <grehan@freebsd.org>; Aktas, Erdem <erdemaktas@google.com>; James Bottomley <jejb@linux.ibm.com>; Tom Lendacky <thomas.lendacky@amd.com>; Michael Roth <michael.roth@amd.com>; Sunil V L <sunilvl@ventanamicro.com>; Warkentin, Andrei <andrei.warkentin@intel.com>
Subject: [PATCH 17/18] UefiPayloadPkg: 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 UefiPayloadPkg.

Visual Studio versions before VS 2015 don't support __func__ and so will fail to compile. A workaround is to define __func__ as __FUNCTION__ :

  #define __func__ __FUNCTION__

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
---
 UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c | 4 ++--
 UefiPayloadPkg/UefiPayloadEntry/Ia32/DxeLoadFunc.c         | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c b/UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c
index 790e6109c03e..57274754141d 100644
--- a/UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c
+++ b/UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c
@@ -135,7 +135,7 @@ InitRootBridge (
                  &mRootBridgeDevicePathTemplate
                  );
   if (DevicePath == NULL) {
-    DEBUG ((DEBUG_ERROR, "%a: %r\n", __FUNCTION__, EFI_OUT_OF_RESOURCES));
+    DEBUG ((DEBUG_ERROR, "%a: %r\n", __func__, EFI_OUT_OF_RESOURCES));
     return EFI_OUT_OF_RESOURCES;
   }
 
@@ -145,7 +145,7 @@ InitRootBridge (
   DEBUG ((
     DEBUG_INFO,
     "%a: populated root bus %d, with room for %d subordinate bus(es)\n",
-    __FUNCTION__,
+    __func__,
     RootBusNumber,
     MaxSubBusNumber - RootBusNumber
     ));
diff --git a/UefiPayloadPkg/UefiPayloadEntry/Ia32/DxeLoadFunc.c b/UefiPayloadPkg/UefiPayloadEntry/Ia32/DxeLoadFunc.c
index c66e56aee15a..61a9f01ec9e7 100644
--- a/UefiPayloadPkg/UefiPayloadEntry/Ia32/DxeLoadFunc.c
+++ b/UefiPayloadPkg/UefiPayloadEntry/Ia32/DxeLoadFunc.c
@@ -355,7 +355,7 @@ HandOffToDxeCore (
     DEBUG ((
       DEBUG_INFO,
       "%a() Stack Base: 0x%lx, Stack Size: 0x%x\n",
-      __FUNCTION__,
+      __func__,
       BaseOfStack,
       STACK_SIZE
       ));
--
2.34.1


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* Re: [PATCH 16/18] EmulatorPkg: Update code to be more C11 compliant by using __func__
  2023-04-06 22:23 ` [PATCH 16/18] EmulatorPkg: " Rebecca Cran
  2023-04-07  3:08   ` Ni, Ray
@ 2023-04-07  8:23   ` Chang, Abner
  1 sibling, 0 replies; 34+ messages in thread
From: Chang, Abner @ 2023-04-07  8:23 UTC (permalink / raw)
  To: Rebecca Cran, devel@edk2.groups.io, Liming Gao, Michael D Kinney,
	Guomin Jiang, Wei6 Xu, Guo Dong, Ray Ni, Sean Rhodes, James Lu,
	Gua Guo, Andrew Fish, Hao A Wu, Maciej Rabeda, Siyuan Fu,
	Jiewen Yao, Jian J Wang, Xiaoyu Lu, Ard Biesheuvel, Sami Mujawar,
	Supreeth Venkatesh, Michael Kubacki, Nate DeSimone, Sean Brogan
  Cc: Leif Lindholm, Nickle Wang, Igor Kulchytskyy, Daniel Schaefer,
	Min Xu, Jordan Justen, Gerd Hoffmann, Peter Grehan, Erdem Aktas,
	James Bottomley, Lendacky, Thomas, Roth, Michael, Sunil V L,
	Andrei Warkentin

[AMD Official Use Only - General]

Hi Rebecca,
I can only give you reviewed-by for RedfishPlatformHostInterfaceLib.c.

Reviewed-by: Abner Chang <Abner.Chang@amd.com>

> -----Original Message-----
> From: Rebecca Cran <rebecca@bsdio.com>
> Sent: Friday, April 7, 2023 6:23 AM
> To: devel@edk2.groups.io; Liming Gao <gaoliming@byosoft.com.cn>;
> Michael D Kinney <michael.d.kinney@intel.com>; Guomin Jiang
> <guomin.jiang@intel.com>; Wei6 Xu <wei6.xu@intel.com>; Guo Dong
> <guo.dong@intel.com>; Ray Ni <ray.ni@intel.com>; Sean Rhodes
> <sean@starlabs.systems>; James Lu <james.lu@intel.com>; Gua Guo
> <gua.guo@intel.com>; Andrew Fish <afish@apple.com>; Hao A Wu
> <hao.a.wu@intel.com>; Maciej Rabeda <maciej.rabeda@linux.intel.com>;
> Siyuan Fu <siyuan.fu@intel.com>; Jiewen Yao <jiewen.yao@intel.com>; Jian
> J Wang <jian.j.wang@intel.com>; Xiaoyu Lu <xiaoyu1.lu@intel.com>; Ard
> Biesheuvel <ardb+tianocore@kernel.org>; Sami Mujawar
> <sami.mujawar@arm.com>; Supreeth Venkatesh
> <supreeth.venkatesh@arm.com>; Michael Kubacki
> <mikuback@linux.microsoft.com>; Nate DeSimone
> <nathaniel.l.desimone@intel.com>; Sean Brogan
> <sean.brogan@microsoft.com>
> Cc: Rebecca Cran <rebecca@bsdio.com>; Leif Lindholm
> <quic_llindhol@quicinc.com>; Chang, Abner <Abner.Chang@amd.com>;
> Nickle Wang <nicklew@nvidia.com>; Igor Kulchytskyy <igork@ami.com>;
> Daniel Schaefer <git@danielschaefer.me>; Min Xu <min.m.xu@intel.com>;
> Jordan Justen <jordan.l.justen@intel.com>; Gerd Hoffmann
> <kraxel@redhat.com>; Peter Grehan <grehan@freebsd.org>; Erdem Aktas
> <erdemaktas@google.com>; James Bottomley <jejb@linux.ibm.com>;
> Lendacky, Thomas <Thomas.Lendacky@amd.com>; Roth, Michael
> <Michael.Roth@amd.com>; Sunil V L <sunilvl@ventanamicro.com>; Andrei
> Warkentin <andrei.warkentin@intel.com>
> Subject: [PATCH 16/18] EmulatorPkg: Update code to be more C11 compliant
> by using __func__
> 
> Caution: This message originated from an External Source. Use proper
> caution when opening attachments, clicking links, or responding.
> 
> 
> __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
> EmulatorPkg.
> 
> Visual Studio versions before VS 2015 don't support __func__ and so will fail
> to compile. A workaround is to define __func__ as __FUNCTION__ :
> 
>   #define __func__ __FUNCTION__
> 
> Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
> ---
> 
> EmulatorPkg/Library/RedfishPlatformHostInterfaceLib/RedfishPlatformHostI
> nterfaceLib.c | 2 +-
>  EmulatorPkg/Win/Host/WinPacketFilter.c                                                | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git
> a/EmulatorPkg/Library/RedfishPlatformHostInterfaceLib/RedfishPlatformHo
> stInterfaceLib.c
> b/EmulatorPkg/Library/RedfishPlatformHostInterfaceLib/RedfishPlatformHo
> stInterfaceLib.c
> index 4361bd4170e3..4332caa71016 100644
> ---
> a/EmulatorPkg/Library/RedfishPlatformHostInterfaceLib/RedfishPlatformHo
> stInterfaceLib.c
> +++ b/EmulatorPkg/Library/RedfishPlatformHostInterfaceLib/RedfishPlatfor
> +++ mHostInterfaceLib.c
> @@ -538,7 +538,7 @@ RedfishPlatformHostInterfaceConstructor (
>    EFI_STATUS  Status;
> 
>    Status = GetRedfishRecordFromVariable (&mRedfishOverIpProtocolData,
> &mRedfishProtocolDataSize);
> -  DEBUG ((DEBUG_INFO, "%a: GetRedfishRecordFromVariable() - %r\n",
> __FUNCTION__, Status));
> +  DEBUG ((DEBUG_INFO, "%a: GetRedfishRecordFromVariable() - %r\n",
> + __func__, Status));
>    if (!EFI_ERROR (Status)) {
>      DumpRedfishIpProtocolData (mRedfishOverIpProtocolData,
> mRedfishProtocolDataSize);
>    }
> diff --git a/EmulatorPkg/Win/Host/WinPacketFilter.c
> b/EmulatorPkg/Win/Host/WinPacketFilter.c
> index 21859897c85f..a71c7e8c131b 100644
> --- a/EmulatorPkg/Win/Host/WinPacketFilter.c
> +++ b/EmulatorPkg/Win/Host/WinPacketFilter.c
> @@ -966,7 +966,7 @@ WintNtInitializeNetUtilityData (
>      goto ErrorReturn;
>    }
> 
> -  DEBUG ((DEBUG_INFO, "%a, total %d interface(s) found\n",
> __FUNCTION__, InterfaceCount));
> +  DEBUG ((DEBUG_INFO, "%a, total %d interface(s) found\n", __func__,
> + InterfaceCount));
>    //
>    // Active interface index is set to first interface if given instance does
>    // not exist.
> --
> 2.34.1

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 07/18] EmbeddedPkg: Update code to be more C11 compliant by using __func__
  2023-04-06 22:23 ` [PATCH 07/18] EmbeddedPkg: " Rebecca Cran
@ 2023-04-07  8:25   ` Chang, Abner
  0 siblings, 0 replies; 34+ messages in thread
From: Chang, Abner @ 2023-04-07  8:25 UTC (permalink / raw)
  To: Rebecca Cran, devel@edk2.groups.io, Liming Gao, Michael D Kinney,
	Guomin Jiang, Wei6 Xu, Guo Dong, Ray Ni, Sean Rhodes, James Lu,
	Gua Guo, Andrew Fish, Hao A Wu, Maciej Rabeda, Siyuan Fu,
	Jiewen Yao, Jian J Wang, Xiaoyu Lu, Ard Biesheuvel, Sami Mujawar,
	Supreeth Venkatesh, Michael Kubacki, Nate DeSimone, Sean Brogan
  Cc: Leif Lindholm, Nickle Wang, Igor Kulchytskyy, Daniel Schaefer,
	Min Xu, Jordan Justen, Gerd Hoffmann, Peter Grehan, Erdem Aktas,
	James Bottomley, Lendacky, Thomas, Roth, Michael, Sunil V L,
	Andrei Warkentin

[AMD Official Use Only - General]

Reviewed-by: Abner Chang <abner.chang@amd.com>

> -----Original Message-----
> From: Rebecca Cran <rebecca@bsdio.com>
> Sent: Friday, April 7, 2023 6:23 AM
> To: devel@edk2.groups.io; Liming Gao <gaoliming@byosoft.com.cn>;
> Michael D Kinney <michael.d.kinney@intel.com>; Guomin Jiang
> <guomin.jiang@intel.com>; Wei6 Xu <wei6.xu@intel.com>; Guo Dong
> <guo.dong@intel.com>; Ray Ni <ray.ni@intel.com>; Sean Rhodes
> <sean@starlabs.systems>; James Lu <james.lu@intel.com>; Gua Guo
> <gua.guo@intel.com>; Andrew Fish <afish@apple.com>; Hao A Wu
> <hao.a.wu@intel.com>; Maciej Rabeda <maciej.rabeda@linux.intel.com>;
> Siyuan Fu <siyuan.fu@intel.com>; Jiewen Yao <jiewen.yao@intel.com>; Jian
> J Wang <jian.j.wang@intel.com>; Xiaoyu Lu <xiaoyu1.lu@intel.com>; Ard
> Biesheuvel <ardb+tianocore@kernel.org>; Sami Mujawar
> <sami.mujawar@arm.com>; Supreeth Venkatesh
> <supreeth.venkatesh@arm.com>; Michael Kubacki
> <mikuback@linux.microsoft.com>; Nate DeSimone
> <nathaniel.l.desimone@intel.com>; Sean Brogan
> <sean.brogan@microsoft.com>
> Cc: Rebecca Cran <rebecca@bsdio.com>; Leif Lindholm
> <quic_llindhol@quicinc.com>; Chang, Abner <Abner.Chang@amd.com>;
> Nickle Wang <nicklew@nvidia.com>; Igor Kulchytskyy <igork@ami.com>;
> Daniel Schaefer <git@danielschaefer.me>; Min Xu <min.m.xu@intel.com>;
> Jordan Justen <jordan.l.justen@intel.com>; Gerd Hoffmann
> <kraxel@redhat.com>; Peter Grehan <grehan@freebsd.org>; Erdem Aktas
> <erdemaktas@google.com>; James Bottomley <jejb@linux.ibm.com>;
> Lendacky, Thomas <Thomas.Lendacky@amd.com>; Roth, Michael
> <Michael.Roth@amd.com>; Sunil V L <sunilvl@ventanamicro.com>; Andrei
> Warkentin <andrei.warkentin@intel.com>
> Subject: [PATCH 07/18] EmbeddedPkg: Update code to be more C11
> compliant by using __func__
> 
> Caution: This message originated from an External Source. Use proper
> caution when opening attachments, clicking links, or responding.
> 
> 
> __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
> EmbeddedPkg.
> 
> Visual Studio versions before VS 2015 don't support __func__ and so will fail
> to compile. A workaround is to define __func__ as __FUNCTION__ :
> 
>   #define __func__ __FUNCTION__
> 
> Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
> ---
>  EmbeddedPkg/Drivers/ConsolePrefDxe/ConsolePrefDxe.c       | 18
> ++++++++--------
>  EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.c         | 10 ++++-----
>  EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.c           | 22 ++++++++++-
> ---------
>  EmbeddedPkg/Library/NonCoherentDmaLib/NonCoherentDmaLib.c |  2 +-
>  EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClock.c       |  2 +-
>  EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c          | 20
> +++++++++---------
>  6 files changed, 37 insertions(+), 37 deletions(-)
> 
> diff --git a/EmbeddedPkg/Drivers/ConsolePrefDxe/ConsolePrefDxe.c
> b/EmbeddedPkg/Drivers/ConsolePrefDxe/ConsolePrefDxe.c
> index 07b82892eb0f..2c2e73e72076 100644
> --- a/EmbeddedPkg/Drivers/ConsolePrefDxe/ConsolePrefDxe.c
> +++ b/EmbeddedPkg/Drivers/ConsolePrefDxe/ConsolePrefDxe.c
> @@ -116,7 +116,7 @@ RemoveDtStdoutPath (
>      DEBUG ((
>        DEBUG_INFO,
>        "%a: could not retrieve DT blob - %r\n",
> -      __FUNCTION__,
> +      __func__,
>        Status
>        ));
>      return;
> @@ -132,7 +132,7 @@ RemoveDtStdoutPath (
>      DEBUG ((
>        DEBUG_INFO,
>        "%a: Failed to delete 'stdout-path' property: %a\n",
> -      __FUNCTION__,
> +      __func__,
>        fdt_strerror (Error)
>        ));
>    }
> @@ -190,7 +190,7 @@ RemoveSpcrTable (
>        DEBUG ((
>          DEBUG_WARN,
>          "%a: failed to uninstall SPCR table - %r\n",
> -        __FUNCTION__,
> +        __func__,
>          Status
>          ));
>      }
> @@ -224,7 +224,7 @@ OnReadyToBoot (
>      DEBUG ((
>        DEBUG_ERROR,
>        "%a: variable '%s' could not be read - bailing!\n",
> -      __FUNCTION__,
> +      __func__,
>        CONSOLE_PREF_VARIABLE_NAME
>        ));
>      return;
> @@ -234,7 +234,7 @@ OnReadyToBoot (
>      DEBUG ((
>        DEBUG_INFO,
>        "%a: serial console preferred - doing nothing\n",
> -      __FUNCTION__
> +      __func__
>        ));
>      return;
>    }
> @@ -247,7 +247,7 @@ OnReadyToBoot (
>      DEBUG ((
>        DEBUG_INFO,
>        "%a: no GOP instances found - doing nothing (%r)\n",
> -      __FUNCTION__,
> +      __func__,
>        Status
>        ));
>      return;
> @@ -296,7 +296,7 @@ ConsolePrefDxeEntryPoint (
>      DEBUG ((
>        DEBUG_INFO,
>        "%a: no console preference found, defaulting to graphical\n",
> -      __FUNCTION__
> +      __func__
>        ));
>      ConsolePref.Console = CONSOLE_PREF_GRAPHICAL;
>    }
> @@ -308,7 +308,7 @@ ConsolePrefDxeEntryPoint (
>      DEBUG ((
>        DEBUG_WARN,
>        "%a: invalid value for %s, defaulting to graphical\n",
> -      __FUNCTION__,
> +      __func__,
>        CONSOLE_PREF_VARIABLE_NAME
>        ));
>      ConsolePref.Console = CONSOLE_PREF_GRAPHICAL; @@ -332,7 +332,7
> @@ ConsolePrefDxeEntryPoint (
>        DEBUG ((
>          DEBUG_ERROR,
>          "%a: gRT->SetVariable () failed - %r\n",
> -        __FUNCTION__,
> +        __func__,
>          Status
>          ));
>        return Status;
> diff --git a/EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.c
> b/EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.c
> index 7f7e8c446c98..b94cd4da25d1 100644
> --- a/EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.c
> +++ b/EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.c
> @@ -122,7 +122,7 @@ DtPlatformDxeEntryPoint (
>      DEBUG ((
>        DEBUG_WARN,
>        "%a: no DTB blob could be loaded, defaulting to ACPI (Status == %r)\n",
> -      __FUNCTION__,
> +      __func__,
>        Status
>        ));
>      DtAcpiPref.Pref = DT_ACPI_SELECT_ACPI; @@ -142,7 +142,7 @@
> DtPlatformDxeEntryPoint (
>        DEBUG ((
>          DEBUG_WARN,
>          "%a: no DT/ACPI preference found, defaulting to %a\n",
> -        __FUNCTION__,
> +        __func__,
>          PcdGetBool (PcdDefaultDtPref) ? "DT" : "ACPI"
>          ));
>        DtAcpiPref.Pref = PcdGetBool (PcdDefaultDtPref) ? DT_ACPI_SELECT_DT
> @@ -157,7 +157,7 @@ DtPlatformDxeEntryPoint (
>      DEBUG ((
>        DEBUG_WARN,
>        "%a: invalid value for %s, defaulting to %a\n",
> -      __FUNCTION__,
> +      __func__,
>        DT_ACPI_VARIABLE_NAME,
>        PcdGetBool (PcdDefaultDtPref) ? "DT" : "ACPI"
>        ));
> @@ -197,7 +197,7 @@ DtPlatformDxeEntryPoint (
>        DEBUG ((
>          DEBUG_ERROR,
>          "%a: failed to install gEdkiiPlatformHasAcpiGuid as a protocol\n",
> -        __FUNCTION__
> +        __func__
>          ));
>        goto FreeDtb;
>      }
> @@ -211,7 +211,7 @@ DtPlatformDxeEntryPoint (
>        DEBUG ((
>          DEBUG_ERROR,
>          "%a: failed to install FDT configuration table\n",
> -        __FUNCTION__
> +        __func__
>          ));
>        goto FreeDtb;
>      }
> diff --git a/EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.c
> b/EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.c
> index b182c77d19b1..7da505a313d7 100644
> --- a/EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.c
> +++ b/EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.c
> @@ -222,7 +222,7 @@ FindCompatibleNodeReg (
>      DEBUG ((
>        DEBUG_ERROR,
>        "%a: '%a' compatible node has invalid 'reg' property (size == 0x%x)\n",
> -      __FUNCTION__,
> +      __func__,
>        CompatibleString,
>        *RegSize
>        ));
> @@ -263,7 +263,7 @@ FindNextMemoryNodeReg (
>      }
> 
>      if (!IsNodeEnabled (Next)) {
> -      DEBUG ((DEBUG_WARN, "%a: ignoring disabled memory node\n",
> __FUNCTION__));
> +      DEBUG ((DEBUG_WARN, "%a: ignoring disabled memory node\n",
> + __func__));
>        continue;
>      }
> 
> @@ -279,7 +279,7 @@ FindNextMemoryNodeReg (
>          DEBUG ((
>            DEBUG_WARN,
>            "%a: ignoring memory node with no 'reg' property\n",
> -          __FUNCTION__
> +          __func__
>            ));
>          continue;
>        }
> @@ -288,7 +288,7 @@ FindNextMemoryNodeReg (
>          DEBUG ((
>            DEBUG_WARN,
>            "%a: ignoring memory node with invalid 'reg' property (size ==
> 0x%x)\n",
> -          __FUNCTION__,
> +          __func__,
>            *RegSize
>            ));
>          continue;
> @@ -391,7 +391,7 @@ OnPlatformHasDeviceTree (
>    DEBUG ((
>      DEBUG_INFO,
>      "%a: exposing DTB @ 0x%p to OS\n",
> -    __FUNCTION__,
> +    __func__,
>      DeviceTreeBase
>      ));
>    Status = gBS->InstallConfigurationTable (&gFdtTableGuid, DeviceTreeBase);
> @@ -424,7 +424,7 @@ InitializeFdtClientDxe (
>      DEBUG ((
>        DEBUG_ERROR,
>        "%a: No DTB found @ 0x%p\n",
> -      __FUNCTION__,
> +      __func__,
>        DeviceTreeBase
>        ));
>      return EFI_NOT_FOUND;
> @@ -432,7 +432,7 @@ InitializeFdtClientDxe (
> 
>    mDeviceTreeBase = DeviceTreeBase;
> 
> -  DEBUG ((DEBUG_INFO, "%a: DTB @ 0x%p\n", __FUNCTION__,
> mDeviceTreeBase));
> +  DEBUG ((DEBUG_INFO, "%a: DTB @ 0x%p\n", __func__,
> mDeviceTreeBase));
> 
>    //
>    // Register a protocol notify for the EDKII Platform Has Device Tree @@ -
> 446,7 +446,7 @@ InitializeFdtClientDxe (
>                    &PlatformHasDeviceTreeEvent
>                    );
>    if (EFI_ERROR (Status)) {
> -    DEBUG ((DEBUG_ERROR, "%a: CreateEvent(): %r\n", __FUNCTION__,
> Status));
> +    DEBUG ((DEBUG_ERROR, "%a: CreateEvent(): %r\n", __func__, Status));
>      return Status;
>    }
> 
> @@ -459,7 +459,7 @@ InitializeFdtClientDxe (
>      DEBUG ((
>        DEBUG_ERROR,
>        "%a: RegisterProtocolNotify(): %r\n",
> -      __FUNCTION__,
> +      __func__,
>        Status
>        ));
>      goto CloseEvent;
> @@ -470,7 +470,7 @@ InitializeFdtClientDxe (
>    //
>    Status = gBS->SignalEvent (PlatformHasDeviceTreeEvent);
>    if (EFI_ERROR (Status)) {
> -    DEBUG ((DEBUG_ERROR, "%a: SignalEvent(): %r\n", __FUNCTION__,
> Status));
> +    DEBUG ((DEBUG_ERROR, "%a: SignalEvent(): %r\n", __func__, Status));
>      goto CloseEvent;
>    }
> 
> @@ -484,7 +484,7 @@ InitializeFdtClientDxe (
>      DEBUG ((
>        DEBUG_ERROR,
>        "%a: InstallProtocolInterface(): %r\n",
> -      __FUNCTION__,
> +      __func__,
>        Status
>        ));
>      goto CloseEvent;
> diff --git
> a/EmbeddedPkg/Library/NonCoherentDmaLib/NonCoherentDmaLib.c
> b/EmbeddedPkg/Library/NonCoherentDmaLib/NonCoherentDmaLib.c
> index 44a78c947ef4..e193352fbe41 100644
> --- a/EmbeddedPkg/Library/NonCoherentDmaLib/NonCoherentDmaLib.c
> +++ b/EmbeddedPkg/Library/NonCoherentDmaLib/NonCoherentDmaLib.c
> @@ -349,7 +349,7 @@ DmaMap (
>      "%a: Operation type 'MapOperationBusMasterCommonBuffer' is only "
>      "supported\non memory regions that were allocated using "
>      "DmaAllocateBuffer ()\n",
> -    __FUNCTION__
> +    __func__
>      ));
>    Status = EFI_UNSUPPORTED;
>  FreeMapInfo:
> diff --git a/EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClock.c
> b/EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClock.c
> index 7adb7324057e..17dde432c4eb 100644
> --- a/EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClock.c
> +++ b/EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClock.c
> @@ -219,7 +219,7 @@ InitializeRealTimeClock (
>      DEBUG ((
>        DEBUG_WARN,
>        "%a: using default timezone/daylight settings\n",
> -      __FUNCTION__
> +      __func__
>        ));
> 
>      mTimeSettings.TimeZone = EFI_UNSPECIFIED_TIMEZONE; diff --git
> a/EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c
> b/EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c
> index 86eb55800e5a..57388d9f461c 100755
> --- a/EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c
> +++ b/EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c
> @@ -414,13 +414,13 @@ InitializeSdMmcDevice (
> 
>    Status = MmcHost->SendCommand (MmcHost, MMC_CMD55, CmdArg);
>    if (EFI_ERROR (Status)) {
> -    DEBUG ((DEBUG_ERROR, "%a (MMC_CMD55): Error and Status = %r\n",
> __FUNCTION__, Status));
> +    DEBUG ((DEBUG_ERROR, "%a (MMC_CMD55): Error and Status = %r\n",
> + __func__, Status));
>      return Status;
>    }
> 
>    Status = MmcHost->ReceiveResponse (MmcHost,
> MMC_RESPONSE_TYPE_R1, Response);
>    if (EFI_ERROR (Status)) {
> -    DEBUG ((DEBUG_ERROR, "%a (MMC_CMD55): Error and Status = %r\n",
> __FUNCTION__, Status));
> +    DEBUG ((DEBUG_ERROR, "%a (MMC_CMD55): Error and Status = %r\n",
> + __func__, Status));
>      return Status;
>    }
> 
> @@ -473,18 +473,18 @@ InitializeSdMmcDevice (
>      CmdArg = CreateSwitchCmdArgument (0, 0, 0);
>      Status = MmcHost->SendCommand (MmcHost, MMC_CMD6, CmdArg);
>      if (EFI_ERROR (Status)) {
> -      DEBUG ((DEBUG_ERROR, "%a (MMC_CMD6): Error and Status = %r\n",
> __FUNCTION__, Status));
> +      DEBUG ((DEBUG_ERROR, "%a (MMC_CMD6): Error and Status = %r\n",
> + __func__, Status));
>        return Status;
>      } else {
>        Status = MmcHost->ReadBlockData (MmcHost, 0,
> SWITCH_CMD_DATA_LENGTH, Buffer);
>        if (EFI_ERROR (Status)) {
> -        DEBUG ((DEBUG_ERROR, "%a (MMC_CMD6): ReadBlockData Error and
> Status = %r\n", __FUNCTION__, Status));
> +        DEBUG ((DEBUG_ERROR, "%a (MMC_CMD6): ReadBlockData Error and
> + Status = %r\n", __func__, Status));
>          return Status;
>        }
>      }
> 
>      if (!(Buffer[3] & SD_HIGH_SPEED_SUPPORTED)) {
> -      DEBUG ((DEBUG_INFO, "%a : High Speed not supported by Card\n",
> __FUNCTION__));
> +      DEBUG ((DEBUG_INFO, "%a : High Speed not supported by Card\n",
> + __func__));
>      } else {
>        Speed = SD_HIGH_SPEED;
> 
> @@ -492,12 +492,12 @@ InitializeSdMmcDevice (
>        CmdArg = CreateSwitchCmdArgument (1, 0, 1);
>        Status = MmcHost->SendCommand (MmcHost, MMC_CMD6, CmdArg);
>        if (EFI_ERROR (Status)) {
> -        DEBUG ((DEBUG_ERROR, "%a (MMC_CMD6): Error and Status = %r\n",
> __FUNCTION__, Status));
> +        DEBUG ((DEBUG_ERROR, "%a (MMC_CMD6): Error and Status = %r\n",
> + __func__, Status));
>          return Status;
>        } else {
>          Status = MmcHost->ReadBlockData (MmcHost, 0,
> SWITCH_CMD_DATA_LENGTH, Buffer);
>          if (EFI_ERROR (Status)) {
> -          DEBUG ((DEBUG_ERROR, "%a (MMC_CMD6): ReadBlockData Error and
> Status = %r\n", __FUNCTION__, Status));
> +          DEBUG ((DEBUG_ERROR, "%a (MMC_CMD6): ReadBlockData Error and
> + Status = %r\n", __func__, Status));
>            return Status;
>          }
> 
> @@ -513,14 +513,14 @@ InitializeSdMmcDevice (
>      CmdArg = MmcHostInstance->CardInfo.RCA << 16;
>      Status = MmcHost->SendCommand (MmcHost, MMC_CMD55, CmdArg);
>      if (EFI_ERROR (Status)) {
> -      DEBUG ((DEBUG_ERROR, "%a (MMC_CMD55): Error and Status = %r\n",
> __FUNCTION__, Status));
> +      DEBUG ((DEBUG_ERROR, "%a (MMC_CMD55): Error and Status = %r\n",
> + __func__, Status));
>        return Status;
>      }
> 
>      /* Width: 4 */
>      Status = MmcHost->SendCommand (MmcHost, MMC_CMD6, 2);
>      if (EFI_ERROR (Status)) {
> -      DEBUG ((DEBUG_ERROR, "%a (MMC_CMD6): Error and Status = %r\n",
> __FUNCTION__, Status));
> +      DEBUG ((DEBUG_ERROR, "%a (MMC_CMD6): Error and Status = %r\n",
> + __func__, Status));
>        return Status;
>      }
>    }
> @@ -528,7 +528,7 @@ InitializeSdMmcDevice (
>    if (MMC_HOST_HAS_SETIOS (MmcHost)) {
>      Status = MmcHost->SetIos (MmcHost, Speed, BUSWIDTH_4,
> EMMCBACKWARD);
>      if (EFI_ERROR (Status)) {
> -      DEBUG ((DEBUG_ERROR, "%a (SetIos): Error and Status = %r\n",
> __FUNCTION__, Status));
> +      DEBUG ((DEBUG_ERROR, "%a (SetIos): Error and Status = %r\n",
> + __func__, Status));
>        return Status;
>      }
>    }
> --
> 2.34.1

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [edk2-devel] [PATCH 00/18] Replace pre-standard macro __FUNCTION__ with C99 __func__ throughout edk2
  2023-04-06 22:23 [PATCH 00/18] Replace pre-standard macro __FUNCTION__ with C99 __func__ throughout edk2 Rebecca Cran
                   ` (17 preceding siblings ...)
  2023-04-06 22:23 ` [PATCH 18/18] FmpDevicePkg: " Rebecca Cran
@ 2023-04-07 10:09 ` Ard Biesheuvel
  2023-04-10 14:21 ` Rebecca Cran
  2023-04-11  9:15 ` Gerd Hoffmann
  20 siblings, 0 replies; 34+ messages in thread
From: Ard Biesheuvel @ 2023-04-07 10:09 UTC (permalink / raw)
  To: devel, rebecca
  Cc: Liming Gao, Michael D Kinney, Guomin Jiang, Wei6 Xu, Guo Dong,
	Ray Ni, Sean Rhodes, James Lu, Gua Guo, Andrew Fish, Hao A Wu,
	Maciej Rabeda, Siyuan Fu, Jiewen Yao, Jian J Wang, Xiaoyu Lu,
	Ard Biesheuvel, Sami Mujawar, Supreeth Venkatesh, Michael Kubacki,
	Nate DeSimone, Sean Brogan, Leif Lindholm, Abner Chang,
	Nickle Wang, Igor Kulchytskyy, Daniel Schaefer, Min Xu,
	Jordan Justen, Gerd Hoffmann, Peter Grehan, Erdem Aktas,
	James Bottomley, Tom Lendacky, Michael Roth, Sunil V L,
	Andrei Warkentin

On Fri, 7 Apr 2023 at 00:23, Rebecca Cran <rebecca@bsdio.com> wrote:
>
> Following on from commit b17a3a133b18fb41493fba7d86e9b5804ea6a8cf which
> updated MdePkg to be more C11 compliant by replacing the pre-standard
> __FUNCTION__ with __func__ which was introduced in C99, this patch
> series updates the remaining packages in edk2.
>
> The changes were generated by using "Replace in Files" in VS Code.
>
> GitHub branch: https://github.com/bcran/edk2/tree/c99func
> GitHub PR:     https://github.com/tianocore/edk2/pull/4247
>
> Rebecca Cran (18):
>   ArmPkg: Update code to be more C11 compliant by using __func__
>   ArmPlatformPkg: Update code to be more C11 compliant by using __func__
>   ArmVirtPkg: Update code to be more C11 compliant by using __func__
>   EmbeddedPkg: Update code to be more C11 compliant by using __func__
>   OvmfPkg: Update code to be more C11 compliant by using __func__
>   StandaloneMmPkg: Update code to be more C11 compliant by using

For the packages above

Reviewed-by: Ard Biesheuvel <ardb@kernel.org>

but feel free to apply it to the whole series.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 04/18] OvmfPkg: Update code to be more C11 compliant by using __func__
  2023-04-06 22:23 ` [PATCH 04/18] OvmfPkg: " Rebecca Cran
@ 2023-04-07 11:19   ` Sunil V L
  0 siblings, 0 replies; 34+ messages in thread
From: Sunil V L @ 2023-04-07 11:19 UTC (permalink / raw)
  To: Rebecca Cran
  Cc: devel, Liming Gao, Michael D Kinney, Guomin Jiang, Wei6 Xu,
	Guo Dong, Ray Ni, Sean Rhodes, James Lu, Gua Guo, Andrew Fish,
	Hao A Wu, Maciej Rabeda, Siyuan Fu, Jiewen Yao, Jian J Wang,
	Xiaoyu Lu, Ard Biesheuvel, Sami Mujawar, Supreeth Venkatesh,
	Michael Kubacki, Nate DeSimone, Sean Brogan, Leif Lindholm,
	Abner Chang, Nickle Wang, Igor Kulchytskyy, Daniel Schaefer,
	Min Xu, Jordan Justen, Gerd Hoffmann, Peter Grehan, Erdem Aktas,
	James Bottomley, Tom Lendacky, Michael Roth, Andrei Warkentin

On Thu, Apr 06, 2023 at 04:23:05PM -0600, Rebecca Cran wrote:
> __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
> OvmfPkg.
> 
> Visual Studio versions before VS 2015 don't support __func__ and so
> will fail to compile. A workaround is to define __func__ as
> __FUNCTION__ :
> 
>   #define __func__ __FUNCTION__
> 
> Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
> ---
For RiscVVirt:

Reviewed-by: Sunil V L <sunilvl@ventanamicro.com>

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 03/18] UefiCpuPkg: Update code to be more C11 compliant by using __func__
  2023-04-06 22:23 ` [PATCH 03/18] UefiCpuPkg: " Rebecca Cran
  2023-04-07  3:09   ` Ni, Ray
@ 2023-04-07 11:24   ` Sunil V L
  1 sibling, 0 replies; 34+ messages in thread
From: Sunil V L @ 2023-04-07 11:24 UTC (permalink / raw)
  To: Rebecca Cran
  Cc: devel, Liming Gao, Michael D Kinney, Guomin Jiang, Wei6 Xu,
	Guo Dong, Ray Ni, Sean Rhodes, James Lu, Gua Guo, Andrew Fish,
	Hao A Wu, Maciej Rabeda, Siyuan Fu, Jiewen Yao, Jian J Wang,
	Xiaoyu Lu, Ard Biesheuvel, Sami Mujawar, Supreeth Venkatesh,
	Michael Kubacki, Nate DeSimone, Sean Brogan, Leif Lindholm,
	Abner Chang, Nickle Wang, Igor Kulchytskyy, Daniel Schaefer,
	Min Xu, Jordan Justen, Gerd Hoffmann, Peter Grehan, Erdem Aktas,
	James Bottomley, Tom Lendacky, Michael Roth, Andrei Warkentin

On Thu, Apr 06, 2023 at 04:23:04PM -0600, Rebecca Cran wrote:
> __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
> UefiCpuPkg.
> 
> Visual Studio versions before VS 2015 don't support __func__ and so
> will fail to compile. A workaround is to define __func__ as
> __FUNCTION__ :
> 
>   #define __func__ __FUNCTION__
> 
> Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
> ---

Reviewed-by: Sunil V L <sunilvl@ventanamicro.com>

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [edk2-devel] [PATCH 01/18] ArmPkg: Update code to be more C11 compliant by using __func__
  2023-04-06 22:23 ` [PATCH 01/18] ArmPkg: Update code to be more C11 compliant by using __func__ Rebecca Cran
@ 2023-04-07 20:18   ` Michael D Kinney
  0 siblings, 0 replies; 34+ messages in thread
From: Michael D Kinney @ 2023-04-07 20:18 UTC (permalink / raw)
  To: devel@edk2.groups.io, rebecca@bsdio.com, Gao, Liming,
	Jiang, Guomin, Xu, Wei6, Dong, Guo, Ni, Ray, Rhodes, Sean,
	Lu, James, Guo, Gua, Andrew Fish, Wu, Hao A, Maciej Rabeda,
	Siyuan Fu, Yao, Jiewen, Wang, Jian J, Lu, Xiaoyu1, Ard Biesheuvel,
	Sami Mujawar, Supreeth Venkatesh, Michael Kubacki,
	Desimone, Nathaniel L, Sean Brogan
  Cc: Leif Lindholm, Abner Chang, Nickle Wang, Igor Kulchytskyy,
	Daniel Schaefer, Xu, Min M, Justen, Jordan L, Gerd Hoffmann,
	Peter Grehan, Aktas, Erdem, James Bottomley, Tom Lendacky,
	Michael Roth, Sunil V L, Warkentin, Andrei, Kinney, Michael D

Series Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>


> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Rebecca Cran
> Sent: Thursday, April 6, 2023 3:23 PM
> To: devel@edk2.groups.io; Gao, Liming <gaoliming@byosoft.com.cn>; Kinney, Michael D <michael.d.kinney@intel.com>; Jiang, Guomin
> <guomin.jiang@intel.com>; Xu, Wei6 <wei6.xu@intel.com>; Dong, Guo <guo.dong@intel.com>; Ni, Ray <ray.ni@intel.com>; Rhodes, Sean
> <sean@starlabs.systems>; Lu, James <james.lu@intel.com>; Guo, Gua <gua.guo@intel.com>; Andrew Fish <afish@apple.com>; Wu, Hao A
> <hao.a.wu@intel.com>; Maciej Rabeda <maciej.rabeda@linux.intel.com>; Siyuan Fu <siyuan.fu@intel.com>; Yao, Jiewen
> <jiewen.yao@intel.com>; Wang, Jian J <jian.j.wang@intel.com>; Lu, Xiaoyu1 <xiaoyu1.lu@intel.com>; Ard Biesheuvel
> <ardb+tianocore@kernel.org>; Sami Mujawar <sami.mujawar@arm.com>; Supreeth Venkatesh <supreeth.venkatesh@arm.com>; Michael
> Kubacki <mikuback@linux.microsoft.com>; Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>; Sean Brogan
> <sean.brogan@microsoft.com>
> Cc: Rebecca Cran <rebecca@bsdio.com>; Leif Lindholm <quic_llindhol@quicinc.com>; Abner Chang <abner.chang@amd.com>; Nickle Wang
> <nicklew@nvidia.com>; Igor Kulchytskyy <igork@ami.com>; Daniel Schaefer <git@danielschaefer.me>; Xu, Min M <min.m.xu@intel.com>;
> Justen, Jordan L <jordan.l.justen@intel.com>; Gerd Hoffmann <kraxel@redhat.com>; Peter Grehan <grehan@freebsd.org>; Aktas, Erdem
> <erdemaktas@google.com>; James Bottomley <jejb@linux.ibm.com>; Tom Lendacky <thomas.lendacky@amd.com>; Michael Roth
> <michael.roth@amd.com>; Sunil V L <sunilvl@ventanamicro.com>; Warkentin, Andrei <andrei.warkentin@intel.com>
> Subject: [edk2-devel] [PATCH 01/18] 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.
> 
> Visual Studio versions before VS 2015 don't support __func__ and so
> will fail to compile. A workaround is to define __func__ as
> __FUNCTION__ :
> 
>   #define __func__ __FUNCTION__
> 
> Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
> ---
>  ArmPkg/Drivers/ArmGic/ArmGicCommonDxe.c                                                 |  4 +--
>  ArmPkg/Drivers/CpuDxe/MemoryAttribute.c                                                 | 10 +++---
>  ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c                                        |  4 +--
>  ArmPkg/Library/ArmPsciResetSystemLib/ArmPsciResetSystemLib.c                            |  2 +-
>  ArmPkg/Library/LinuxBootBootManagerLib/LinuxBootBm.c                                    |  2 +-
>  ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c                                      | 32 ++++++++++----------
>  ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c                        |  2 +-
>  ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c                   |  2 +-
>  ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c           |  2 +-
>  ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c        |  2 +-
>  ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type03/MiscChassisManufacturerFunction.c          |  2 +-
>  ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type13/MiscNumberOfInstallableLanguagesFunction.c |  2 +-
>  ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type32/MiscBootInformationFunction.c              |  2 +-
>  13 files changed, 34 insertions(+), 34 deletions(-)
> 
> diff --git a/ArmPkg/Drivers/ArmGic/ArmGicCommonDxe.c b/ArmPkg/Drivers/ArmGic/ArmGicCommonDxe.c
> index cd12fcda27e9..d560c42fc9f3 100644
> --- a/ArmPkg/Drivers/ArmGic/ArmGicCommonDxe.c
> +++ b/ArmPkg/Drivers/ArmGic/ArmGicCommonDxe.c
> @@ -137,7 +137,7 @@ CpuArchEventProtocolNotify (
>      DEBUG ((
>        DEBUG_ERROR,
>        "%a: Cpu->RegisterInterruptHandler() - %r\n",
> -      __FUNCTION__,
> +      __func__,
>        Status
>        ));
>      return;
> @@ -153,7 +153,7 @@ CpuArchEventProtocolNotify (
>      DEBUG ((
>        DEBUG_ERROR,
>        "%a: Cpu->RegisterInterruptHandler() - %r\n",
> -      __FUNCTION__,
> +      __func__,
>        Status
>        ));
>    }
> diff --git a/ArmPkg/Drivers/CpuDxe/MemoryAttribute.c b/ArmPkg/Drivers/CpuDxe/MemoryAttribute.c
> index cbc8261a68b7..61ba8fbbae4e 100644
> --- a/ArmPkg/Drivers/CpuDxe/MemoryAttribute.c
> +++ b/ArmPkg/Drivers/CpuDxe/MemoryAttribute.c
> @@ -92,7 +92,7 @@ GetMemoryAttributes (
>    DEBUG ((
>      DEBUG_VERBOSE,
>      "%a: BaseAddress == 0x%lx, Length == 0x%lx\n",
> -    __FUNCTION__,
> +    __func__,
>      BaseAddress,
>      Length
>      ));
> @@ -113,7 +113,7 @@ GetMemoryAttributes (
>      DEBUG ((
>        DEBUG_VERBOSE,
>        "%a: RegionAddress == 0x%lx, RegionLength == 0x%lx, RegionAttributes == 0x%lx\n",
> -      __FUNCTION__,
> +      __func__,
>        (UINT64)RegionAddress,
>        (UINT64)RegionLength,
>        (UINT64)RegionAttributes
> @@ -130,7 +130,7 @@ GetMemoryAttributes (
>    DEBUG ((
>      DEBUG_VERBOSE,
>      "%a: Union == %lx, Intersection == %lx\n",
> -    __FUNCTION__,
> +    __func__,
>      (UINT64)Union,
>      (UINT64)Intersection
>      ));
> @@ -188,7 +188,7 @@ SetMemoryAttributes (
>    DEBUG ((
>      DEBUG_INFO,
>      "%a: BaseAddress == 0x%lx, Length == 0x%lx, Attributes == 0x%lx\n",
> -    __FUNCTION__,
> +    __func__,
>      (UINTN)BaseAddress,
>      (UINTN)Length,
>      (UINTN)Attributes
> @@ -272,7 +272,7 @@ ClearMemoryAttributes (
>    DEBUG ((
>      DEBUG_INFO,
>      "%a: BaseAddress == 0x%lx, Length == 0x%lx, Attributes == 0x%lx\n",
> -    __FUNCTION__,
> +    __func__,
>      (UINTN)BaseAddress,
>      (UINTN)Length,
>      (UINTN)Attributes
> diff --git a/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c b/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c
> index 7acfd2e89a92..7ed758fbbc69 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 7bcd34849507..02b0c27e4df3 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 5a44af5a755d..75998eabb1c6 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 2fb1a4aa4fb8..08998ffe4d17 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);
>      }
> diff --git a/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c
> b/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c
> index 3b12e26abf6e..905058850056 100644
> --- a/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c
> +++ b/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c
> @@ -741,7 +741,7 @@ AddSmbiosProcessorTypeTable (
>      DEBUG ((
>        DEBUG_ERROR,
>        "[%a]:[%dL] Smbios Type04 Table Log Failed! %r \n",
> -      __FUNCTION__,
> +      __func__,
>        DEBUG_LINE_NUMBER,
>        Status
>        ));
> diff --git a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c
> b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c
> index c9f25b750254..38f3864b160e 100644
> --- a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c
> +++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c
> @@ -287,7 +287,7 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscBiosVendor) {
>      DEBUG ((
>        DEBUG_ERROR,
>        "[%a]:[%dL] Smbios Type00 Table Log Failed! %r \n",
> -      __FUNCTION__,
> +      __func__,
>        DEBUG_LINE_NUMBER,
>        Status
>        ));
> diff --git a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c
> b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c
> index 22fb5eccaa63..8867de4815a2 100644
> --- a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c
> +++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c
> @@ -184,7 +184,7 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscSystemManufacturer) {
>      DEBUG ((
>        DEBUG_ERROR,
>        "[%a]:[%dL] Smbios Type01 Table Log Failed! %r \n",
> -      __FUNCTION__,
> +      __func__,
>        DEBUG_LINE_NUMBER,
>        Status
>        ));
> diff --git a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c
> b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c
> index 3441e7798860..feb42e6f5dee 100644
> --- a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c
> +++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c
> @@ -214,7 +214,7 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscBaseBoardManufacturer) {
>      DEBUG ((
>        DEBUG_ERROR,
>        "[%a]:[%dL] Smbios Type02 Table Log Failed! %r \n",
> -      __FUNCTION__,
> +      __func__,
>        DEBUG_LINE_NUMBER,
>        Status
>        ));
> diff --git a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type03/MiscChassisManufacturerFunction.c
> b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type03/MiscChassisManufacturerFunction.c
> index d161970c023e..6b3b63b0e8d5 100644
> --- a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type03/MiscChassisManufacturerFunction.c
> +++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type03/MiscChassisManufacturerFunction.c
> @@ -179,7 +179,7 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscChassisManufacturer) {
>      DEBUG ((
>        DEBUG_ERROR,
>        "[%a]:[%dL] Smbios Type03 Table Log Failed! %r \n",
> -      __FUNCTION__,
> +      __func__,
>        DEBUG_LINE_NUMBER,
>        Status
>        ));
> diff --git a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type13/MiscNumberOfInstallableLanguagesFunction.c
> b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type13/MiscNumberOfInstallableLanguagesFunction.c
> index 386b8800e29b..951ac2a905b6 100644
> --- a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type13/MiscNumberOfInstallableLanguagesFunction.c
> +++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type13/MiscNumberOfInstallableLanguagesFunction.c
> @@ -161,7 +161,7 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscNumberOfInstallableLanguages) {
>      DEBUG ((
>        DEBUG_ERROR,
>        "[%a]:[%dL] Smbios Type13 Table Log Failed! %r \n",
> -      __FUNCTION__,
> +      __func__,
>        DEBUG_LINE_NUMBER,
>        Status
>        ));
> diff --git a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type32/MiscBootInformationFunction.c
> b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type32/MiscBootInformationFunction.c
> index fdf6262aa7f5..fa1ea95f2bc3 100644
> --- a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type32/MiscBootInformationFunction.c
> +++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type32/MiscBootInformationFunction.c
> @@ -69,7 +69,7 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscBootInformation) {
>      DEBUG ((
>        DEBUG_ERROR,
>        "[%a]:[%dL] Smbios Type32 Table Log Failed! %r \n",
> -      __FUNCTION__,
> +      __func__,
>        DEBUG_LINE_NUMBER,
>        Status
>        ));
> --
> 2.34.1
> 
> 
> 
> 
> 


^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 18/18] FmpDevicePkg: Update code to be more C11 compliant by using __func__
  2023-04-06 22:23 ` [PATCH 18/18] FmpDevicePkg: " Rebecca Cran
@ 2023-04-10  1:05   ` Xu, Wei6
  0 siblings, 0 replies; 34+ messages in thread
From: Xu, Wei6 @ 2023-04-10  1:05 UTC (permalink / raw)
  To: Rebecca Cran, devel@edk2.groups.io, Gao, Liming,
	Kinney, Michael D, Jiang, Guomin, Dong, Guo, Ni, Ray,
	Rhodes, Sean, Lu, James, Guo, Gua, Andrew Fish, Wu, Hao A,
	Maciej Rabeda, Siyuan Fu, Yao, Jiewen, Wang, Jian J, Lu, Xiaoyu1,
	Ard Biesheuvel, Sami Mujawar, Supreeth Venkatesh, Michael Kubacki,
	Desimone, Nathaniel L, Sean Brogan
  Cc: Leif Lindholm, Abner Chang, Nickle Wang, Igor Kulchytskyy,
	Daniel Schaefer, Xu, Min M, Justen, Jordan L, Gerd Hoffmann,
	Peter Grehan, Aktas, Erdem, James Bottomley, Tom Lendacky,
	Michael Roth, Sunil V L, Warkentin, Andrei

Reviewed-by: Wei6 Xu <wei6.xu@intel.com>

Thanks,
Wei

-----Original Message-----
From: Rebecca Cran <rebecca@bsdio.com> 
Sent: Friday, April 7, 2023 6:23 AM
To: devel@edk2.groups.io; Gao, Liming <gaoliming@byosoft.com.cn>; Kinney, Michael D <michael.d.kinney@intel.com>; Jiang, Guomin <guomin.jiang@intel.com>; Xu, Wei6 <wei6.xu@intel.com>; Dong, Guo <guo.dong@intel.com>; Ni, Ray <ray.ni@intel.com>; Rhodes, Sean <sean@starlabs.systems>; Lu, James <james.lu@intel.com>; Guo, Gua <gua.guo@intel.com>; Andrew Fish <afish@apple.com>; Wu, Hao A <hao.a.wu@intel.com>; Maciej Rabeda <maciej.rabeda@linux.intel.com>; Siyuan Fu <siyuan.fu@intel.com>; Yao, Jiewen <jiewen.yao@intel.com>; Wang, Jian J <jian.j.wang@intel.com>; Lu, Xiaoyu1 <xiaoyu1.lu@intel.com>; Ard Biesheuvel <ardb+tianocore@kernel.org>; Sami Mujawar <sami.mujawar@arm.com>; Supreeth Venkatesh <supreeth.venkatesh@arm.com>; Michael Kubacki <mikuback@linux.microsoft.com>; Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>; Sean Brogan <sean.brogan@microsoft.com>
Cc: Rebecca Cran <rebecca@bsdio.com>; Leif Lindholm <quic_llindhol@quicinc.com>; Abner Chang <abner.chang@amd.com>; Nickle Wang <nicklew@nvidia.com>; Igor Kulchytskyy <igork@ami.com>; Daniel Schaefer <git@danielschaefer.me>; Xu, Min M <min.m.xu@intel.com>; Justen, Jordan L <jordan.l.justen@intel.com>; Gerd Hoffmann <kraxel@redhat.com>; Peter Grehan <grehan@freebsd.org>; Aktas, Erdem <erdemaktas@google.com>; James Bottomley <jejb@linux.ibm.com>; Tom Lendacky <thomas.lendacky@amd.com>; Michael Roth <michael.roth@amd.com>; Sunil V L <sunilvl@ventanamicro.com>; Warkentin, Andrei <andrei.warkentin@intel.com>
Subject: [PATCH 18/18] FmpDevicePkg: 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 FmpDevicePkg.

Visual Studio versions before VS 2015 don't support __func__ and so will fail to compile. A workaround is to define __func__ as __FUNCTION__ :

  #define __func__ __FUNCTION__

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
---
 FmpDevicePkg/FmpDxe/VariableSupport.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/FmpDevicePkg/FmpDxe/VariableSupport.c b/FmpDevicePkg/FmpDxe/VariableSupport.c
index 541e5e0f5fc7..5126c5e2d556 100644
--- a/FmpDevicePkg/FmpDxe/VariableSupport.c
+++ b/FmpDevicePkg/FmpDxe/VariableSupport.c
@@ -832,7 +832,7 @@ LockAllFmpVariables (
   // Locate the VariablePolicy protocol.
   Status = gBS->LocateProtocol (&gEdkiiVariablePolicyProtocolGuid, NULL, (VOID **)&VariablePolicy);
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "FmpDxe %a - Could not locate VariablePolicy protocol! %r\n", __FUNCTION__, Status));
+    DEBUG ((DEBUG_ERROR, "FmpDxe %a - Could not locate VariablePolicy 
+ protocol! %r\n", __func__, Status));
     return Status;
   }
 
--
2.34.1


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* Re: [PATCH 00/18] Replace pre-standard macro __FUNCTION__ with C99 __func__ throughout edk2
  2023-04-06 22:23 [PATCH 00/18] Replace pre-standard macro __FUNCTION__ with C99 __func__ throughout edk2 Rebecca Cran
                   ` (18 preceding siblings ...)
  2023-04-07 10:09 ` [edk2-devel] [PATCH 00/18] Replace pre-standard macro __FUNCTION__ with C99 __func__ throughout edk2 Ard Biesheuvel
@ 2023-04-10 14:21 ` Rebecca Cran
  2023-04-11  9:15 ` Gerd Hoffmann
  20 siblings, 0 replies; 34+ messages in thread
From: Rebecca Cran @ 2023-04-10 14:21 UTC (permalink / raw)
  To: devel, Liming Gao, Michael D Kinney, Guomin Jiang, Wei6 Xu,
	Guo Dong, Ray Ni, Sean Rhodes, James Lu, Gua Guo, Andrew Fish,
	Hao A Wu, Maciej Rabeda, Siyuan Fu, Jiewen Yao, Jian J Wang,
	Xiaoyu Lu, Ard Biesheuvel, Sami Mujawar, Supreeth Venkatesh,
	Michael Kubacki, Nate DeSimone, Sean Brogan
  Cc: Leif Lindholm, Abner Chang, Nickle Wang, Igor Kulchytskyy,
	Daniel Schaefer, Min Xu, Jordan Justen, Gerd Hoffmann,
	Peter Grehan, Erdem Aktas, James Bottomley, Tom Lendacky,
	Michael Roth, Sunil V L, Andrei Warkentin

Pushed as 
f2cc962cd28fe75fb4edf230d69e99c346fe9c8a..61652efd04a7585a779226137d0f9739a75aac69.


-- 

Rebecca Cran


On 4/6/23 4:23 PM, Rebecca Cran wrote:
> Following on from commit b17a3a133b18fb41493fba7d86e9b5804ea6a8cf which
> updated MdePkg to be more C11 compliant by replacing the pre-standard
> __FUNCTION__ with __func__ which was introduced in C99, this patch
> series updates the remaining packages in edk2.
>
> The changes were generated by using "Replace in Files" in VS Code.
>
> GitHub branch: https://github.com/bcran/edk2/tree/c99func
> GitHub PR:     https://github.com/tianocore/edk2/pull/4247
>
> Rebecca Cran (18):
>    ArmPkg: Update code to be more C11 compliant by using __func__
>    ArmVirtPkg: Update code to be more C11 compliant by using __func__
>    UefiCpuPkg: Update code to be more C11 compliant by using __func__
>    OvmfPkg: Update code to be more C11 compliant by using __func__
>    MdeModulePkg: Update code to be more C11 compliant by using __func__
>    SecurityPkg: Update code to be more C11 compliant by using __func__
>    EmbeddedPkg: Update code to be more C11 compliant by using __func__
>    RedfishPkg: Update code to be more C11 compliant by using __func__
>    ArmPlatformPkg: Update code to be more C11 compliant by using __func__
>    UnitTestFrameworkPkg: Update to be more C11 compliant by using
>      __func__
>    PrmPkg: Update code to be more C11 compliant by using __func__
>    StandaloneMmPkg: Update code to be more C11 compliant by using
>      __func__
>    CryptoPkg: Update code to be more C11 compliant by using __func__
>    NetworkPkg: Update code to be more C11 compliant by using __func__
>    SourceLevelDebugPkg: Update code to be more C11 compliant by using
>      __func__
>    EmulatorPkg: Update code to be more C11 compliant by using __func__
>    UefiPayloadPkg: Update code to be more C11 compliant by using __func__
>    FmpDevicePkg: Update code to be more C11 compliant by using __func__
>
>   ArmPkg/Drivers/ArmGic/ArmGicCommonDxe.c                                                                      |  4 +-
>   ArmPkg/Drivers/CpuDxe/MemoryAttribute.c                                                                      | 10 +--
>   ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c                                                             |  4 +-
>   ArmPkg/Library/ArmPsciResetSystemLib/ArmPsciResetSystemLib.c                                                 |  2 +-
>   ArmPkg/Library/LinuxBootBootManagerLib/LinuxBootBm.c                                                         |  2 +-
>   ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c                                                           | 32 +++++-----
>   ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c                                             |  2 +-
>   ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c                                        |  2 +-
>   ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c                                |  2 +-
>   ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c                             |  2 +-
>   ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type03/MiscChassisManufacturerFunction.c                               |  2 +-
>   ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type13/MiscNumberOfInstallableLanguagesFunction.c                      |  2 +-
>   ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type32/MiscBootInformationFunction.c                                   |  2 +-
>   ArmPlatformPkg/Drivers/SP805WatchdogDxe/SP805Watchdog.c                                                      |  4 +-
>   ArmVirtPkg/CloudHvAcpiPlatformDxe/CloudHvAcpi.c                                                              |  4 +-
>   ArmVirtPkg/Library/ArmVirtGicArchLib/ArmVirtGicArchLib.c                                                     |  2 +-
>   ArmVirtPkg/Library/ArmVirtPL031FdtClientLib/ArmVirtPL031FdtClientLib.c                                       |  4 +-
>   ArmVirtPkg/Library/ArmVirtPsciResetSystemLib/ArmVirtPsciResetSystemLib.c                                     |  6 +-
>   ArmVirtPkg/Library/ArmVirtPsciResetSystemPeiLib/ArmVirtPsciResetSystemPeiLib.c                               |  6 +-
>   ArmVirtPkg/Library/CloudHvVirtMemInfoLib/CloudHvVirtMemInfoLib.c                                             | 10 +--
>   ArmVirtPkg/Library/KvmtoolRtcFdtClientLib/KvmtoolRtcFdtClientLib.c                                           |  4 +-
>   ArmVirtPkg/Library/KvmtoolVirtMemInfoLib/KvmtoolVirtMemInfoLib.c                                             |  2 +-
>   ArmVirtPkg/Library/NorFlashKvmtoolLib/NorFlashKvmtool.c                                                      |  4 +-
>   ArmVirtPkg/Library/NorFlashQemuLib/NorFlashQemuLib.c                                                         |  2 +-
>   ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c                                                       | 20 +++---
>   ArmVirtPkg/Library/PlatformBootManagerLib/QemuKernel.c                                                       |  2 +-
>   ArmVirtPkg/Library/PlatformPeiLib/PlatformPeiLib.c                                                           |  6 +-
>   ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoLib.c                                                   |  4 +-
>   ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoPeiLibConstructor.c                                     |  4 +-
>   ArmVirtPkg/XenAcpiPlatformDxe/XenAcpiPlatformDxe.c                                                           |  4 +-
>   ArmVirtPkg/XenioFdtDxe/XenioFdtDxe.c                                                                         |  4 +-
>   CryptoPkg/Library/TlsLib/TlsConfig.c                                                                         |  8 +--
>   CryptoPkg/Library/TlsLib/TlsProcess.c                                                                        |  4 +-
>   EmbeddedPkg/Drivers/ConsolePrefDxe/ConsolePrefDxe.c                                                          | 18 +++---
>   EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.c                                                            | 10 +--
>   EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.c                                                              | 22 +++----
>   EmbeddedPkg/Library/NonCoherentDmaLib/NonCoherentDmaLib.c                                                    |  2 +-
>   EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClock.c                                                          |  2 +-
>   EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c                                                             | 20 +++---
>   EmulatorPkg/Library/RedfishPlatformHostInterfaceLib/RedfishPlatformHostInterfaceLib.c                        |  2 +-
>   EmulatorPkg/Win/Host/WinPacketFilter.c                                                                       |  2 +-
>   FmpDevicePkg/FmpDxe/VariableSupport.c                                                                        |  2 +-
>   MdeModulePkg/Bus/Ata/AhciPei/AhciMode.c                                                                      | 38 ++++++------
>   MdeModulePkg/Bus/Ata/AhciPei/AhciPei.c                                                                       | 18 +++---
>   MdeModulePkg/Bus/Ata/AhciPei/AhciPeiBlockIo.c                                                                |  2 +-
>   MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c                                                                          |  2 +-
>   MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.c                                                                     |  4 +-
>   MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceIo.c                                |  2 +-
>   MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressBlockIo.c                                                       |  8 +--
>   MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPei.c                                                           | 36 +++++------
>   MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPeiBlockIo.c                                                    |  6 +-
>   MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPeiHci.c                                                        | 34 +++++------
>   MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPeiPassThru.c                                                   | 24 ++++----
>   MdeModulePkg/Bus/Pci/PciBusDxe/PciCommand.c                                                                  |  2 +-
>   MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridge.c                                                        | 14 ++---
>   MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c                                                           |  6 +-
>   MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c                                                             | 12 ++--
>   MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c                                                                          |  2 +-
>   MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c                                                                     |  4 +-
>   MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c                                                                 |  6 +-
>   MdeModulePkg/Core/Dxe/Dispatcher/Dispatcher.c                                                                |  2 +-
>   MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c                                                                      |  2 +-
>   MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c                                                                |  6 +-
>   MdeModulePkg/Core/Dxe/SectionExtraction/CoreSectionExtraction.c                                              |  2 +-
>   MdeModulePkg/Core/DxeIplPeim/Ia32/DxeLoadFunc.c                                                              |  4 +-
>   MdeModulePkg/Core/DxeIplPeim/RiscV64/DxeLoadFunc.c                                                           |  4 +-
>   MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c                                                                |  2 +-
>   MdeModulePkg/Core/Pei/FwVol/FwVol.c                                                                          |  2 +-
>   MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleReportLib.c                                                  |  2 +-
>   MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c                                                   |  2 +-
>   MdeModulePkg/Library/ResetUtilityLib/ResetUtility.c                                                          |  2 +-
>   MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c                                                             |  2 +-
>   MdeModulePkg/Library/UefiBootManagerLib/BmDriverHealth.c                                                     |  2 +-
>   MdeModulePkg/Library/VarCheckPolicyLib/VarCheckPolicyLib.c                                                   | 22 +++----
>   MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLib.c                                                   |  6 +-
>   MdeModulePkg/Universal/CapsulePei/UefiCapsule.c                                                              |  8 +--
>   MdeModulePkg/Universal/CapsulePei/X64/X64Entry.c                                                             |  2 +-
>   MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c                                                               | 10 +--
>   MdeModulePkg/Universal/Disk/UdfDxe/File.c                                                                    |  2 +-
>   MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c                                                    |  2 +-
>   MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWrite.c                                            |  6 +-
>   MdeModulePkg/Universal/FaultTolerantWriteDxe/FtwMisc.c                                                       |  2 +-
>   MdeModulePkg/Universal/PCD/Dxe/Service.c                                                                     |  2 +-
>   MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.c                                                                 |  4 +-
>   MdeModulePkg/Universal/Variable/RuntimeDxe/TcgMorLockDxe.c                                                   |  6 +-
>   MdeModulePkg/Universal/Variable/RuntimeDxe/TcgMorLockSmm.c                                                   |  6 +-
>   MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c                                                        |  6 +-
>   MdeModulePkg/Universal/Variable/RuntimeDxe/VariableLockRequestToLock.c                                       |  4 +-
>   MdeModulePkg/Universal/Variable/RuntimeDxe/VariablePolicySmmDxe.c                                            | 20 +++---
>   NetworkPkg/HttpDxe/HttpsSupport.c                                                                            | 16 ++---
>   NetworkPkg/IScsiDxe/IScsiMisc.c                                                                              |  4 +-
>   OvmfPkg/AcpiPlatformDxe/BootScript.c                                                                         |  4 +-
>   OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c                                                                        |  4 +-
>   OvmfPkg/AcpiPlatformDxe/EntryPoint.c                                                                         |  8 +--
>   OvmfPkg/AcpiPlatformDxe/PciDecoding.c                                                                        | 10 +--
>   OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c                                                                      | 64 ++++++++++----------
>   OvmfPkg/AmdSev/BlobVerifierLibSevHashes/BlobVerifierSevHashes.c                                              | 18 +++---
>   OvmfPkg/AmdSevDxe/AmdSevDxe.c                                                                                |  2 +-
>   OvmfPkg/Bhyve/AcpiPlatformDxe/EntryPoint.c                                                                   |  8 +--
>   OvmfPkg/Bhyve/AcpiPlatformDxe/PciDecoding.c                                                                  | 10 +--
>   OvmfPkg/Bhyve/BhyveRfbDxe/VbeShim.c                                                                          |  6 +-
>   OvmfPkg/Bhyve/PlatformPei/ClearCache.c                                                                       |  6 +-
>   OvmfPkg/Bhyve/PlatformPei/MemDetect.c                                                                        | 12 ++--
>   OvmfPkg/Bhyve/PlatformPei/Platform.c                                                                         | 10 +--
>   OvmfPkg/CpuHotplugSmm/CpuHotplug.c                                                                           | 40 ++++++------
>   OvmfPkg/CpuHotplugSmm/QemuCpuhp.c                                                                            | 32 +++++-----
>   OvmfPkg/CpuHotplugSmm/Smbase.c                                                                               | 10 +--
>   OvmfPkg/CpuS3DataDxe/CpuS3Data.c                                                                             |  2 +-
>   OvmfPkg/Csm/CsmSupportLib/LegacyInterrupt.c                                                                  |  2 +-
>   OvmfPkg/Csm/CsmSupportLib/LegacyRegion.c                                                                     |  2 +-
>   OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.c                                                                |  2 +-
>   OvmfPkg/Fdt/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c                                                        | 28 ++++-----
>   OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.c                                                      |  4 +-
>   OvmfPkg/Fdt/HighMemDxe/HighMemDxe.c                                                                          | 10 +--
>   OvmfPkg/Fdt/VirtioFdtDxe/VirtioFdtDxe.c                                                                      | 10 +--
>   OvmfPkg/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.c                                       |  2 +-
>   OvmfPkg/IoMmuDxe/CcIoMmu.c                                                                                   | 18 +++---
>   OvmfPkg/IoMmuDxe/IoMmuBuffer.c                                                                               |  8 +--
>   OvmfPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.c                                                              |  2 +-
>   OvmfPkg/Library/AcpiTimerLib/BaseRomAcpiTimerLib.c                                                           |  4 +-
>   OvmfPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.c                                                               |  2 +-
>   OvmfPkg/Library/BaseMemEncryptSevLib/X64/PeiDxeVirtualMemory.c                                               | 22 +++----
>   OvmfPkg/Library/BaseMemEncryptSevLib/X64/SnpPageStateChangeInternal.c                                        |  4 +-
>   OvmfPkg/Library/BaseMemEncryptTdxLib/MemoryEncryption.c                                                      | 26 ++++----
>   OvmfPkg/Library/BasePciCapLib/BasePciCapLib.c                                                                |  4 +-
>   OvmfPkg/Library/CcExitLib/CcExitVeHandler.c                                                                  | 18 +++---
>   OvmfPkg/Library/GenericQemuLoadImageLib/GenericQemuLoadImageLib.c                                            |  6 +-
>   OvmfPkg/Library/HardwareInfoLib/HardwareInfoDxe.c                                                            |  2 +-
>   OvmfPkg/Library/LockBoxLib/LockBoxLib.c                                                                      | 10 +--
>   OvmfPkg/Library/PciHostBridgeUtilityLib/PciHostBridgeUtilityLib.c                                            | 22 +++----
>   OvmfPkg/Library/PeilessStartupLib/X64/VirtualMemory.c                                                        |  2 +-
>   OvmfPkg/Library/PlatformBmPrintScLib/StatusCodeHandler.c                                                     | 12 ++--
>   OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c                                                         | 12 ++--
>   OvmfPkg/Library/PlatformBootManagerLib/QemuKernel.c                                                          |  2 +-
>   OvmfPkg/Library/PlatformBootManagerLibBhyve/BdsPlatform.c                                                    | 10 +--
>   OvmfPkg/Library/PlatformBootManagerLibGrub/BdsPlatform.c                                                     | 10 +--
>   OvmfPkg/Library/PlatformBootManagerLibGrub/QemuKernel.c                                                      |  2 +-
>   OvmfPkg/Library/PlatformInitLib/MemDetect.c                                                                  | 28 ++++-----
>   OvmfPkg/Library/PlatformInitLib/Platform.c                                                                   | 20 +++---
>   OvmfPkg/Library/QemuBootOrderLib/ExtraRootBusMap.c                                                           |  2 +-
>   OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.c                                                          | 42 ++++++-------
>   OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgDxe.c                                                                  | 18 +++---
>   OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMmio.c                                                              |  2 +-
>   OvmfPkg/Library/QemuFwCfgS3Lib/QemuFwCfgS3Dxe.c                                                              | 34 +++++------
>   OvmfPkg/Library/ResetSystemLib/DxeResetSystemLibMicrovm.c                                                    |  8 +--
>   OvmfPkg/Library/ResetSystemLib/ResetSystemLibMicrovm.c                                                       |  8 +--
>   OvmfPkg/Library/SerializeVariablesLib/SerializeVariablesLib.c                                                |  4 +-
>   OvmfPkg/Library/SmbiosVersionLib/DetectSmbiosVersionLib.c                                                    |  4 +-
>   OvmfPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c                                                        |  4 +-
>   OvmfPkg/Library/TlsAuthConfigLib/TlsAuthConfigLib.c                                                          | 24 ++++----
>   OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDevice.c                                                       |  4 +-
>   OvmfPkg/Library/X86QemuLoadImageLib/X86QemuLoadImageLib.c                                                    |  8 +--
>   OvmfPkg/Library/XenIoMmioLib/XenIoMmioLib.c                                                                  |  4 +-
>   OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.c                                      |  2 +-
>   OvmfPkg/LsiScsiDxe/LsiScsi.c                                                                                 |  4 +-
>   OvmfPkg/MptScsiDxe/MptScsi.c                                                                                 | 10 +--
>   OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.c                                                                   |  6 +-
>   OvmfPkg/PlatformDxe/Platform.c                                                                               | 14 ++---
>   OvmfPkg/PlatformPei/ClearCache.c                                                                             |  6 +-
>   OvmfPkg/PlatformPei/FeatureControl.c                                                                         |  6 +-
>   OvmfPkg/PlatformPei/MemDetect.c                                                                              | 12 ++--
>   OvmfPkg/PlatformPei/MemTypeInfo.c                                                                            | 10 +--
>   OvmfPkg/PlatformPei/Platform.c                                                                               | 18 +++---
>   OvmfPkg/PvScsiDxe/PvScsi.c                                                                                   |  4 +-
>   OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c                                                        | 12 ++--
>   OvmfPkg/QemuRamfbDxe/QemuRamfb.c                                                                             |  2 +-
>   OvmfPkg/QemuVideoDxe/Gop.c                                                                                   |  2 +-
>   OvmfPkg/QemuVideoDxe/Initialize.c                                                                            | 14 ++---
>   OvmfPkg/QemuVideoDxe/VbeShim.c                                                                               | 12 ++--
>   OvmfPkg/RiscVVirt/Library/PlatformBootManagerLib/PlatformBm.c                                                | 20 +++---
>   OvmfPkg/RiscVVirt/Library/PlatformBootManagerLib/QemuKernel.c                                                |  2 +-
>   OvmfPkg/RiscVVirt/Library/PrePiHobListPointerLib/PrePiHobListPointer.c                                       |  4 +-
>   OvmfPkg/RiscVVirt/Sec/Memory.c                                                                               | 10 +--
>   OvmfPkg/RiscVVirt/Sec/Platform.c                                                                             | 12 ++--
>   OvmfPkg/RiscVVirt/Sec/SecMain.c                                                                              |  2 +-
>   OvmfPkg/Sec/SecMain.c                                                                                        |  2 +-
>   OvmfPkg/SmmAccess/SmmAccessPei.c                                                                             |  6 +-
>   OvmfPkg/SmmControl2Dxe/SmiFeatures.c                                                                         | 22 +++----
>   OvmfPkg/SmmControl2Dxe/SmmControl2Dxe.c                                                                      | 18 +++---
>   OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPeim.c                                                                      |  8 +--
>   OvmfPkg/Tcg/TpmMmioSevDecryptPei/TpmMmioSevDecryptPeim.c                                                     |  6 +-
>   OvmfPkg/TdxDxe/TdxAcpiTable.c                                                                                |  2 +-
>   OvmfPkg/VirtNorFlashDxe/VirtNorFlashDxe.c                                                                    |  4 +-
>   OvmfPkg/VirtNorFlashDxe/VirtNorFlashFvb.c                                                                    | 22 +++----
>   OvmfPkg/VirtioBlkDxe/VirtioBlk.c                                                                             |  8 +--
>   OvmfPkg/VirtioFsDxe/FuseFlush.c                                                                              |  2 +-
>   OvmfPkg/VirtioFsDxe/FuseFsync.c                                                                              |  2 +-
>   OvmfPkg/VirtioFsDxe/FuseGetAttr.c                                                                            |  2 +-
>   OvmfPkg/VirtioFsDxe/FuseInit.c                                                                               |  2 +-
>   OvmfPkg/VirtioFsDxe/FuseLookup.c                                                                             |  2 +-
>   OvmfPkg/VirtioFsDxe/FuseMkDir.c                                                                              |  2 +-
>   OvmfPkg/VirtioFsDxe/FuseOpen.c                                                                               |  2 +-
>   OvmfPkg/VirtioFsDxe/FuseOpenDir.c                                                                            |  2 +-
>   OvmfPkg/VirtioFsDxe/FuseOpenOrCreate.c                                                                       |  2 +-
>   OvmfPkg/VirtioFsDxe/FuseRead.c                                                                               |  2 +-
>   OvmfPkg/VirtioFsDxe/FuseRelease.c                                                                            |  2 +-
>   OvmfPkg/VirtioFsDxe/FuseRename.c                                                                             |  2 +-
>   OvmfPkg/VirtioFsDxe/FuseSetAttr.c                                                                            |  2 +-
>   OvmfPkg/VirtioFsDxe/FuseStatFs.c                                                                             |  2 +-
>   OvmfPkg/VirtioFsDxe/FuseUnlink.c                                                                             |  2 +-
>   OvmfPkg/VirtioFsDxe/FuseWrite.c                                                                              |  2 +-
>   OvmfPkg/VirtioFsDxe/Helpers.c                                                                                |  2 +-
>   OvmfPkg/VirtioFsDxe/SimpleFsOpen.c                                                                           |  4 +-
>   OvmfPkg/VirtioGpuDxe/Commands.c                                                                              |  6 +-
>   OvmfPkg/VirtioGpuDxe/DriverBinding.c                                                                         |  8 +--
>   OvmfPkg/VirtioGpuDxe/Gop.c                                                                                   |  2 +-
>   OvmfPkg/VirtioNetDxe/Events.c                                                                                |  2 +-
>   OvmfPkg/VirtioRngDxe/VirtioRng.c                                                                             |  2 +-
>   OvmfPkg/VirtioScsiDxe/VirtioScsi.c                                                                           |  2 +-
>   OvmfPkg/XenAcpiPlatformDxe/Xen.c                                                                             |  2 +-
>   OvmfPkg/XenPlatformPei/ClearCache.c                                                                          |  6 +-
>   OvmfPkg/XenPlatformPei/MemDetect.c                                                                           |  6 +-
>   OvmfPkg/XenPlatformPei/Platform.c                                                                            |  2 +-
>   OvmfPkg/XenPvBlkDxe/BlockFront.c                                                                             |  4 +-
>   PrmPkg/Application/PrmInfo/PrmInfo.c                                                                         |  6 +-
>   PrmPkg/Library/DxePrmContextBufferLib/DxePrmContextBufferLib.c                                               | 10 +--
>   PrmPkg/Library/DxePrmContextBufferLib/UnitTest/DxePrmContextBufferLibUnitTest.c                              |  2 +-
>   PrmPkg/Library/DxePrmModuleDiscoveryLib/DxePrmModuleDiscoveryLib.c                                           | 14 ++---
>   PrmPkg/Library/DxePrmPeCoffLib/DxePrmPeCoffLib.c                                                             | 40 ++++++------
>   PrmPkg/PrmConfigDxe/PrmConfigDxe.c                                                                           | 44 +++++++-------
>   PrmPkg/PrmLoaderDxe/PrmLoaderDxe.c                                                                           | 22 +++----
>   PrmPkg/PrmSsdtInstallDxe/PrmSsdtInstallDxe.c                                                                 |  4 +-
>   RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfaceBmcUsbNicLib.c                     | 36 +++++------
>   RedfishPkg/Library/RedfishPlatformCredentialIpmiLib/RedfishPlatformCredentialIpmiLib.c                       | 28 ++++-----
>   RedfishPkg/PrivateLibrary/RedfishLib/RedfishLib.c                                                            |  2 +-
>   RedfishPkg/PrivateLibrary/RedfishLib/edk2libredfish/src/service.c                                            |  4 +-
>   RedfishPkg/RedfishConfigHandler/RedfishConfigHandlerCommon.c                                                 |  6 +-
>   RedfishPkg/RedfishConfigHandler/RedfishConfigHandlerDriver.c                                                 | 20 +++---
>   RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c                                                           | 62 +++++++++----------
>   RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.c                                                 | 14 ++---
>   RedfishPkg/RedfishRestExDxe/RedfishRestExImpl.c                                                              | 14 ++---
>   SecurityPkg/HddPassword/HddPasswordDxe.c                                                                     | 44 +++++++-------
>   SecurityPkg/HddPassword/HddPasswordPei.c                                                                     | 10 +--
>   SecurityPkg/Library/AuthVariableLib/AuthService.c                                                            |  4 +-
>   SecurityPkg/Library/PeiDxeTpmPlatformHierarchyLib/PeiDxeTpmPlatformHierarchyLib.c                            |  6 +-
>   SecurityPkg/Library/PlatformPKProtectionLibVarPolicy/PlatformPKProtectionLibVarPolicy.c                      |  2 +-
>   SecurityPkg/Library/SecureBootVariableLib/SecureBootVariableLib.c                                            | 38 ++++++------
>   SecurityPkg/Library/SecureBootVariableLib/UnitTest/SecureBootVariableLibUnitTest.c                           |  4 +-
>   SecurityPkg/Library/SecureBootVariableProvisionLib/SecureBootVariableProvisionLib.c                          |  2 +-
>   SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c                                                               | 24 ++++----
>   SecurityPkg/Tcg/Opal/OpalPassword/OpalHii.c                                                                  |  8 +--
>   SecurityPkg/Tcg/Opal/OpalPassword/OpalPasswordPei.c                                                          | 10 +--
>   SecurityPkg/Tcg/Tcg2Acpi/Tcg2Acpi.c                                                                          | 12 ++--
>   SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c                                                                            | 10 +--
>   SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c                                                                            | 22 +++----
>   SecurityPkg/Tcg/TdTcg2Dxe/TdTcg2Dxe.c                                                                        |  6 +-
>   SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.c                                 |  2 +-
>   SecurityPkg/VariableAuthenticated/SecureBootDefaultKeysDxe/SecureBootDefaultKeysDxe.c                        | 14 ++---
>   SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCommunicationLibUsb3Dxe.c                         |  4 +-
>   SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCommunicationLibUsb3Pei.c                         |  2 +-
>   StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/SetPermissions.c                                      | 22 +++----
>   StandaloneMmPkg/Library/StandaloneMmMemLib/X86StandaloneMmMemLibInternal.c                                   |  2 +-
>   StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/AArch64/StandaloneMmPeCoffExtraActionLib.c          | 16 ++---
>   UefiCpuPkg/CpuDxe/CpuDxe.c                                                                                   |  8 +--
>   UefiCpuPkg/CpuDxeRiscV64/CpuDxe.c                                                                            |  6 +-
>   UefiCpuPkg/CpuS3DataDxe/CpuS3Data.c                                                                          |  2 +-
>   UefiCpuPkg/Library/BaseRiscV64CpuExceptionHandlerLib/CpuExceptionHandlerLib.c                                |  2 +-
>   UefiCpuPkg/Library/CpuExceptionHandlerLib/UnitTest/CpuExceptionHandlerTestCommon.c                           |  2 +-
>   UefiCpuPkg/Library/MpInitLib/DxeMpLib.c                                                                      |  2 +-
>   UefiCpuPkg/Library/MpInitLib/Microcode.c                                                                     |  8 +--
>   UefiCpuPkg/Library/MpInitLib/MpLib.c                                                                         |  2 +-
>   UefiCpuPkg/Library/MpInitLib/PeiMpLib.c                                                                      |  2 +-
>   UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c                                                                            |  2 +-
>   UefiCpuPkg/SecCore/SecMain.c                                                                                 | 10 +--
>   UefiCpuPkg/Test/UnitTest/EfiMpServicesPpiProtocol/EfiMpServicesUnitTestCommom.c                              | 16 ++---
>   UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c                                                            |  2 +-
>   UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c                                                   |  4 +-
>   UefiPayloadPkg/UefiPayloadEntry/Ia32/DxeLoadFunc.c                                                           |  2 +-
>   UnitTestFrameworkPkg/Library/UnitTestBootLibUsbClass/UnitTestBootLibUsbClass.c                               | 12 ++--
>   UnitTestFrameworkPkg/Library/UnitTestLib/Log.c                                                               |  2 +-
>   UnitTestFrameworkPkg/Library/UnitTestLib/UnitTestLib.c                                                       |  4 +-
>   UnitTestFrameworkPkg/Library/UnitTestPersistenceLibSimpleFileSystem/UnitTestPersistenceLibSimpleFileSystem.c | 26 ++++----
>   UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultReportLib.c                               |  2 +-
>   UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultReportLibConOut.c                         |  2 +-
>   UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultReportLibDebugLib.c                       |  2 +-
>   275 files changed, 1213 insertions(+), 1213 deletions(-)
>

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 00/18] Replace pre-standard macro __FUNCTION__ with C99 __func__ throughout edk2
  2023-04-06 22:23 [PATCH 00/18] Replace pre-standard macro __FUNCTION__ with C99 __func__ throughout edk2 Rebecca Cran
                   ` (19 preceding siblings ...)
  2023-04-10 14:21 ` Rebecca Cran
@ 2023-04-11  9:15 ` Gerd Hoffmann
  20 siblings, 0 replies; 34+ messages in thread
From: Gerd Hoffmann @ 2023-04-11  9:15 UTC (permalink / raw)
  To: Rebecca Cran
  Cc: devel, Liming Gao, Michael D Kinney, Guomin Jiang, Wei6 Xu,
	Guo Dong, Ray Ni, Sean Rhodes, James Lu, Gua Guo, Andrew Fish,
	Hao A Wu, Maciej Rabeda, Siyuan Fu, Jiewen Yao, Jian J Wang,
	Xiaoyu Lu, Ard Biesheuvel, Sami Mujawar, Supreeth Venkatesh,
	Michael Kubacki, Nate DeSimone, Sean Brogan, Leif Lindholm,
	Abner Chang, Nickle Wang, Igor Kulchytskyy, Daniel Schaefer,
	Min Xu, Jordan Justen, Peter Grehan, Erdem Aktas, James Bottomley,
	Tom Lendacky, Michael Roth, Sunil V L, Andrei Warkentin

On Thu, Apr 06, 2023 at 04:23:01PM -0600, Rebecca Cran wrote:
> Following on from commit b17a3a133b18fb41493fba7d86e9b5804ea6a8cf which
> updated MdePkg to be more C11 compliant by replacing the pre-standard
> __FUNCTION__ with __func__ which was introduced in C99, this patch
> series updates the remaining packages in edk2.
> 
> The changes were generated by using "Replace in Files" in VS Code.

Acked-by: Gerd Hoffmann <kraxel@redhat.com>


^ permalink raw reply	[flat|nested] 34+ messages in thread

end of thread, other threads:[~2023-04-11  9:16 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-06 22:23 [PATCH 00/18] Replace pre-standard macro __FUNCTION__ with C99 __func__ throughout edk2 Rebecca Cran
2023-04-06 22:23 ` [PATCH 01/18] ArmPkg: Update code to be more C11 compliant by using __func__ Rebecca Cran
2023-04-07 20:18   ` [edk2-devel] " Michael D Kinney
2023-04-06 22:23 ` [PATCH 02/18] ArmVirtPkg: " Rebecca Cran
2023-04-06 22:23 ` [PATCH 03/18] UefiCpuPkg: " Rebecca Cran
2023-04-07  3:09   ` Ni, Ray
2023-04-07 11:24   ` Sunil V L
2023-04-06 22:23 ` [PATCH 04/18] OvmfPkg: " Rebecca Cran
2023-04-07 11:19   ` Sunil V L
2023-04-06 22:23 ` [PATCH 05/18] MdeModulePkg: " Rebecca Cran
2023-04-06 22:23 ` [PATCH 06/18] SecurityPkg: " Rebecca Cran
2023-04-06 22:23 ` [PATCH 07/18] EmbeddedPkg: " Rebecca Cran
2023-04-07  8:25   ` Chang, Abner
2023-04-06 22:23 ` [PATCH 08/18] RedfishPkg: " Rebecca Cran
2023-04-07  5:39   ` Nickle Wang
2023-04-06 22:23 ` [PATCH 09/18] ArmPlatformPkg: " Rebecca Cran
2023-04-06 22:23 ` [PATCH 10/18] UnitTestFrameworkPkg: Update " Rebecca Cran
2023-04-06 22:23 ` [PATCH 11/18] PrmPkg: Update code " Rebecca Cran
2023-04-06 22:23 ` [PATCH 12/18] StandaloneMmPkg: " Rebecca Cran
2023-04-06 22:23 ` [PATCH 13/18] CryptoPkg: " Rebecca Cran
2023-04-06 22:23 ` [PATCH 14/18] NetworkPkg: " Rebecca Cran
2023-04-06 22:23 ` [PATCH 15/18] SourceLevelDebugPkg: " Rebecca Cran
2023-04-07  3:08   ` Ni, Ray
2023-04-06 22:23 ` [PATCH 16/18] EmulatorPkg: " Rebecca Cran
2023-04-07  3:08   ` Ni, Ray
2023-04-07  8:23   ` Chang, Abner
2023-04-06 22:23 ` [PATCH 17/18] UefiPayloadPkg: " Rebecca Cran
2023-04-07  5:57   ` Guo, Gua
2023-04-07  7:55   ` Lu, James
2023-04-06 22:23 ` [PATCH 18/18] FmpDevicePkg: " Rebecca Cran
2023-04-10  1:05   ` Xu, Wei6
2023-04-07 10:09 ` [edk2-devel] [PATCH 00/18] Replace pre-standard macro __FUNCTION__ with C99 __func__ throughout edk2 Ard Biesheuvel
2023-04-10 14:21 ` Rebecca Cran
2023-04-11  9:15 ` Gerd Hoffmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox