From nobody Mon Feb 9 08:56:44 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+75707+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75707+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622062390; cv=none; d=zohomail.com; s=zohoarc; b=nZc4VbdvxPEbvMiJXmW/v8ZiKEpK+XCy5bcmHUJAsE9e1f6Sq/OsXmqtFAYglvMYlG1udERIRK8QkHzpHAIfxnlugEpxiCTH8mNO/4PdJkl7yidjsM2EABrVlmj5WaZMuRL2RrfyzS5OVAididCDtZmRlOP0RjID/QERoE5F1gA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622062390; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=sSP2OryWkALfSTHS3pDZuZj//wXsmOMy3p83c6McgeA=; b=K/MvjUmghYHpG5ktBOY5MkErjOc31nB15k8BH2y//NTJ/iwqaNwHhBmem0UqEbDTuVuX9k+NMAUkEPsXHenJs6n2MXIXHI/Ii1Kv9sMx/iAegDLf0Gn05DQSAtvH+rF8AoF694EuVQcUAtVj9DDNkr0kRxBZqXizAZPspqdeUSE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75707+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 162206239054954.7061942134701; Wed, 26 May 2021 13:53:10 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 9qM6YY1788612xrZDgjUIlHJ; Wed, 26 May 2021 13:53:10 -0700 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web12.3294.1622062389345759245 for ; Wed, 26 May 2021 13:53:09 -0700 X-Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-264-WFINsaSEN6uIuesG-otcfg-1; Wed, 26 May 2021 16:53:04 -0400 X-MC-Unique: WFINsaSEN6uIuesG-otcfg-1 X-Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 64F6E108C31A; Wed, 26 May 2021 20:53:03 +0000 (UTC) X-Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-61.ams2.redhat.com [10.36.114.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id E71A9131C4; Wed, 26 May 2021 20:52:37 +0000 (UTC) From: "Laszlo Ersek" To: devel@edk2.groups.io Cc: Anthony Perard , Ard Biesheuvel , Jordan Justen , Julien Grall , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [edk2-devel] [PATCH 36/43] OvmfPkg/SmbiosPlatformDxe: clean up #includes and INF Date: Wed, 26 May 2021 22:14:39 +0200 Message-Id: <20210526201446.12554-37-lersek@redhat.com> In-Reply-To: <20210526201446.12554-1-lersek@redhat.com> References: <20210526201446.12554-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,lersek@redhat.com X-Gm-Message-State: hDGd6UF4tmE3khyfjmUUdUUax1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1622062390; bh=sSP2OryWkALfSTHS3pDZuZj//wXsmOMy3p83c6McgeA=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=E02xJf0iIPIE4cf7xTxX4KLQ0FR08fft2ZTCUK11zPySrKvroOkWh7i1VRT+BuVRsvD YyGhYwtNMtZGfwEDF0BGuR1p6C4FP47LC1Ck2iGpn22nTByzG/pbhvn0vUvOrQzU80dxZ XKgeHctbG9xu7cGKjnVXyg5UMJGd+Kdf0h0= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" - Sort all sections in the INF file. - Remove unused packages (MdeModulePkg) and lib classes (BaseMemoryLib) from the INF file. - Restrict some lib classes (BaseLib, HobLib) and GUIDs (gEfiXenInfoGuid) to IA32 and X64, in the INF file; only the IA32/X64 Xen implementation requires these. - Don't make "SmbiosPlatformDxe.h" #include everything just as a convenience. Spell out directly needed #includes in every file (annotate each with an example identifier consumed), drop unused #includes. - Keep #includes sorted. - Remove the leading underscore from the #include guard macro name in "SmbiosPlatformDxe.h". Cc: Anthony Perard Cc: Ard Biesheuvel Cc: Jordan Justen Cc: Julien Grall Cc: Philippe Mathieu-Daud=C3=A9 Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2122 Signed-off-by: Laszlo Ersek Reviewed-by: Philippe Mathieu-Daude --- OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf | 20 ++++++++++---------- OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.h | 15 +++------------ OvmfPkg/SmbiosPlatformDxe/Qemu.c | 8 +++++--- OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.c | 6 ++++++ OvmfPkg/SmbiosPlatformDxe/X86Xen.c | 6 ++++-- 5 files changed, 28 insertions(+), 27 deletions(-) diff --git a/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf b/OvmfPkg/Smbi= osPlatformDxe/SmbiosPlatformDxe.inf index 8b56d90cf805..6063c0c9f609 100644 --- a/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf +++ b/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf @@ -21,44 +21,44 @@ [Defines] # The following information is for reference only and not required by the = build tools. # # VALID_ARCHITECTURES =3D IA32 X64 EBC ARM AARCH64 # =20 [Sources] - SmbiosPlatformDxe.h - SmbiosPlatformDxe.c Qemu.c + SmbiosPlatformDxe.c + SmbiosPlatformDxe.h =20 [Sources.IA32, Sources.X64] X86Xen.c =20 [Sources.ARM, Sources.AARCH64] ArmXen.c =20 [Packages] MdePkg/MdePkg.dec - MdeModulePkg/MdeModulePkg.dec OvmfPkg/OvmfPkg.dec =20 [LibraryClasses] - UefiBootServicesTableLib - BaseMemoryLib - BaseLib - UefiDriverEntryPoint DebugLib - HobLib - QemuFwCfgLib MemoryAllocationLib PcdLib + QemuFwCfgLib + UefiBootServicesTableLib + UefiDriverEntryPoint + +[LibraryClasses.IA32, LibraryClasses.X64] + BaseLib + HobLib =20 [Pcd] gUefiOvmfPkgTokenSpaceGuid.PcdQemuSmbiosValidated =20 [Protocols] gEfiSmbiosProtocolGuid # PROTOCOL ALWAYS_CONSUMED =20 -[Guids] +[Guids.IA32, Guids.X64] gEfiXenInfoGuid =20 [Depex] gEfiSmbiosProtocolGuid =20 diff --git a/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.h b/OvmfPkg/Smbios= PlatformDxe/SmbiosPlatformDxe.h index 21aa916d7784..ad42a326418c 100644 --- a/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.h +++ b/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.h @@ -5,25 +5,16 @@ Copyright (c) 2011, Intel Corporation. All rights reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ =20 -#ifndef _SMBIOS_PLATFORM_DXE_H_ -#define _SMBIOS_PLATFORM_DXE_H_ - -#include - -#include -#include -#include -#include -#include -#include -#include +#ifndef SMBIOS_PLATFORM_DXE_H_ +#define SMBIOS_PLATFORM_DXE_H_ =20 +#include // SMBIOS_TABLE_ENTRY_POINT =20 /** Locates the Xen SMBIOS data if it exists =20 @return SMBIOS_TABLE_ENTRY_POINT Address of Xen SMBIOS data =20 diff --git a/OvmfPkg/SmbiosPlatformDxe/Qemu.c b/OvmfPkg/SmbiosPlatformDxe/Q= emu.c index e34658238123..fcfc3e33c28c 100644 --- a/OvmfPkg/SmbiosPlatformDxe/Qemu.c +++ b/OvmfPkg/SmbiosPlatformDxe/Qemu.c @@ -3,16 +3,18 @@ =20 Copyright (C) 2014, Gabriel L. Somlo =20 SPDX-License-Identifier: BSD-2-Clause-Patent **/ =20 +#include // ASSERT_EFI_ERROR() +#include // AllocatePool() +#include // PcdGetBool() +#include // QemuFwCfgFindFile() + #include "SmbiosPlatformDxe.h" -#include -#include -#include =20 /** Locates and extracts the QEMU SMBIOS data if present in fw_cfg =20 @return Address of extracted QEMU SMBIOS data =20 diff --git a/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.c b/OvmfPkg/Smbios= PlatformDxe/SmbiosPlatformDxe.c index 7991a19dc9c6..9bfc9f14f1a5 100644 --- a/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.c +++ b/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.c @@ -5,12 +5,18 @@ Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ =20 +#include // SMBIOS_TABLE_TYPE0 +#include // ASSERT_EFI_ERROR() +#include // FreePool() +#include // gBS +#include // EFI_SMBIOS_PROTOCOL + #include "SmbiosPlatformDxe.h" =20 #define TYPE0_STRINGS \ "EFI Development Kit II / OVMF\0" /* Vendor */ \ "0.0.0\0" /* BiosVersion */ \ "02/06/2015\0" /* BiosReleaseDate */ diff --git a/OvmfPkg/SmbiosPlatformDxe/X86Xen.c b/OvmfPkg/SmbiosPlatformDxe= /X86Xen.c index bead810efddb..e0b1b29f80db 100644 --- a/OvmfPkg/SmbiosPlatformDxe/X86Xen.c +++ b/OvmfPkg/SmbiosPlatformDxe/X86Xen.c @@ -5,15 +5,17 @@ Copyright (c) 2011, Intel Corporation. All rights reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ =20 +#include // AsciiStrnCmp() +#include // GetFirstGuidHob() +#include // EFI_HOB_GUID_TYPE + #include "SmbiosPlatformDxe.h" -#include -#include =20 #define XEN_SMBIOS_PHYSICAL_ADDRESS 0x000EB000 #define XEN_SMBIOS_PHYSICAL_END 0x000F0000 =20 /** Validates the SMBIOS entry point structure --=20 2.19.1.3.g30247aa5d201 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#75707): https://edk2.groups.io/g/devel/message/75707 Mute This Topic: https://groups.io/mt/83111084/1787277 Mute #includes:https://edk2.groups.io/g/devel/mutehashtag/includes Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-