From: Laszlo Ersek Date: Wed, 2 Aug 2017 10:11:50 +0000 (+0200) Subject: OvmfPkg/IoMmuDxe: clean up used library classes X-Git-Tag: edk2-stable201903~3698 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=db7ea4d7c4c2740c91a0727949b68d12de9e866c OvmfPkg/IoMmuDxe: clean up used library classes The following library classes are not used by this module, so remove them from the INF file's [LibraryClasses] section: - DxeServicesTableLib - UefiLib The following library classes are used by this module, so add them to the INF file's [LibraryClasses] section: - BaseMemoryLib (e.g. via CopyMem()) - MemoryAllocationLib (e.g. via AllocatePool()) Sort the list of library classes (in both "IoMmuDxe.inf" and "AmdSevIoMmu.h"). Remove all non-local #include directives from "IoMmuDxe.c"; both C files of this module include "AmdSevIoMmu.h", and "AmdSevIoMmu.h" includes all non-local headers already. Cc: Ard Biesheuvel Cc: Brijesh Singh Cc: Jordan Justen Cc: Tom Lendacky Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek Tested-by: Brijesh Singh Reviewed-by: Brijesh Singh --- diff --git a/OvmfPkg/IoMmuDxe/AmdSevIoMmu.h b/OvmfPkg/IoMmuDxe/AmdSevIoMmu.h index 17d3694e4a..c15fa76c3c 100644 --- a/OvmfPkg/IoMmuDxe/AmdSevIoMmu.h +++ b/OvmfPkg/IoMmuDxe/AmdSevIoMmu.h @@ -24,11 +24,11 @@ #include #include -#include #include +#include +#include #include #include -#include /** Install IOMMU protocol to provide the DMA support for PciHostBridge and diff --git a/OvmfPkg/IoMmuDxe/IoMmuDxe.c b/OvmfPkg/IoMmuDxe/IoMmuDxe.c index 0ea42cbc13..70d30ea916 100644 --- a/OvmfPkg/IoMmuDxe/IoMmuDxe.c +++ b/OvmfPkg/IoMmuDxe/IoMmuDxe.c @@ -15,15 +15,6 @@ **/ -#include - -#include -#include -#include -#include -#include -#include - #include "AmdSevIoMmu.h" EFI_STATUS diff --git a/OvmfPkg/IoMmuDxe/IoMmuDxe.inf b/OvmfPkg/IoMmuDxe/IoMmuDxe.inf index 21dc39b923..3078497068 100644 --- a/OvmfPkg/IoMmuDxe/IoMmuDxe.inf +++ b/OvmfPkg/IoMmuDxe/IoMmuDxe.inf @@ -35,12 +35,12 @@ [LibraryClasses] BaseLib - UefiLib - UefiDriverEntryPoint - UefiBootServicesTableLib - DxeServicesTableLib + BaseMemoryLib DebugLib MemEncryptSevLib + MemoryAllocationLib + UefiBootServicesTableLib + UefiDriverEntryPoint [Protocols] gEdkiiIoMmuProtocolGuid ## SOMETIME_PRODUCES