Skip to content

Commit 6cfae9d

Browse files
bexcranhrw
authored andcommitted
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 edk2-platforms. Signed-off-by: Rebecca Cran <[email protected]>
1 parent d690794 commit 6cfae9d

File tree

205 files changed

+914
-914
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

205 files changed

+914
-914
lines changed

Drivers/OpTee/OpteeRpmbPkg/FixupPcd.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,11 @@ FixPcdMemory (
7171
);
7272

7373
DEBUG ((DEBUG_INFO, "%a: Fixup PcdFlashNvStorageVariableBase64: 0x%lx\n",
74-
__FUNCTION__, PcdGet64 (PcdFlashNvStorageVariableBase64)));
74+
__func__, PcdGet64 (PcdFlashNvStorageVariableBase64)));
7575
DEBUG ((DEBUG_INFO, "%a: Fixup PcdFlashNvStorageFtwWorkingBase64: 0x%lx\n",
76-
__FUNCTION__, PcdGet64 (PcdFlashNvStorageFtwWorkingBase64)));
76+
__func__, PcdGet64 (PcdFlashNvStorageFtwWorkingBase64)));
7777
DEBUG ((DEBUG_INFO, "%a: Fixup PcdFlashNvStorageFtwSpareBase64: 0x%lx\n",
78-
__FUNCTION__, PcdGet64 (PcdFlashNvStorageFtwSpareBase64)));
78+
__func__, PcdGet64 (PcdFlashNvStorageFtwSpareBase64)));
7979

8080
return Status;
8181
}

Drivers/OpTee/OpteeRpmbPkg/OpTeeRpmbFvb.c

+11-11
Original file line numberDiff line numberDiff line change
@@ -575,22 +575,22 @@ ValidateFvHeader (
575575
|| (FwVolHeader->Signature != EFI_FVH_SIGNATURE)
576576
|| (FwVolHeader->FvLength != FvLength)) {
577577
DEBUG ((DEBUG_INFO, "%a: No Firmware Volume header present\n",
578-
__FUNCTION__));
578+
__func__));
579579
return EFI_NOT_FOUND;
580580
}
581581

582582
// Check the Firmware Volume Guid
583583
if (!CompareGuid (&FwVolHeader->FileSystemGuid, &gEfiSystemNvDataFvGuid)) {
584584
DEBUG ((DEBUG_INFO, "%a: Firmware Volume Guid non-compatible\n",
585-
__FUNCTION__));
585+
__func__));
586586
return EFI_VOLUME_CORRUPTED;
587587
}
588588

589589
// Verify the header checksum
590590
Checksum = CalculateSum16 ((UINT16*)FwVolHeader, FwVolHeader->HeaderLength);
591591
if (Checksum != 0) {
592592
DEBUG ((DEBUG_INFO, "%a: FV checksum is invalid (Checksum:0x%X)\n",
593-
__FUNCTION__, Checksum));
593+
__func__, Checksum));
594594
return EFI_VOLUME_CORRUPTED;
595595
}
596596

@@ -600,15 +600,15 @@ ValidateFvHeader (
600600
// Check the Variable Store Guid
601601
if (!CompareGuid (&VariableStoreHeader->Signature, &gEfiVariableGuid) &&
602602
!CompareGuid (&VariableStoreHeader->Signature, &gEfiAuthenticatedVariableGuid)) {
603-
DEBUG ((DEBUG_INFO, "%a: Variable Store Guid non-compatible\n", __FUNCTION__));
603+
DEBUG ((DEBUG_INFO, "%a: Variable Store Guid non-compatible\n", __func__));
604604
return EFI_VOLUME_CORRUPTED;
605605
}
606606

607607
VariableStoreLength = PcdGet32 (PcdFlashNvStorageVariableSize) -
608608
FwVolHeader->HeaderLength;
609609
if (VariableStoreHeader->Size != VariableStoreLength) {
610610
DEBUG ((DEBUG_INFO, "%a: Variable Store Length does not match\n",
611-
__FUNCTION__));
611+
__func__));
612612
return EFI_VOLUME_CORRUPTED;
613613
}
614614

@@ -754,15 +754,15 @@ FvbInitialize (
754754
Status = ValidateFvHeader (FwVolHeader);
755755
if (EFI_ERROR (Status)) {
756756
// There is no valid header, so time to install one.
757-
DEBUG ((DEBUG_INFO, "%a: The FVB Header is not valid.\n", __FUNCTION__));
757+
DEBUG ((DEBUG_INFO, "%a: The FVB Header is not valid.\n", __func__));
758758

759759
// Reset memory
760760
SetMem64 (
761761
(VOID *)(UINTN)Instance->MemBaseAddress,
762762
Instance->NBlocks * Instance->BlockSize,
763763
~0UL
764764
);
765-
DEBUG ((DEBUG_INFO, "%a: Erasing Flash.\n", __FUNCTION__));
765+
DEBUG ((DEBUG_INFO, "%a: Erasing Flash.\n", __func__));
766766
Status = ReadWriteRpmb (
767767
SP_SVC_RPMB_WRITE,
768768
Instance->MemBaseAddress,
@@ -776,13 +776,13 @@ FvbInitialize (
776776
}
777777
// Install all appropriate headers
778778
DEBUG ((DEBUG_INFO, "%a: Installing a correct one for this volume.\n",
779-
__FUNCTION__));
779+
__func__));
780780
Status = InitializeFvAndVariableStoreHeaders (Instance);
781781
if (EFI_ERROR (Status)) {
782782
return Status;
783783
}
784784
} else {
785-
DEBUG ((DEBUG_INFO, "%a: Found valid FVB Header.\n", __FUNCTION__));
785+
DEBUG ((DEBUG_INFO, "%a: Found valid FVB Header.\n", __func__));
786786
}
787787
Instance->Initialized = TRUE;
788788

@@ -861,9 +861,9 @@ OpTeeRpmbFvbInit (
861861
);
862862
ASSERT_EFI_ERROR (Status);
863863

864-
DEBUG ((DEBUG_INFO, "%a: Register OP-TEE RPMB Fvb\n", __FUNCTION__));
864+
DEBUG ((DEBUG_INFO, "%a: Register OP-TEE RPMB Fvb\n", __func__));
865865
DEBUG ((DEBUG_INFO, "%a: Using NV store FV in-memory copy at 0x%lx\n",
866-
__FUNCTION__, PatchPcdGet64 (PcdFlashNvStorageVariableBase64)));
866+
__func__, PatchPcdGet64 (PcdFlashNvStorageVariableBase64)));
867867

868868
return Status;
869869
}

Features/Intel/PowerManagement/S3FeaturePkg/S3Dxe/S3Dxe.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ S3DxeEntryPoint (
129129
ACPI_S3_MEMORY S3MemoryInfo;
130130
EFI_STATUS Status;
131131

132-
DEBUG ((DEBUG_INFO, "%a() Start\n", __FUNCTION__));
132+
DEBUG ((DEBUG_INFO, "%a() Start\n", __func__));
133133

134134
S3PeiMemSize = (UINTN) GetPeiMemSize ();
135135
S3PeiMemBase = (UINTN) AllocateAcpiNvsMemoryBelow4G (S3PeiMemSize);
@@ -150,6 +150,6 @@ S3DxeEntryPoint (
150150
);
151151
ASSERT_EFI_ERROR (Status);
152152

153-
DEBUG ((DEBUG_INFO, "%a() End\n", __FUNCTION__));
153+
DEBUG ((DEBUG_INFO, "%a() End\n", __func__));
154154
return EFI_SUCCESS;
155155
}

Platform/96Boards/96BoardsI2cDxe/96BoardsI2cDxe.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -109,15 +109,15 @@ EnableI2cBusConfiguration (
109109
&gEfiI2cMasterProtocolGuid, (VOID **)&I2cMaster);
110110
if (EFI_ERROR (Status)) {
111111
DEBUG ((DEBUG_ERROR, "%a: gBS->HandleProtocol() failed - %r\n",
112-
__FUNCTION__, Status));
112+
__func__, Status));
113113
return Status;
114114
}
115115

116116
BusClockHertz = Bus->BusFrequency;
117117
Status = I2cMaster->SetBusFrequency (I2cMaster, &BusClockHertz);
118118
if (EFI_ERROR (Status)) {
119119
DEBUG ((DEBUG_ERROR, "%a: I2cMaster->SetBusFrequency() failed - %r\n",
120-
__FUNCTION__, Status));
120+
__func__, Status));
121121
return Status;
122122
}
123123

@@ -162,7 +162,7 @@ RegisterI2cBus (
162162
Status = gBS->LocateHandle (ByProtocol, Guid, NULL, &BufferSize,
163163
&I2cBus->I2cMasterHandle);
164164
if (EFI_ERROR (Status)) {
165-
DEBUG ((DEBUG_INFO, "%a: gBS->LocateHandle() failed - %r\n", __FUNCTION__,
165+
DEBUG ((DEBUG_INFO, "%a: gBS->LocateHandle() failed - %r\n", __func__,
166166
Status));
167167
return;
168168
}

Platform/96Boards/LsConnectorDxe/LsConnectorDxe.c

+6-6
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ PublishOsDescription (
105105
Status = gBS->LocateProtocol (&g96BoardsMezzanineProtocolGuid, NULL,
106106
(VOID **)&Mezzanine);
107107
if (EFI_ERROR (Status)) {
108-
DEBUG ((DEBUG_INFO, "%a: no mezzanine driver active\n", __FUNCTION__));
108+
DEBUG ((DEBUG_INFO, "%a: no mezzanine driver active\n", __func__));
109109
return;
110110
}
111111

@@ -115,7 +115,7 @@ PublishOsDescription (
115115
Status = Mezzanine->InstallSsdtTable (Mezzanine, AcpiProtocol);
116116
if (EFI_ERROR (Status)) {
117117
DEBUG ((DEBUG_WARN, "%a: failed to install SSDT table - %r\n",
118-
__FUNCTION__, Status));
118+
__func__, Status));
119119
}
120120
return;
121121
}
@@ -133,7 +133,7 @@ PublishOsDescription (
133133

134134
Status = Mezzanine->ApplyDeviceTreeOverlay (Mezzanine, Dtb);
135135
if (EFI_ERROR (Status)) {
136-
DEBUG ((DEBUG_WARN, "%a: failed to apply DT overlay - %r\n", __FUNCTION__,
136+
DEBUG ((DEBUG_WARN, "%a: failed to apply DT overlay - %r\n", __func__,
137137
Status));
138138
}
139139
}
@@ -169,15 +169,15 @@ EntryPoint (
169169
Status = gRT->GetVariable (NINETY_SIX_BOARDS_CONFIG_VARIABLE_NAME,
170170
&g96BoardsFormsetGuid, NULL, &BufferSize, &ConfigData);
171171
if (EFI_ERROR (Status)) {
172-
DEBUG ((DEBUG_INFO, "%a: no config data found\n", __FUNCTION__));
172+
DEBUG ((DEBUG_INFO, "%a: no config data found\n", __func__));
173173
ConfigData.MezzanineType = MEZZANINE_NONE;
174174
}
175175

176176
if (!EFI_ERROR (Status) &&
177177
ConfigData.MezzanineType >= MEZZANINE_MAX) {
178178
DEBUG ((DEBUG_WARN,
179179
"%a: invalid value for %s, defaulting to MEZZANINE_NONE\n",
180-
__FUNCTION__, NINETY_SIX_BOARDS_CONFIG_VARIABLE_NAME));
180+
__func__, NINETY_SIX_BOARDS_CONFIG_VARIABLE_NAME));
181181
ConfigData.MezzanineType = MEZZANINE_NONE;
182182
Status = EFI_INVALID_PARAMETER; // trigger setvar below
183183
}
@@ -194,7 +194,7 @@ EntryPoint (
194194

195195
if (EFI_ERROR (Status)) {
196196
DEBUG ((DEBUG_ERROR, "%a: gRT->SetVariable () failed - %r\n",
197-
__FUNCTION__, Status));
197+
__func__, Status));
198198
return Status;
199199
}
200200
}

Platform/96Boards/Secure96Dxe/Secure96Dxe.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ SetOverlayFragmentTarget (
6868
AsciiStrLen (Target) + 1);
6969
if (Err) {
7070
DEBUG ((DEBUG_ERROR, "%a: fdt_setprop() failed - %a\n",
71-
__FUNCTION__, fdt_strerror (Err)));
71+
__func__, fdt_strerror (Err)));
7272
}
7373
}
7474

@@ -103,7 +103,7 @@ FixupOverlay (
103103
if (Err) {
104104
DEBUG ((DEBUG_ERROR,
105105
"%a: fdt_setprop_u32(.., .., \"phandle\", 0x%x) failed - %a\n",
106-
__FUNCTION__, GpioPhandle, fdt_strerror (Err)));
106+
__func__, GpioPhandle, fdt_strerror (Err)));
107107
}
108108
}
109109

@@ -171,7 +171,7 @@ ApplyDeviceTreeOverlay (
171171
Err = fdt_overlay_apply (Dtb, Overlay);
172172
if (Err) {
173173
DEBUG ((DEBUG_ERROR, "%a: fdt_overlay_apply() failed - %a\n",
174-
__FUNCTION__, fdt_strerror (Err)));
174+
__func__, fdt_strerror (Err)));
175175
return EFI_NOT_FOUND;
176176
}
177177

Platform/AMD/AmdMinBoardPkg/Library/DxeBoardInitLib/DxeBoardInitLib.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ BoardInitAfterPciEnumeration (
164164
{
165165
EFI_STATUS Status;
166166

167-
DEBUG ((DEBUG_INFO, "%a - ENTRY\n", __FUNCTION__));
167+
DEBUG ((DEBUG_INFO, "%a - ENTRY\n", __func__));
168168

169169
Status = ReserveLegacyVgaIoSpace ();
170170
DEBUG ((DEBUG_INFO, "ReserveLegacyVgaIoSpace...%r.\n", Status));

Platform/AMD/AmdMinBoardPkg/Library/DxeBoardInitLib/MadtAcpiTablePatch.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ MadtAcpiTablePatch (
132132
LocalX2ApicPtr = NULL;
133133
GetIoApicInfo (&NbioIoApic, &IoApicCount);
134134
if ((NbioIoApic == NULL) || (IoApicCount == 0)) {
135-
DEBUG ((DEBUG_INFO, "%a:%d Cannot obtain NBIO IOAPIC information.\n", __FUNCTION__, __LINE__));
135+
DEBUG ((DEBUG_INFO, "%a:%d Cannot obtain NBIO IOAPIC information.\n", __func__, __LINE__));
136136
return EFI_SUCCESS;
137137
}
138138

Platform/AMD/VanGoghBoard/Override/edk2/Fsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ OnReadyToBoot (
386386
FspsUpd = ((FSPS_UPD *)(UINTN)(*(UINT32 *)GET_GUID_HOB_DATA (FspsUpdHob)));
387387
Status = gBS->LocateProtocol (&gEfiAcpiTableProtocolGuid, NULL, (VOID **)&AcpiTableProtocol);
388388
if (!EFI_ERROR (Status)) {
389-
DEBUG ((DEBUG_INFO, "%a:FSP-S UPD Ptr:%x\n", __FUNCTION__, FspsUpd));
389+
DEBUG ((DEBUG_INFO, "%a:FSP-S UPD Ptr:%x\n", __func__, FspsUpd));
390390
UINTN TableKey = 0;
391391
if (ExportedInterfaceHob->AcpiTpm2Table != 0) {
392392
DEBUG ((DEBUG_INFO, "TPM2 Table: %x\n", ExportedInterfaceHob->AcpiTpm2Table));

Platform/AMD/VanGoghBoard/Override/edk2/Fsp2WrapperPkg/Library/BaseFspWrapperPlatformLibSample/FspWrapperPlatformLibSample.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ UpdateFspmUpdDataForFabric (
112112
IN OUT VOID *FspUpdRgnPtr
113113
)
114114
{
115-
DEBUG ((DEBUG_INFO, "%a Enter\n", __FUNCTION__));
115+
DEBUG ((DEBUG_INFO, "%a Enter\n", __func__));
116116
FSPM_UPD *Upd = (FSPM_UPD *)FspUpdRgnPtr;
117117
EFI_PEI_READ_ONLY_VARIABLE2_PPI *ReadVariable2 = NULL;
118118
EFI_STATUS Status = PeiServicesLocatePpi (&gEfiPeiReadOnlyVariable2PpiGuid, 0, NULL, (VOID **)&ReadVariable2);

Platform/AMD/VanGoghBoard/VanGoghCommonPkg/FvbServices/FwBlockService.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ FvbReadBlock (
345345
UINTN LbaLength;
346346
EFI_STATUS Status;
347347

348-
DEBUG ((DEBUG_INFO, "Smm %a() enter\n", __FUNCTION__));
348+
DEBUG ((DEBUG_INFO, "Smm %a() enter\n", __func__));
349349

350350
//
351351
// Check for invalid conditions

Platform/ARM/Drivers/NorFlashDxe/NorFlashDxe.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -349,11 +349,11 @@ NorFlashFvbInitialize (
349349
// Install the Default FVB header if required
350350
if (EFI_ERROR (Status)) {
351351
// There is no valid header, so time to install one.
352-
DEBUG ((DEBUG_INFO, "%a: The FVB Header is not valid.\n", __FUNCTION__));
352+
DEBUG ((DEBUG_INFO, "%a: The FVB Header is not valid.\n", __func__));
353353
DEBUG ((
354354
DEBUG_INFO,
355355
"%a: Installing a correct one for this volume.\n",
356-
__FUNCTION__
356+
__func__
357357
));
358358

359359
// Erase all the NorFlash that is reserved for variable storage

Platform/ARM/Drivers/NorFlashDxe/NorFlashFvb.c

+11-11
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ InitializeFvAndVariableStoreHeaders (
7474
DEBUG ((
7575
DEBUG_ERROR,
7676
"%a: NvStorageFtwWorkingBase is not contiguous with NvStorageVariableBase region\n",
77-
__FUNCTION__
77+
__func__
7878
));
7979
return EFI_INVALID_PARAMETER;
8080
}
@@ -83,7 +83,7 @@ InitializeFvAndVariableStoreHeaders (
8383
DEBUG ((
8484
DEBUG_ERROR,
8585
"%a: NvStorageFtwSpareBase is not contiguous with NvStorageFtwWorkingBase region\n",
86-
__FUNCTION__
86+
__func__
8787
));
8888
return EFI_INVALID_PARAMETER;
8989
}
@@ -93,7 +93,7 @@ InitializeFvAndVariableStoreHeaders (
9393
DEBUG ((
9494
DEBUG_ERROR,
9595
"%a: NvStorageVariableSize is 0x%x, should be atleast one block size\n",
96-
__FUNCTION__,
96+
__func__,
9797
NvStorageVariableSize
9898
));
9999
return EFI_INVALID_PARAMETER;
@@ -103,7 +103,7 @@ InitializeFvAndVariableStoreHeaders (
103103
DEBUG ((
104104
DEBUG_ERROR,
105105
"%a: NvStorageFtwWorkingSize is 0x%x, should be atleast one block size\n",
106-
__FUNCTION__,
106+
__func__,
107107
NvStorageFtwWorkingSize
108108
));
109109
return EFI_INVALID_PARAMETER;
@@ -113,7 +113,7 @@ InitializeFvAndVariableStoreHeaders (
113113
DEBUG ((
114114
DEBUG_ERROR,
115115
"%a: NvStorageFtwSpareSize is 0x%x, should be atleast one block size\n",
116-
__FUNCTION__,
116+
__func__,
117117
NvStorageFtwSpareSize
118118
));
119119
return EFI_INVALID_PARAMETER;
@@ -124,7 +124,7 @@ InitializeFvAndVariableStoreHeaders (
124124
(NvStorageFtwWorkingBase % Instance->Media.BlockSize != 0) ||
125125
(NvStorageFtwSpareBase % Instance->Media.BlockSize != 0))
126126
{
127-
DEBUG ((DEBUG_ERROR, "%a: NvStorage Base addresses must be aligned to block size boundaries", __FUNCTION__));
127+
DEBUG ((DEBUG_ERROR, "%a: NvStorage Base addresses must be aligned to block size boundaries", __func__));
128128
return EFI_INVALID_PARAMETER;
129129
}
130130

@@ -209,7 +209,7 @@ ValidateFvHeader (
209209
DEBUG ((
210210
DEBUG_INFO,
211211
"%a: No Firmware Volume header present\n",
212-
__FUNCTION__
212+
__func__
213213
));
214214
return EFI_NOT_FOUND;
215215
}
@@ -219,7 +219,7 @@ ValidateFvHeader (
219219
DEBUG ((
220220
DEBUG_INFO,
221221
"%a: Firmware Volume Guid non-compatible\n",
222-
__FUNCTION__
222+
__func__
223223
));
224224
return EFI_NOT_FOUND;
225225
}
@@ -230,7 +230,7 @@ ValidateFvHeader (
230230
DEBUG ((
231231
DEBUG_INFO,
232232
"%a: FV checksum is invalid (Checksum:0x%X)\n",
233-
__FUNCTION__,
233+
__func__,
234234
Checksum
235235
));
236236
return EFI_NOT_FOUND;
@@ -245,7 +245,7 @@ ValidateFvHeader (
245245
DEBUG ((
246246
DEBUG_INFO,
247247
"%a: Variable Store Guid non-compatible\n",
248-
__FUNCTION__
248+
__func__
249249
));
250250
return EFI_NOT_FOUND;
251251
}
@@ -255,7 +255,7 @@ ValidateFvHeader (
255255
DEBUG ((
256256
DEBUG_INFO,
257257
"%a: Variable Store Length does not match\n",
258-
__FUNCTION__
258+
__func__
259259
));
260260
return EFI_NOT_FOUND;
261261
}

0 commit comments

Comments
 (0)