Skip to content

Commit

Permalink
StandaloneMmPkg: Update code to be more C11 compliant by using __func__
Browse files Browse the repository at this point in the history
__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.

Signed-off-by: Rebecca Cran <[email protected]>
Reviewed-by: Michael D Kinney <[email protected]>
Reviewed-by: Ard Biesheuvel <[email protected]>
  • Loading branch information
bexcran authored and mergify[bot] committed Apr 10, 2023
1 parent 9e7b042 commit f1d31a6
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ UpdateMmFoundationPeCoffPermissions (
DEBUG ((
DEBUG_ERROR,
"%a: ImageContext->ImageRead () failed (Status = %r)\n",
__FUNCTION__,
__func__,
Status
));
return Status;
Expand All @@ -89,31 +89,31 @@ UpdateMmFoundationPeCoffPermissions (
DEBUG ((
DEBUG_INFO,
"%a: Section %d of image at 0x%lx has 0x%x permissions\n",
__FUNCTION__,
__func__,
Index,
ImageContext->ImageAddress,
SectionHeader.Characteristics
));
DEBUG ((
DEBUG_INFO,
"%a: Section %d of image at 0x%lx has %a name\n",
__FUNCTION__,
__func__,
Index,
ImageContext->ImageAddress,
SectionHeader.Name
));
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
));
DEBUG ((
DEBUG_INFO,
"%a: Section %d of image at 0x%lx has 0x%x data\n",
__FUNCTION__,
__func__,
Index,
ImageContext->ImageAddress,
SectionHeader.PointerToRawData
Expand All @@ -133,15 +133,15 @@ UpdateMmFoundationPeCoffPermissions (
DEBUG ((
DEBUG_INFO,
"%a: Mapping section %d of image at 0x%lx with RW-XN permissions\n",
__FUNCTION__,
__func__,
Index,
ImageContext->ImageAddress
));
} else {
DEBUG ((
DEBUG_INFO,
"%a: Mapping section %d of image at 0x%lx with RO-XN permissions\n",
__FUNCTION__,
__func__,
Index,
ImageContext->ImageAddress
));
Expand All @@ -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
Expand Down Expand Up @@ -251,7 +251,7 @@ GetPeCoffSectionInformation (
DEBUG ((
DEBUG_ERROR,
"%a: PeCoffLoaderGetImageInfo () failed (Status == %r)\n",
__FUNCTION__,
__func__,
Status
));
return Status;
Expand All @@ -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
));
Expand Down Expand Up @@ -296,7 +296,7 @@ GetPeCoffSectionInformation (
DEBUG ((
DEBUG_ERROR,
"%a: TmpContext->ImageRead () failed (Status = %r)\n",
__FUNCTION__,
__func__,
Status
));
return Status;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ UpdatePeCoffPermissions (
DEBUG ((
DEBUG_ERROR,
"%a: PeCoffLoaderGetImageInfo () failed (Status = %r)\n",
__FUNCTION__,
__func__,
Status
));
return Status;
Expand All @@ -68,7 +68,7 @@ UpdatePeCoffPermissions (
DEBUG ((
DEBUG_INFO,
"%a: ignoring XIP TE image at 0x%lx\n",
__FUNCTION__,
__func__,
ImageContext->ImageAddress
));
return RETURN_SUCCESS;
Expand All @@ -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
));
Expand Down Expand Up @@ -114,7 +114,7 @@ UpdatePeCoffPermissions (
DEBUG ((
DEBUG_ERROR,
"%a: TmpContext.ImageRead () failed (Status = %r)\n",
__FUNCTION__,
__func__,
Status
));
return Status;
Expand Down Expand Up @@ -156,7 +156,7 @@ UpdatePeCoffPermissions (
DEBUG ((
DEBUG_ERROR,
"%a: TmpContext.ImageRead () failed (Status = %r)\n",
__FUNCTION__,
__func__,
Status
));
return Status;
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit f1d31a6

Please sign in to comment.