Skip to content

Commit b255430

Browse files
committed
removed unused
1 parent bc2a7c8 commit b255430

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

ReBarDxe/ReBar.c

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
#include <Library/DebugLib.h>
99
#include "include/pciRegs.h"
1010
#include "include/PciHostBridgeResourceAllocation.h"
11-
#include <Library/PrintLib.h>
12-
#include <Library/IoLib.h>
1311

1412
#define CAP_POINTER 0x34
1513
#define PCIE_DEVICE 0x10
@@ -250,6 +248,9 @@ VOID reBarSetupDevice(EFI_HANDLE handle, EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_PCI_ADD
250248
pciReadConfigWord(pciAddress, 0, &vid);
251249
pciReadConfigWord(pciAddress, 2, &did);
252250

251+
if (vid == 0xFFFF)
252+
return;
253+
253254
DEBUG((DEBUG_INFO, "ReBarDXE: Device vid:%x did:%x\n", vid, did));
254255

255256
epos = pciFindExtCapability(pciAddress, PCI_EXT_CAP_ID_REBAR);
@@ -293,9 +294,8 @@ EFI_STATUS EFIAPI PreprocessControllerOverride (
293294
return status;
294295
}
295296

296-
BOOLEAN pciHostBridgeResourceAllocationProtocolHook()
297+
VOID pciHostBridgeResourceAllocationProtocolHook()
297298
{
298-
BOOLEAN ret = FALSE;
299299
EFI_STATUS status;
300300
UINTN handleCount;
301301
EFI_HANDLE *handleBuffer;
@@ -327,10 +327,8 @@ BOOLEAN pciHostBridgeResourceAllocationProtocolHook()
327327
o_PreprocessController = pciResAlloc->PreprocessController;
328328
pciResAlloc->PreprocessController = &PreprocessControllerOverride;
329329

330-
ret = TRUE;
331330
free:
332331
FreePool(handleBuffer);
333-
return ret;
334332
}
335333

336334
EFI_STATUS EFIAPI rebarInit(
@@ -355,14 +353,6 @@ EFI_STATUS EFIAPI rebarInit(
355353
if (reBarState)
356354
{
357355
DEBUG((DEBUG_INFO, "ReBarDXE: Enabled, maximum BAR size 2^%u MB\n", reBarState));
358-
/* We need to override the last function called by PreprocessController.
359-
We will look for functions in this order.
360-
PciOverrideProtocol->PlatformPrepController (ChipsetExit) (not found on some firmware)
361-
PciPlatformProtocol->PlatformPrepController (ChipsetExit) (seems standard on Intel atleast)
362-
PciResAlloc->PreprocessController (EfiPciBeforeChildBusEnumeration) (standard on EDK2)
363-
*/
364-
365-
366356
// For overriding PciHostBridgeResourceAllocationProtocol
367357
pciHostBridgeResourceAllocationProtocolHook();
368358
}

0 commit comments

Comments
 (0)