From nobody Tue Feb 10 12:43:18 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+102637+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+102637+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1680819843; cv=none; d=zohomail.com; s=zohoarc; b=kq7cS7kjp1IpD3UmvYN0H8GIT/MEvewBIpLb/wj/la+rCIVmHTekLdslL9iBUOnbL1nL8PXwzjK0wBnEKxnXlxf0xfDli3M+6VW/E5DhhaVMtnG5gpV3izKYDeIHeIp+rzKm1WmIOmPo65UWS/VFyviO0r4GcdW3hk4fHH30Uqs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1680819843; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=tPmaGrjwT81C6rFjMjIwA0/JL8hEFMu2UNXr925UVn0=; b=EaIBTUX02UTgRGb1WP9rIDdm8Xl37yjzMJN+FhkacoDWjAt5BJJi7t4k7b1QmTweObpEjIasIDtVggUCqs6RVx/eg7fxA58E/LjDAoVReiCLmCo8S8TJatsSDZjftB2aF5iPlqu1Qnk9XK1Hy3/73gk1mEeFu11Y223uQ6c7pBU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+102637+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1680819843478781.3557338613696; Thu, 6 Apr 2023 15:24:03 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id X42vYY1788612xFZOozvU49v; Thu, 06 Apr 2023 15:24:03 -0700 X-Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by mx.groups.io with SMTP id smtpd.web10.171996.1680819842320674872 for ; Thu, 06 Apr 2023 15:24:02 -0700 X-Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 9FAE05C01D6; Thu, 6 Apr 2023 18:24:01 -0400 (EDT) X-Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Thu, 06 Apr 2023 18:24:01 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvdejgedgtdejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomheptfgvsggv tggtrgcuvehrrghnuceorhgvsggvtggtrgessghsughiohdrtghomheqnecuggftrfgrth htvghrnhepgeffueeuledvgefgvddvgfetvdduhfefkedukeeikedtudekfeetteeifedv leefnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprh gvsggvtggtrgessghsughiohdrtghomh X-ME-Proxy: Feedback-ID: i5b994698:Fastmail X-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 6 Apr 2023 18:23:58 -0400 (EDT) From: "Rebecca Cran" To: 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: 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 Subject: [edk2-devel] [PATCH 07/18] EmbeddedPkg: Update code to be more C11 compliant by using __func__ Date: Thu, 6 Apr 2023 16:23:08 -0600 Message-Id: <20230406222319.2281263-8-rebecca@bsdio.com> In-Reply-To: <20230406222319.2281263-1-rebecca@bsdio.com> References: <20230406222319.2281263-1-rebecca@bsdio.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,rebecca@bsdio.com X-Gm-Message-State: IJyDLpsPIsZYJ8whfd2C50hxx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1680819843; bh=/lq91Jp8krgigKUoS6zE53SZluK+pCxRzQnL5FKAY48=; h=Cc:Date:From:Reply-To:Subject:To; b=ClG+07sKFG1bSekszgKDu9ew9HJVrUZGSXiq+0tNbLgV9Ba6CjmLMVtirGK3Te7BHfB TI8nyHAVf5aZ8DxFtIS02UDB1Q7+Oo6v8hLQ1qVo0fgShPeQePvomYadEzIb/n1AshrUv AnXCx+jVWcKwKameLH3EmAhG0/B9LudTsww= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1680819844221100002 Content-Type: text/plain; charset="utf-8" __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 Reviewed-by: Abner Chang --- 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/Embedded= Pkg/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 =3D 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 =3D 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/EmbeddedPk= g/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 =3D=3D = %r)\n", - __FUNCTION__, + __func__, Status )); DtAcpiPref.Pref =3D 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 =3D 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 =3D=3D 0x= %x)\n", - __FUNCTION__, + __func__, CompatibleString, *RegSize )); @@ -263,7 +263,7 @@ FindNextMemoryNodeReg ( } =20 if (!IsNodeEnabled (Next)) { - DEBUG ((DEBUG_WARN, "%a: ignoring disabled memory node\n", __FUNCTIO= N__)); + DEBUG ((DEBUG_WARN, "%a: ignoring disabled memory node\n", __func__)= ); continue; } =20 @@ -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 =3D= =3D 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 =3D gBS->InstallConfigurationTable (&gFdtTableGuid, DeviceTreeBas= e); @@ -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 ( =20 mDeviceTreeBase =3D DeviceTreeBase; =20 - DEBUG ((DEBUG_INFO, "%a: DTB @ 0x%p\n", __FUNCTION__, mDeviceTreeBase)); + DEBUG ((DEBUG_INFO, "%a: DTB @ 0x%p\n", __func__, mDeviceTreeBase)); =20 // // 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; } =20 @@ -459,7 +459,7 @@ InitializeFdtClientDxe ( DEBUG (( DEBUG_ERROR, "%a: RegisterProtocolNotify(): %r\n", - __FUNCTION__, + __func__, Status )); goto CloseEvent; @@ -470,7 +470,7 @@ InitializeFdtClientDxe ( // Status =3D 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; } =20 @@ -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/Em= beddedPkg/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 =3D EFI_UNSUPPORTED; FreeMapInfo: diff --git a/EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClock.c b/Embedded= Pkg/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__ )); =20 mTimeSettings.TimeZone =3D 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 ( =20 Status =3D MmcHost->SendCommand (MmcHost, MMC_CMD55, CmdArg); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a (MMC_CMD55): Error and Status =3D %r\n", __FU= NCTION__, Status)); + DEBUG ((DEBUG_ERROR, "%a (MMC_CMD55): Error and Status =3D %r\n", __fu= nc__, Status)); return Status; } =20 Status =3D MmcHost->ReceiveResponse (MmcHost, MMC_RESPONSE_TYPE_R1, Resp= onse); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a (MMC_CMD55): Error and Status =3D %r\n", __FU= NCTION__, Status)); + DEBUG ((DEBUG_ERROR, "%a (MMC_CMD55): Error and Status =3D %r\n", __fu= nc__, Status)); return Status; } =20 @@ -473,18 +473,18 @@ InitializeSdMmcDevice ( CmdArg =3D CreateSwitchCmdArgument (0, 0, 0); Status =3D MmcHost->SendCommand (MmcHost, MMC_CMD6, CmdArg); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a (MMC_CMD6): Error and Status =3D %r\n", __F= UNCTION__, Status)); + DEBUG ((DEBUG_ERROR, "%a (MMC_CMD6): Error and Status =3D %r\n", __f= unc__, Status)); return Status; } else { Status =3D MmcHost->ReadBlockData (MmcHost, 0, SWITCH_CMD_DATA_LENGT= H, Buffer); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a (MMC_CMD6): ReadBlockData Error and Statu= s =3D %r\n", __FUNCTION__, Status)); + DEBUG ((DEBUG_ERROR, "%a (MMC_CMD6): ReadBlockData Error and Statu= s =3D %r\n", __func__, Status)); return Status; } } =20 if (!(Buffer[3] & SD_HIGH_SPEED_SUPPORTED)) { - DEBUG ((DEBUG_INFO, "%a : High Speed not supported by Card\n", __FUN= CTION__)); + DEBUG ((DEBUG_INFO, "%a : High Speed not supported by Card\n", __fun= c__)); } else { Speed =3D SD_HIGH_SPEED; =20 @@ -492,12 +492,12 @@ InitializeSdMmcDevice ( CmdArg =3D CreateSwitchCmdArgument (1, 0, 1); Status =3D MmcHost->SendCommand (MmcHost, MMC_CMD6, CmdArg); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a (MMC_CMD6): Error and Status =3D %r\n", _= _FUNCTION__, Status)); + DEBUG ((DEBUG_ERROR, "%a (MMC_CMD6): Error and Status =3D %r\n", _= _func__, Status)); return Status; } else { Status =3D MmcHost->ReadBlockData (MmcHost, 0, SWITCH_CMD_DATA_LEN= GTH, Buffer); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a (MMC_CMD6): ReadBlockData Error and Sta= tus =3D %r\n", __FUNCTION__, Status)); + DEBUG ((DEBUG_ERROR, "%a (MMC_CMD6): ReadBlockData Error and Sta= tus =3D %r\n", __func__, Status)); return Status; } =20 @@ -513,14 +513,14 @@ InitializeSdMmcDevice ( CmdArg =3D MmcHostInstance->CardInfo.RCA << 16; Status =3D MmcHost->SendCommand (MmcHost, MMC_CMD55, CmdArg); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a (MMC_CMD55): Error and Status =3D %r\n", __= FUNCTION__, Status)); + DEBUG ((DEBUG_ERROR, "%a (MMC_CMD55): Error and Status =3D %r\n", __= func__, Status)); return Status; } =20 /* Width: 4 */ Status =3D MmcHost->SendCommand (MmcHost, MMC_CMD6, 2); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a (MMC_CMD6): Error and Status =3D %r\n", __F= UNCTION__, Status)); + DEBUG ((DEBUG_ERROR, "%a (MMC_CMD6): Error and Status =3D %r\n", __f= unc__, Status)); return Status; } } @@ -528,7 +528,7 @@ InitializeSdMmcDevice ( if (MMC_HOST_HAS_SETIOS (MmcHost)) { Status =3D MmcHost->SetIos (MmcHost, Speed, BUSWIDTH_4, EMMCBACKWARD); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a (SetIos): Error and Status =3D %r\n", __FUN= CTION__, Status)); + DEBUG ((DEBUG_ERROR, "%a (SetIos): Error and Status =3D %r\n", __fun= c__, Status)); return Status; } } --=20 2.34.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#102637): https://edk2.groups.io/g/devel/message/102637 Mute This Topic: https://groups.io/mt/98115243/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-