]> xenbits.xensource.com Git - ovmf.git/commitdiff
EmbeddedPkg: Update code to be more C11 compliant by using __func__
authorRebecca Cran <rebecca@bsdio.com>
Thu, 6 Apr 2023 19:50:52 +0000 (13:50 -0600)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Mon, 10 Apr 2023 14:19:57 +0000 (14:19 +0000)
__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.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Abner Chang <abner.chang@amd.com>
EmbeddedPkg/Drivers/ConsolePrefDxe/ConsolePrefDxe.c
EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.c
EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.c
EmbeddedPkg/Library/NonCoherentDmaLib/NonCoherentDmaLib.c
EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClock.c
EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c

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