From: Ruiyu Ni <ruiyu.ni@intel.com>
To: edk2-devel@lists.01.org
Cc: Jeff Fan <jeff.fan@intel.com>
Subject: [PATCH v3 4/6] MdeModulePkg/IncompatiblePci: Use MAX_UINTN to match any IDs
Date: Tue, 7 Feb 2017 11:33:03 +0800 [thread overview]
Message-ID: <20170207033305.609040-5-ruiyu.ni@intel.com> (raw)
In-Reply-To: <20170207033305.609040-1-ruiyu.ni@intel.com>
When the VendorId/DeviceId/RevisionId/SubsystemVendorId
/SubsystemDeviceId is MAX_UINTN, IncompatiblePciDeviceSupport
driver doesn't use it to match any IDs.
The patch fixes this bug.
Since PciBus driver always calls IncompatiblePciDeviceSupport
using IDs read from HW, MAX_UINTN is never passed to this
driver.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
---
.../IncompatiblePciDeviceSupport.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/MdeModulePkg/Bus/Pci/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.c b/MdeModulePkg/Bus/Pci/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.c
index bf0d47a..149662d 100644
--- a/MdeModulePkg/Bus/Pci/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.c
+++ b/MdeModulePkg/Bus/Pci/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.c
@@ -283,31 +283,31 @@ PCheckDevice (
//
// See if the Header matches the parameters passed in
//
- if (Header->VendorId != MAX_UINT64) {
+ if ((Header->VendorId != MAX_UINT64) && (VendorId != MAX_UINTN)) {
if (Header->VendorId != VendorId) {
continue;
}
}
- if (Header->DeviceId != MAX_UINT64) {
+ if ((Header->DeviceId != MAX_UINT64) && (DeviceId != MAX_UINTN)) {
if (DeviceId != Header->DeviceId) {
continue;
}
}
- if (Header->RevisionId != MAX_UINT64) {
+ if ((Header->RevisionId != MAX_UINT64) && (RevisionId != MAX_UINTN)) {
if (RevisionId != Header->RevisionId) {
continue;
}
}
- if (Header->SubsystemVendorId != MAX_UINT64) {
+ if ((Header->SubsystemVendorId != MAX_UINT64) && (SubsystemVendorId != MAX_UINTN)) {
if (SubsystemVendorId != Header->SubsystemVendorId) {
continue;
}
}
- if (Header->SubsystemDeviceId != MAX_UINT64) {
+ if ((Header->SubsystemDeviceId != MAX_UINT64) && (SubsystemDeviceId != MAX_UINTN)) {
if (SubsystemDeviceId != Header->SubsystemDeviceId) {
continue;
}
--
2.9.0.windows.1
next prev parent reply other threads:[~2017-02-07 3:33 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-07 3:32 [PATCH v3 0/6] Fix PciBus to accept Spec values as BarIndex and Alignment Ruiyu Ni
2017-02-07 3:33 ` [PATCH v3 1/6] MdeModulePkg/PciSioSerialDxe: Use MAX_UINT8 instead of PCI_BAR_ALL Ruiyu Ni
2017-02-07 3:33 ` [PATCH v3 2/6] MdeModulePkg/PciBus: Accept Spec values as BarIndex and Alignment Ruiyu Ni
2017-02-07 3:33 ` [PATCH v3 3/6] MdeModulePkg/IncompatiblePciDevice: Do not use deprecated macros Ruiyu Ni
2017-02-07 3:33 ` Ruiyu Ni [this message]
2017-02-07 3:33 ` [PATCH v3 5/6] OvmfPkg/IncompatiblePci: " Ruiyu Ni
2017-02-07 17:40 ` Laszlo Ersek
2017-02-07 3:33 ` [PATCH v3 6/6] MdePkg/Pci22.h: Deprecate out-of-Spec IncompatiblePciDevice macros Ruiyu Ni
2017-02-07 5:54 ` Bug 367 - Version Check for capsule update logic error wang xiaofeng
2017-02-07 17:43 ` [PATCH v3 6/6] MdePkg/Pci22.h: Deprecate out-of-Spec IncompatiblePciDevice macros Laszlo Ersek
2017-02-08 0:58 ` Ni, Ruiyu
2017-02-08 1:09 ` Laszlo Ersek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170207033305.609040-5-ruiyu.ni@intel.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox