From nobody Tue May 21 04:24:49 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+57118+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+57118+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1586431827; cv=none; d=zohomail.com; s=zohoarc; b=BhFOEhelW8yRDjyITw9YL0uDUB8bwbTiw6DXMP/OUEQOQRCJ8jTtqKRkiqUQP4tICEPeD4y5y5UVk+HAs6msgI4VMCY1JgjkQXUKvUjUfMDrHC+EE1BBkZRwJgXjhmVgxvJM0jzSgvRy/vYs+nKIl00Rz91PyP1zcEg4w/4ljhQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1586431827; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=8ge2pXxr0rVxB563hkgic7FyMSdpfE9AoeGXIu7PNIg=; b=nkB2iiXX4hktL7zIL72ul8lbWbBylnoqfgul6KVOkhUFrXfc/Jb+IRkTKo6AcyeaUJn0onfYKlveiW/waMy5CfyOHpGT3yXJCVBmAhJAhBLmWeMGgr7sQnHaVPaTdXnCA7QQsIRr5Rl//DdYKaL5/M45dN6O6N8FybRc+va/Ghg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+57118+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1586431827675559.5193714830862; Thu, 9 Apr 2020 04:30:27 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id u2ygYY1788612xhlssdEGypq; Thu, 09 Apr 2020 04:30:26 -0700 X-Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.120]) by mx.groups.io with SMTP id smtpd.web12.6943.1586431824843341187 for ; Thu, 09 Apr 2020 04:30:25 -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-308-EVerZmZJPWqh0Y3c4QqOAg-1; Thu, 09 Apr 2020 07:30:22 -0400 X-MC-Unique: EVerZmZJPWqh0Y3c4QqOAg-1 X-Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 08B0E8017F5; Thu, 9 Apr 2020 11:30:21 +0000 (UTC) X-Received: from lacos-laptop-7.usersys.redhat.com (ovpn-112-213.ams2.redhat.com [10.36.112.213]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6FFFE5C57A; Thu, 9 Apr 2020 11:30:19 +0000 (UTC) From: "Laszlo Ersek" To: edk2-devel-groups-io Cc: Ard Biesheuvel , Hao A Wu , Jian J Wang , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Ray Ni Subject: [edk2-devel] [PATCH] MdeModulePkg/NonDiscoverablePciDeviceDxe: use standard PCI_MAX_BAR macro Date: Thu, 9 Apr 2020 13:30:17 +0200 Message-Id: <20200409113017.18233-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Unsubscribe: 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: zik4kM133uwhbN0N9Q174x6mx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1586431826; bh=8ge2pXxr0rVxB563hkgic7FyMSdpfE9AoeGXIu7PNIg=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=g0vK0L2rRt3L3LEFAC8nC9HnlxpyZCMi2Q5xRbP+ElDYnPH/9TOKSDFM3m4O1Ek6mg0 5/UQFieSY/5T0FRcXrjy7S2hnx8Wk/xhNtmHBMFKA9hFTHK8v+1GiAGEvA8kzdsTobngt 9/RDGrOKJ+NU5AOuobmMVj4o5WZwBnwYAjg= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" NonDiscoverablePciDeviceDxe currently #defines the module-internal PCI_MAX_BARS macro, with value 6 (and type "int"). Remove this private macro definition, and adopt PCI_MAX_BAR from "MdePkg/Include/IndustryStandard/Pci22.h". Both the value and the type remain unchanged (the standard PCI_MAX_BAR macro expands to 0x0006). "NonDiscoverablePciDeviceIo.h" gets the definition of PCI_MAX_BAR via its existent #include directive. Build-tested only. Cc: Ard Biesheuvel Cc: Hao A Wu Cc: Jian J Wang Cc: Philippe Mathieu-Daud=C3=A9 Cc: Ray Ni Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel Reviewed-by: Philippe Mathieu-Daude Reviewed-by: Ray Ni --- MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceI= o.h | 2 -- MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceI= o.c | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverab= lePciDeviceIo.h b/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDisco= verablePciDeviceIo.h index 15541c281153..3e6df3bebdd7 100644 --- a/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDe= viceIo.h +++ b/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDe= viceIo.h @@ -36,8 +36,6 @@ #define PCI_ID_VENDOR_UNKNOWN 0xffff #define PCI_ID_DEVICE_DONTCARE 0x0000 =20 -#define PCI_MAX_BARS 6 - extern EFI_CPU_ARCH_PROTOCOL *mCpu; =20 typedef struct { diff --git a/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverab= lePciDeviceIo.c b/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDisco= verablePciDeviceIo.c index c3e83003a01c..a40c1a959350 100644 --- a/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDe= viceIo.c +++ b/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDe= viceIo.c @@ -1679,8 +1679,8 @@ InitializePciIoProtocol ( ASSERT (Desc->Desc =3D=3D ACPI_ADDRESS_SPACE_DESCRIPTOR); ASSERT (Desc->ResType =3D=3D ACPI_ADDRESS_SPACE_TYPE_MEM); =20 - if (Idx >=3D PCI_MAX_BARS || - (Idx =3D=3D PCI_MAX_BARS - 1 && Desc->AddrSpaceGranularity =3D=3D = 64)) { + if (Idx >=3D PCI_MAX_BAR || + (Idx =3D=3D PCI_MAX_BAR - 1 && Desc->AddrSpaceGranularity =3D=3D 6= 4)) { DEBUG ((DEBUG_ERROR, "%a: resource count exceeds number of emulated BARs\n", __FUNCTION__)); --=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 (#57118): https://edk2.groups.io/g/devel/message/57118 Mute This Topic: https://groups.io/mt/72894144/1787277 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-