From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29])
 by mx.groups.io with SMTP id smtpd.web11.171751.1680819859367975774
 for <devel@edk2.groups.io>;
 Thu, 06 Apr 2023 15:24:19 -0700
Authentication-Results: mx.groups.io;
 dkim=fail reason="signature has expired" header.i=@bsdio.com header.s=fm3 header.b=C66gpxE2;
 spf=pass (domain: bsdio.com, ip: 66.111.4.29, mailfrom: rebecca@bsdio.com)
Received: from compute5.internal (compute5.nyi.internal [10.202.2.45])
	by mailout.nyi.internal (Postfix) with ESMTP id B150D5C01D6;
	Thu,  6 Apr 2023 18:24:18 -0400 (EDT)
Received: from mailfrontend2 ([10.202.2.163])
  by compute5.internal (MEProxy); Thu, 06 Apr 2023 18:24:18 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdio.com; h=cc
	:cc:content-transfer-encoding:content-type:date:date:from:from
	:in-reply-to:in-reply-to:message-id:mime-version:references
	:reply-to:sender:subject:subject:to:to; s=fm3; t=1680819858; x=
	1680906258; bh=9W9ukSvD7CcFhccVefL9cxS9P2XHza31kA+IlkILCtQ=; b=C
	66gpxE24hNZzJNOwjufvKjZqSOuX9ctV2aVQ++mtXkPQui5VnFz5+kVY9YjD9EmI
	G9pBrKszMQAFDn44nJSjv/+R6uOIKT5tZiKLXfYJBu9P7cXliZXV75phB4JwHeIM
	jRjUvdiafPeDIhthszJIMKQ8fALpxZYnws9SzIsgM3M96RozVY4BXZkUZB0RO1/Q
	UxLOar4tKAzudCXSL/4xDlefSpmRRcFIxRjloO93ZTUBv7qfa+p1UmDOSPdWawEu
	f9ynHIXlaIm84+xWoncuhWUvktq5k9oEm9EQ+fpIRQVdGSlo06GrKGynjJx5e6p6
	hbE4nkYtmdP1PzLXOu0ig==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	messagingengine.com; h=cc:cc:content-transfer-encoding
	:content-type:date:date:feedback-id:feedback-id:from:from
	:in-reply-to:in-reply-to:message-id:mime-version:references
	:reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy
	:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1680819858; x=
	1680906258; bh=9W9ukSvD7CcFhccVefL9cxS9P2XHza31kA+IlkILCtQ=; b=V
	IybO7Qumko+NQ/rr54cMGXK1j5IRpRW24pTPlWjPJoaPKV6bs7az89vF/DJNKh72
	erd1rTuqYysyXRkDTVe37N0q8RT4H7eqATSgZhd6VL7FYe/Qrgs8mar9puAkxRLS
	4uUMcV+q7fyo6+Ka6pdDp5MbrdeXK+NSiSCDcau2jzpOtUTw07WW4UFVrn75Gwyj
	eI4Cgf5YwroZrpK3+D3sTQBpyAwSDV62F7PwtCOfuEMAB3r5y5GlVglbSAfg8rVC
	e6+STgeYm41JXllDGQYcgbcp+IbsjRDcGDsYLlC+JSXvcU29ixWOzo1Q1NUV4KKB
	QS+ud4dGbOyynb+jzYFNQ==
X-ME-Sender: <xms:kkYvZNY1DGkdMmfWGUJFOHgaDDJZ6FkdWNJ2oRz6Ec33brn91Se-Sg>
    <xme:kkYvZEZMzy-mdcQxy0hK4ewmZnCvUOoTw1Ueag4g6jYQ4x6obOVasTwVDiC6MYfmi
    _F-yRrJrrzbDYivfmA>
X-ME-Received: <xmr:kkYvZP-1spWzkuqz2gSx901CbiUcgHW49qEqbukmh0PFnmZDUtuI0SXqD-lfdDT_BKT2jYdZftC77o96gjZdTOI7jvEhFI1S1vMKH2Q6kA>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvdejgedgtdejucetufdoteggodetrfdotf
    fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen
    uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne
    cujfgurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomheptfgvsggv
    tggtrgcuvehrrghnuceorhgvsggvtggtrgessghsughiohdrtghomheqnecuggftrfgrth
    htvghrnhepgeffueeuledvgefgvddvgfetvdduhfefkedukeeikedtudekfeetteeifedv
    leefnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprh
    gvsggvtggtrgessghsughiohdrtghomh
X-ME-Proxy: <xmx:kkYvZLoDknqlYdjT7cNCCnpKqvF63gutFYt0YSjg6GXlcwjqKwAkuw>
    <xmx:kkYvZIp2QFfttzwD2qDwXTlYvfK57UN2opuAJxC1r2gjqlMwctdVbA>
    <xmx:kkYvZBQREYXVQOpZ9M5NjYWReGAks2hhPPq3O9sbIeWTbEvoCRcbuw>
    <xmx:kkYvZH_ZOLUo0gzA79xU0eU_TRoRHP4FdQ8WIgVsxeNNCeiKc70r5w>
Feedback-ID: i5b994698:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu,
 6 Apr 2023 18:24:15 -0400 (EDT)
From: "Rebecca Cran" <rebecca@bsdio.com>
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 12/18] StandaloneMmPkg: Update code to be more C11 compliant by using __func__
Date: Thu,  6 Apr 2023 16:23:13 -0600
Message-Id: <20230406222319.2281263-13-rebecca@bsdio.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230406222319.2281263-1-rebecca@bsdio.com>
References: <20230406222319.2281263-1-rebecca@bsdio.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

__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