MdeModulePkg/IncompatiblePci: Use MAX_UINTN to match any IDs

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>
This commit is contained in:
Ruiyu Ni 2017-01-26 13:59:20 +08:00
parent c1a247b8a7
commit 29dbdcabf9
1 changed files with 5 additions and 5 deletions

View File

@ -283,31 +283,31 @@ PCheckDevice (
// //
// See if the Header matches the parameters passed in // 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) { if (Header->VendorId != VendorId) {
continue; continue;
} }
} }
if (Header->DeviceId != MAX_UINT64) { if ((Header->DeviceId != MAX_UINT64) && (DeviceId != MAX_UINTN)) {
if (DeviceId != Header->DeviceId) { if (DeviceId != Header->DeviceId) {
continue; continue;
} }
} }
if (Header->RevisionId != MAX_UINT64) { if ((Header->RevisionId != MAX_UINT64) && (RevisionId != MAX_UINTN)) {
if (RevisionId != Header->RevisionId) { if (RevisionId != Header->RevisionId) {
continue; continue;
} }
} }
if (Header->SubsystemVendorId != MAX_UINT64) { if ((Header->SubsystemVendorId != MAX_UINT64) && (SubsystemVendorId != MAX_UINTN)) {
if (SubsystemVendorId != Header->SubsystemVendorId) { if (SubsystemVendorId != Header->SubsystemVendorId) {
continue; continue;
} }
} }
if (Header->SubsystemDeviceId != MAX_UINT64) { if ((Header->SubsystemDeviceId != MAX_UINT64) && (SubsystemDeviceId != MAX_UINTN)) {
if (SubsystemDeviceId != Header->SubsystemDeviceId) { if (SubsystemDeviceId != Header->SubsystemDeviceId) {
continue; continue;
} }