Skip to content

Commit

Permalink
WhitleyOpenBoardPkg: Fix GCC unused variables that are set warnings
Browse files Browse the repository at this point in the history
Fixed issues caused by variables initialized but not used.

Cc: Nate DeSimone <[email protected]>
Cc: Chasel Chiu <[email protected]>
Signed-off-by: Isaac Oram <[email protected]>
Reviewed-by: Nate DeSimone <[email protected]>
  • Loading branch information
iworam committed Jul 20, 2022
1 parent ccfc200 commit 4c9b69e
Show file tree
Hide file tree
Showing 37 changed files with 28 additions and 150 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ TypeAowandaPlatformUpdateAcpiTablePcds (
EFI_STATUS Status;

EFI_HOB_GUID_TYPE *GuidHob;
EFI_PLATFORM_INFO *PlatformInfo;

DEBUG ((DEBUG_INFO, "Uba Callback: PlatformAowandaUpdateAcpiTablePcds entered\n"));

Expand All @@ -37,7 +36,6 @@ TypeAowandaPlatformUpdateAcpiTablePcds (
return EFI_NOT_FOUND;
}

PlatformInfo = GET_GUID_HOB_DATA (GuidHob);
// #
// #ACPI items
// #
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,13 @@ TypeAowandaInstallKtiEparamData (
{
EFI_STATUS Status;
EFI_HOB_GUID_TYPE *GuidHob;
EFI_PLATFORM_INFO *PlatformInfo;

GuidHob = GetFirstGuidHob (&gEfiPlatformInfoGuid);
ASSERT (GuidHob != NULL);
if (GuidHob == NULL) {
return EFI_NOT_FOUND;
}

PlatformInfo = GET_GUID_HOB_DATA (GuidHob);

Status = UbaConfigPpi->AddData (
UbaConfigPpi,
&gPlatformKtiEparamUpdateDataGuid,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ TypeBoardPortTemplatePlatformUpdateAcpiTablePcds (
EFI_STATUS Status;

EFI_HOB_GUID_TYPE *GuidHob;
EFI_PLATFORM_INFO *PlatformInfo;

DEBUG ((DEBUG_INFO, "Uba Callback: PlatformUpdateAcpiTablePcds entered\n"));

Expand All @@ -35,7 +34,7 @@ TypeBoardPortTemplatePlatformUpdateAcpiTablePcds (
if (GuidHob == NULL) {
return EFI_NOT_FOUND;
}
PlatformInfo = GET_GUID_HOB_DATA (GuidHob);

//#
//#ACPI items
//#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,19 +182,17 @@ TypeBoardPortTemplateIioPortBifurcationInit (
IN UBA_CONFIG_DATABASE_PPI *UbaConfigPpi
)
{
EFI_STATUS Status;
EFI_HOB_GUID_TYPE *GuidHob;
EFI_PLATFORM_INFO *PlatformInfo;
EFI_STATUS Status;
EFI_HOB_GUID_TYPE *GuidHob;
PLATFORM_IIO_CONFIG_UPDATE_TABLE_EX *PlatformIioInfoPtr;
UINTN PlatformIioInfoSize;
UINTN PlatformIioInfoSize;


GuidHob = GetFirstGuidHob (&gEfiPlatformInfoGuid);
ASSERT (GuidHob != NULL);
if (GuidHob == NULL) {
return EFI_NOT_FOUND;
}
PlatformInfo = GET_GUID_HOB_DATA (GuidHob);

//
// This is config for ICX
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,12 @@ TypeBoardPortTemplateInstallKtiEparamData (
{
EFI_STATUS Status;
EFI_HOB_GUID_TYPE *GuidHob;
EFI_PLATFORM_INFO *PlatformInfo;

GuidHob = GetFirstGuidHob (&gEfiPlatformInfoGuid);
ASSERT (GuidHob != NULL);
if (GuidHob == NULL) {
return EFI_NOT_FOUND;
}
PlatformInfo = GET_GUID_HOB_DATA (GuidHob);

Status = UbaConfigPpi->AddData (
UbaConfigPpi,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,6 @@ AcpiPlatformEarlyAcpiTablesInstall (
{
EFI_STATUS Status;
EFI_STATUS AcpiStatus;
BOOLEAN Installed;
EFI_ACPI_TABLE_PROTOCOL *AcpiTable;
EFI_FIRMWARE_VOLUME2_PROTOCOL *FwVol;
INTN Instance = 0;
Expand Down Expand Up @@ -435,7 +434,6 @@ AcpiPlatformEarlyAcpiTablesInstall (
CurrentTable = NULL;
TableVersion = EFI_ACPI_TABLE_VERSION_NONE;
TableHandle = 0;
Installed = FALSE;

Status = FwVol->ReadSection (
FwVol,
Expand Down Expand Up @@ -478,9 +476,9 @@ AcpiPlatformEarlyAcpiTablesInstall (
//
AcpiStatus = AcpiTable->InstallAcpiTable (AcpiTable, CurrentTable, CurrentTable->Length, &TableHandle);
if (!EFI_ERROR (AcpiStatus)) {
Installed = TRUE;
ASSERT_EFI_ERROR (AcpiStatus);
return AcpiStatus;
}
ASSERT_EFI_ERROR (AcpiStatus);
}
}
}
Expand Down Expand Up @@ -541,7 +539,6 @@ PmSsdtEarlyAcpiTablesInstall (
{
EFI_STATUS Status;
EFI_STATUS AcpiStatus;
BOOLEAN Installed;
EFI_ACPI_TABLE_PROTOCOL *AcpiTable;
EFI_FIRMWARE_VOLUME2_PROTOCOL *FwVol;
INTN Instance = 0;
Expand Down Expand Up @@ -581,7 +578,6 @@ PmSsdtEarlyAcpiTablesInstall (
CurrentTable = NULL;
TableVersion = EFI_ACPI_TABLE_VERSION_NONE;
TableHandle = 0;
Installed = FALSE;

Status = FwVol->ReadSection (
FwVol,
Expand Down Expand Up @@ -617,9 +613,9 @@ PmSsdtEarlyAcpiTablesInstall (
//
AcpiStatus = AcpiTable->InstallAcpiTable (AcpiTable, CurrentTable, CurrentTable->Length, &TableHandle);
if (!EFI_ERROR (AcpiStatus)) {
Installed = TRUE;
ASSERT_EFI_ERROR (AcpiStatus);
return AcpiStatus;
}
ASSERT_EFI_ERROR (AcpiStatus);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,6 @@ InstallXhciAcpiTable (
VOID
)
{
EFI_HANDLE *HandleBuffer;
EFI_STATUS Status;
EFI_FIRMWARE_VOLUME2_PROTOCOL *FwVol;
EFI_ACPI_COMMON_HEADER *CurrentTable;
Expand All @@ -269,7 +268,6 @@ InstallXhciAcpiTable (
UINT64 *XhciAcpiTablePtr;
UINT64 TempOemTableId;

HandleBuffer = 0;
Instance = 0;
TableHandle = 0;
CurrentTable = NULL;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,6 @@ BuildDRHDForStack (
UINT8 PortIndex;
UINT8 MaxPortNumberPerSocket;
UINT8 CBIndex;
UINT64 VtdMmioExtCap;
UINT32 VtdBase;
UINT32 VidDid;
DMAR_ATSR *pAtsr = NULL;
Expand Down Expand Up @@ -745,7 +744,6 @@ BuildDRHDForStack (
return EFI_UNSUPPORTED;
}

VtdMmioExtCap = *(volatile UINT64*)((UINTN)VtdBase + R_VTD_EXT_CAP_LOW);
mDrhd.RegisterBase = VtdBase;

DevIndex = 00;
Expand Down Expand Up @@ -882,7 +880,7 @@ ReportDmar (
)
{
EFI_STATUS Status = EFI_SUCCESS;
UINT8 SocketIndex, IioBusBase, Bus;
UINT8 SocketIndex, Bus;
UINT8 Dev, Func;
UINT8 DevIndex;
UINT8 PciNodeIndex;
Expand Down Expand Up @@ -1067,7 +1065,6 @@ ReportDmar (
ZeroMem (DevScope, MEMORY_SIZE * sizeof (DEVICE_SCOPE));
ZeroMem (PciNode, MEMORY_SIZE * sizeof (PCI_NODE));

IioBusBase = mCpuCsrAccessVarPtr ->StackBus[SocketIndex][Stack]; // Stack 0
mDrhd.Flags = 1;

DEBUG ((DEBUG_INFO, "[ACPI](DMAR) InterruptRemap is %aabled (%d & %d)\n",
Expand Down Expand Up @@ -1191,8 +1188,6 @@ ReportDmar (
continue;
}

IioBusBase = mIioUds2->IioUdsPtr->PlatformData.IIO_resource[SocketIndex].BusBase;

if (mIioUds2->IioUdsPtr->PlatformData.CpuQpiInfo[SocketIndex].PcieSegment >= MAX_SOCKET) {
return EFI_INVALID_PARAMETER;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -911,9 +911,6 @@ RootBridgeIoPciRead (
UINT32 PciExtReg;
USRA_ADDRESS EndPointPciAddress;
UINT8 *pData8 = Buffer;
UINT8 Size;

Size = 1 << (Width & 0x3);

if (Buffer == NULL) {
return EFI_INVALID_PARAMETER;
Expand Down Expand Up @@ -978,9 +975,6 @@ RootBridgeIoPciWrite (
UINT32 PciExtReg;
USRA_ADDRESS EndPointPciAddress;
UINT8 *pData8 = Buffer;
UINT8 Size;

Size = 1 << (Width & 0x3);

if (Buffer == NULL) {
return EFI_INVALID_PARAMETER;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ DEFINE EDKII_DSC_FEATURE_BUILD_OPTIONS = $(EDKII_DSC_FEATURE_BUILD_OPTIONS) $(ME
MSFT:*_*_*_DLINK_FLAGS = /ALIGN:4096

[BuildOptions]
GCC:*_GCC5_*_CC_FLAGS = -Wno-unused-but-set-variable -mabi=ms
GCC:*_GCC5_*_CC_FLAGS = -mabi=ms
GCC:*_GCC5_IA32_DLINK_FLAGS = -z common-page-size=0x20 -z muldefs
GCC:*_GCC5_X64_DLINK_FLAGS = -z common-page-size=0x20 -z muldefs
MSFT:*_*_*_CC_FLAGS = /FAsc
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ TypeJunctionCityPlatformUpdateAcpiTablePcds (
EFI_STATUS Status;

EFI_HOB_GUID_TYPE *GuidHob;
EFI_PLATFORM_INFO *PlatformInfo;

DEBUG ((DEBUG_INFO, "Uba Callback: PlatformUpdateAcpiTablePcds entered\n"));

Expand All @@ -36,7 +35,7 @@ TypeJunctionCityPlatformUpdateAcpiTablePcds (
if (GuidHob == NULL) {
return EFI_NOT_FOUND;
}
PlatformInfo = GET_GUID_HOB_DATA (GuidHob);

//#
//#ACPI items
//#
Expand All @@ -51,4 +50,3 @@ TypeJunctionCityPlatformUpdateAcpiTablePcds (

return Status;
}

Original file line number Diff line number Diff line change
Expand Up @@ -180,17 +180,14 @@ TypeJunctionCityIioPortBifurcationInit (
{
EFI_STATUS Status;
EFI_HOB_GUID_TYPE *GuidHob;
EFI_PLATFORM_INFO *PlatformInfo;
PLATFORM_IIO_CONFIG_UPDATE_TABLE_EX *PlatformIioInfoPtr;
UINTN PlatformIioInfoSize;


GuidHob = GetFirstGuidHob (&gEfiPlatformInfoGuid);
ASSERT (GuidHob != NULL);
if (GuidHob == NULL) {
return EFI_NOT_FOUND;
}
PlatformInfo = GET_GUID_HOB_DATA (GuidHob);

//
// This is config for ICX
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,12 @@ TypeJunctionCityInstallKtiEparamData (
{
EFI_STATUS Status;
EFI_HOB_GUID_TYPE *GuidHob;
EFI_PLATFORM_INFO *PlatformInfo;

GuidHob = GetFirstGuidHob (&gEfiPlatformInfoGuid);
ASSERT (GuidHob != NULL);
if (GuidHob == NULL) {
return EFI_NOT_FOUND;
}
PlatformInfo = GET_GUID_HOB_DATA (GuidHob);

Status = UbaConfigPpi->AddData (
UbaConfigPpi,
&gPlatformKtiEparamUpdateDataGuid,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,6 @@ PlatformUpdateTables (
{
EFI_ACPI_DESCRIPTION_HEADER *TableHeader;
EFI_STATUS Status;
ACPI_APIC_STRUCTURE_PTR *ProcessorLocalApicEntry;
UINT64 TempOemTableId;
UINT32 Data32;

Expand All @@ -318,8 +317,6 @@ PlatformUpdateTables (
}

TableHeader = NULL;

ProcessorLocalApicEntry = NULL;
Status = EFI_SUCCESS;

//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ SortCpuLocalApicInTable (
{
EFI_STATUS Status;
EFI_PROCESSOR_INFORMATION ProcessorInfoBuffer;
UINTN BufferSize;
UINT32 Index;
UINT32 Socket;
UINT32 CurrProcessor;
Expand All @@ -197,7 +196,6 @@ SortCpuLocalApicInTable (
CPU_ID_ORDER_MAP TempEntry;
BOOLEAN SecondThreadExistent;

BufferSize = 0;
Index = 0;
Status = EFI_SUCCESS;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@ PatchDsdtTable (
EFI_STATUS Status;
UINT8 *DsdtPointer;
UINT32 *Signature;
UINT32 *Signature2;
UINT32 Fixes;
UINT32 NodeIndex;
UINT8 Counter;
Expand Down Expand Up @@ -322,7 +321,6 @@ PatchDsdtTable (
// Last 4 chars of AmlOffsetTable.Pathname has FIX tag.
//
Signature = (UINT32 *) (mAmlOffsetTablePointer[i].Pathname + AsciiStrLen(mAmlOffsetTablePointer[i].Pathname) - 4);
Signature2 = (UINT32 *) (mAmlOffsetTablePointer[i].Pathname + AsciiStrLen(mAmlOffsetTablePointer[i].Pathname) - 9);
switch (*Signature) {
//
// "FIX1" BUS resource for PCXX in Acpi\AcpiTables\Dsdt\SysBus.asi and PCXX.asi
Expand Down Expand Up @@ -451,7 +449,6 @@ PatchDsdtTable (
// Last 4 chars of AmlOffsetTable.Pathname has FIX tag.
//
Signature = (UINT32 *) (mAmlOffsetTablePointer[i].Pathname + AsciiStrLen(mAmlOffsetTablePointer[i].Pathname) - 4);
Signature2 = (UINT32 *) (mAmlOffsetTablePointer[i].Pathname + AsciiStrLen(mAmlOffsetTablePointer[i].Pathname) - 9);
switch (*Signature) {
//
// "FIX3" PCI32 resource for PCXX in Acpi\AcpiTables\Dsdt\SysBus.asi and PCXX.asi
Expand Down Expand Up @@ -515,7 +512,6 @@ PatchDsdtTable (
// Last 4 chars of AmlOffsetTable.Pathname has FIX tag.
//
Signature = (UINT32 *) (mAmlOffsetTablePointer[i].Pathname + AsciiStrLen(mAmlOffsetTablePointer[i].Pathname) - 4);
Signature2 = (UINT32 *) (mAmlOffsetTablePointer[i].Pathname + AsciiStrLen(mAmlOffsetTablePointer[i].Pathname) - 9);
switch (*Signature) {
//
// "FIX4" PCI64 resource for PCXX in Acpi\AcpiTables\Dsdt\SysBus.asi and PCXX.asi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,6 @@ ProcessSocketsLinks (
ACPI_SYSTEM_LOCALITY_INFORMATION_TABLE *SlitAcpiTable;
UINT8 SourceNode;
UINT8 SourceSocket;
UINT8 SourceCluster;
UINT8 TargetSocket;

if (NULL == Table) {
Expand All @@ -582,7 +581,6 @@ ProcessSocketsLinks (

for (SourceNode = 0; SourceNode < (NodeCount - PmemNodeCount - FpgaCount); SourceNode++) {
SourceSocket = SourceNode / NumClusters;
SourceCluster = SourceNode % NumClusters;
for (TargetSocket = 0; TargetSocket < NumCpus; TargetSocket++) {
if (SocketsLinked (GetSocketPhysicalId (SourceSocket), GetSocketPhysicalId (TargetSocket))) {
SetMem (&SlitAcpiTable->NumSlit[(SourceNode * NodeCount) + (TargetSocket * NumClusters)].Entry,
Expand Down Expand Up @@ -622,7 +620,6 @@ ProcessMixedModeSocketsLinks (
UINT16 EntryIdx2LM;
UINT8 SourceNode;
UINT8 SourceSocket;
UINT8 SourceCluster;
UINT8 TargetSocket;
UINT8 TargetCluster;
BOOLEAN Is2LM;
Expand All @@ -639,7 +636,6 @@ ProcessMixedModeSocketsLinks (
for (SourceNode = 0; SourceNode < (NodeCount - PmemNodeCount - FpgaCount); SourceNode++) {
Is2LM = (SourceNode >= NumCpus * NumClusters) ? TRUE : FALSE;
SourceSocket = (SourceNode - NumCpus * NumClusters * (Is2LM ? 1 : 0)) / NumClusters;
SourceCluster = (SourceNode - NumCpus * NumClusters * (Is2LM ? 1 : 0)) % NumClusters;

for (TargetSocket = 0; TargetSocket < NumCpus; TargetSocket++) {
if (SocketsLinked (GetSocketPhysicalId (SourceSocket), GetSocketPhysicalId (TargetSocket))) {
Expand Down Expand Up @@ -1103,12 +1099,9 @@ InstallSlitTable (
{
ACPI_SYSTEM_LOCALITY_INFORMATION_TABLE *Table;
UINTN TableSize;
UINT8 NumClusters;
UINTN TableHandle = 0;
EFI_STATUS Status;

NumClusters = GetNumClusters ();

TableSize = sizeof (EFI_ACPI_6_2_SYSTEM_LOCALITY_DISTANCE_INFORMATION_TABLE_HEADER) +
sizeof (ACPI_SYSTEM_LOCALITIES_STRUCTURE) * EFI_ACPI_SYSTEM_LOCALITIES_ENTRY_COUNT;

Expand Down
Loading

0 comments on commit 4c9b69e

Please sign in to comment.