From 8ba392687b6f7fcb6e333756edd090003c57402e Mon Sep 17 00:00:00 2001 From: Rebecca Cran Date: Thu, 6 Apr 2023 13:49:41 -0600 Subject: OvmfPkg: 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 OvmfPkg. Signed-off-by: Rebecca Cran Reviewed-by: Michael D Kinney Reviewed-by: Ard Biesheuvel Reviewed-by: Sunil V L --- .../Fdt/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c | 28 +++++++++++----------- .../FdtPciPcdProducerLib/FdtPciPcdProducerLib.c | 4 ++-- OvmfPkg/Fdt/HighMemDxe/HighMemDxe.c | 10 ++++---- OvmfPkg/Fdt/VirtioFdtDxe/VirtioFdtDxe.c | 10 ++++---- 4 files changed, 26 insertions(+), 26 deletions(-) (limited to 'OvmfPkg/Fdt') diff --git a/OvmfPkg/Fdt/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c b/OvmfPkg/Fdt/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c index 14b41a533e..0d116f60dd 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 b5a6718146..a3b09e547f 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 87bc8b6827..779bf5c827 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 619740e6e7..668090dbea 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 )); } -- cgit