From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.100; helo=mga07.intel.com; envelope-from=ruiyu.ni@intel.com; receiver=edk2-devel@lists.01.org Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (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 0FFEF207E5400 for ; Fri, 25 May 2018 03:02:40 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 May 2018 03:02:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,439,1520924400"; d="scan'208";a="202392475" Received: from ray-dev.ccr.corp.intel.com ([10.239.9.4]) by orsmga004.jf.intel.com with ESMTP; 25 May 2018 03:02:39 -0700 From: Ruiyu Ni To: edk2-devel@lists.01.org Cc: Star Zeng , Hao A Wu Date: Fri, 25 May 2018 18:02:45 +0800 Message-Id: <20180525100246.428944-2-ruiyu.ni@intel.com> X-Mailer: git-send-email 2.16.1.windows.1 In-Reply-To: <20180525100246.428944-1-ruiyu.ni@intel.com> References: <20180525100246.428944-1-ruiyu.ni@intel.com> Subject: [PATCH 1/2] MdeModulePkg/PciBus: Remove unnecessary PCIE detection X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2018 10:02:40 -0000 CreatePciIoDevice() detects whether the PCI device is a PCI Express device and remembers the device type in PciIoDevice->IsPciExp. RegisterPciDevice() detects the device type again which is unnecessary. The detection logic can be removed. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni Cc: Star Zeng Cc: Hao A Wu --- MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c index e76c8f0046..f69fe938da 100644 --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c @@ -1,7 +1,7 @@ /** @file Supporting functions implementaion for PCI devices management. -Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -211,7 +211,6 @@ RegisterPciDevice ( EFI_STATUS Status; VOID *PlatformOpRomBuffer; UINTN PlatformOpRomSize; - UINT8 PciExpressCapRegOffset; EFI_PCI_IO_PROTOCOL *PciIo; UINT8 Data8; BOOLEAN HasEfiImage; @@ -231,20 +230,6 @@ RegisterPciDevice ( return Status; } - // - // Detect if PCI Express Device - // - PciExpressCapRegOffset = 0; - Status = LocateCapabilityRegBlock ( - PciIoDevice, - EFI_PCI_CAPABILITY_ID_PCIEXP, - &PciExpressCapRegOffset, - NULL - ); - if (!EFI_ERROR (Status)) { - PciIoDevice->IsPciExp = TRUE; - } - // // Force Interrupt line to "Unknown" or "No Connection" // -- 2.16.1.windows.1