From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 979B281F9C for ; Wed, 25 Jan 2017 22:09:32 -0800 (PST) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga105.jf.intel.com with ESMTP; 25 Jan 2017 22:09:32 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,287,1477983600"; d="scan'208";a="57682412" Received: from ray-dev.ccr.corp.intel.com ([10.239.9.25]) by fmsmga005.fm.intel.com with ESMTP; 25 Jan 2017 22:09:31 -0800 From: Ruiyu Ni To: edk2-devel@lists.01.org Cc: Feng Tian Date: Thu, 26 Jan 2017 14:09:24 +0800 Message-Id: <20170126060927.352436-3-ruiyu.ni@intel.com> X-Mailer: git-send-email 2.9.0.windows.1 In-Reply-To: <20170126060927.352436-1-ruiyu.ni@intel.com> References: <20170126060927.352436-1-ruiyu.ni@intel.com> Subject: [PATCH 2/5] MdeModulePkg/PciSioSerialDxe: Use MAX_UINT8 instead of PCI_BAR_ALL 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: Thu, 26 Jan 2017 06:09:32 -0000 When BarIndex equals to 0xFF, default value 0 is used as the BAR index. Though PCI_BAR_ALL and MAX_UINT8 shares the same value, using PCI_BAR_ALL is like to match any BAR not BAR 0, it's more proper to use MAX_UINT8 here. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni Cc: Feng Tian --- MdeModulePkg/Bus/Pci/PciSioSerialDxe/Serial.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MdeModulePkg/Bus/Pci/PciSioSerialDxe/Serial.c b/MdeModulePkg/Bus/Pci/PciSioSerialDxe/Serial.c index 65ddf5d..a9dc827 100644 --- a/MdeModulePkg/Bus/Pci/PciSioSerialDxe/Serial.c +++ b/MdeModulePkg/Bus/Pci/PciSioSerialDxe/Serial.c @@ -473,7 +473,7 @@ CreateSerialDevice ( // For PCI serial device, use the information from PCD // if (PciSerialParameter != NULL) { - BarIndex = (PciSerialParameter->BarIndex == PCI_BAR_ALL) ? 0 : PciSerialParameter->BarIndex; + BarIndex = (PciSerialParameter->BarIndex == MAX_UINT8) ? 0 : PciSerialParameter->BarIndex; Offset = PciSerialParameter->Offset; if (PciSerialParameter->RegisterStride != 0) { SerialDevice->RegisterStride = PciSerialParameter->RegisterStride; -- 2.9.0.windows.1