From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 7F995820B0 for ; Mon, 6 Feb 2017 19:33:12 -0800 (PST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP; 06 Feb 2017 19:33:12 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,344,1477983600"; d="scan'208";a="222151721" Received: from ray-dev.ccr.corp.intel.com ([10.239.9.25]) by fmsmga004.fm.intel.com with ESMTP; 06 Feb 2017 19:33:11 -0800 From: Ruiyu Ni To: edk2-devel@lists.01.org Cc: Jeff Fan Date: Tue, 7 Feb 2017 11:33:03 +0800 Message-Id: <20170207033305.609040-5-ruiyu.ni@intel.com> X-Mailer: git-send-email 2.9.0.windows.1 In-Reply-To: <20170207033305.609040-1-ruiyu.ni@intel.com> References: <20170207033305.609040-1-ruiyu.ni@intel.com> Subject: [PATCH v3 4/6] MdeModulePkg/IncompatiblePci: Use MAX_UINTN to match any IDs X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2017 03:33:12 -0000 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 Cc: Jeff Fan Reviewed-by: Feng Tian --- .../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