From 32fef03563abb58c439488836cf7884ceb1d7901 Mon Sep 17 00:00:00 2001 From: Laszlo Ersek Date: Wed, 26 May 2021 22:14:31 +0200 Subject: OvmfPkg/PciHostBridgeLib: consolidate #includes and INF file sections MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - In every C file, list every necessary public #include individually, with an example identifier that's actually consumed. - Place all public #includes first, all module-private #includes second. Separate them with a single empty line. Keep each section sorted in itself. - Sort all sections in the INF file, except [Defines]. - Add unlisted lib classes. - Remove unnecessary #include directives, add unlisted #include directives. Cc: Anthony Perard Cc: Ard Biesheuvel Cc: Jordan Justen Cc: Julien Grall Cc: Philippe Mathieu-Daudé Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2122 Signed-off-by: Laszlo Ersek Message-Id: <20210526201446.12554-29-lersek@redhat.com> Reviewed-by: Ard Biesheuvel Reviewed-by: Philippe Mathieu-Daudé --- .../Library/PciHostBridgeLib/PciHostBridgeLib.c | 22 ++++++++------------ .../Library/PciHostBridgeLib/PciHostBridgeLib.inf | 7 ++++--- OvmfPkg/Library/PciHostBridgeLib/XenSupport.c | 24 ++++++++++------------ 3 files changed, 23 insertions(+), 30 deletions(-) diff --git a/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c b/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c index 7d9fb0fb29..6db91fb7e2 100644 --- a/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c +++ b/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c @@ -7,23 +7,17 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#include +#include // PCI_MAX_BUS +#include // INTEL_Q35_MCH_DEVIC... +#include // ZeroMem() +#include // PcdGet64() +#include // PCI_ROOT_BRIDGE_APE... +#include // PciHostBridgeUtilit... +#include // EFI_PCI_HOST_BRIDGE... +#include // EFI_PCI_ATTRIBUTE_I... -#include -#include - -#include -#include - -#include -#include -#include -#include -#include -#include #include "PciHostBridge.h" - STATIC PCI_ROOT_BRIDGE_APERTURE mNonExistAperture = { MAX_UINT64, 0 }; diff --git a/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.inf b/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.inf index 4610a0c149..6227808884 100644 --- a/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.inf +++ b/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.inf @@ -25,9 +25,9 @@ # [Sources] + PciHostBridge.h PciHostBridgeLib.c XenSupport.c - PciHostBridge.h [Packages] MdeModulePkg/MdeModulePkg.dec @@ -35,6 +35,7 @@ OvmfPkg/OvmfPkg.dec [LibraryClasses] + BaseLib BaseMemoryLib DebugLib MemoryAllocationLib @@ -43,11 +44,11 @@ PciLib [Pcd] + gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration + gUefiOvmfPkgTokenSpaceGuid.PcdOvmfHostBridgePciDevId gUefiOvmfPkgTokenSpaceGuid.PcdPciIoBase gUefiOvmfPkgTokenSpaceGuid.PcdPciIoSize gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio32Base gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio32Size gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio64Base gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio64Size - gUefiOvmfPkgTokenSpaceGuid.PcdOvmfHostBridgePciDevId - gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration diff --git a/OvmfPkg/Library/PciHostBridgeLib/XenSupport.c b/OvmfPkg/Library/PciHostBridgeLib/XenSupport.c index 9ef39f0182..07c498dd0e 100644 --- a/OvmfPkg/Library/PciHostBridgeLib/XenSupport.c +++ b/OvmfPkg/Library/PciHostBridgeLib/XenSupport.c @@ -6,21 +6,19 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#include -#include -#include +#include // EFI_PCI_COMMAND_IO_SPACE +#include // INTEL_Q35_MCH_DEVICE_ID +#include // DisableInterrupts() +#include // ZeroMem() +#include // ASSERT() +#include // ReallocatePool() +#include // PcdGet16() +#include // PCI_ROOT_BRIDGE_APERTURE +#include // PciHostBridgeUtilityInitRoot... +#include // PciRead32() +#include // EFI_PCI_ATTRIBUTE_ISA_IO -#include -#include - -#include -#include -#include -#include -#include -#include -#include #include "PciHostBridge.h" STATIC -- cgit v1.2.3