From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (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 C904981EE5 for ; Tue, 7 Feb 2017 23:45:12 -0800 (PST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP; 07 Feb 2017 23:45:12 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,346,1477983600"; d="scan'208";a="931419695" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga003.jf.intel.com with ESMTP; 07 Feb 2017 23:45:10 -0800 Received: from fmsmsx126.amr.corp.intel.com (10.18.125.43) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 7 Feb 2017 23:45:04 -0800 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by FMSMSX126.amr.corp.intel.com (10.18.125.43) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 7 Feb 2017 23:45:04 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.177]) by SHSMSX104.ccr.corp.intel.com ([10.239.4.70]) with mapi id 14.03.0248.002; Wed, 8 Feb 2017 15:44:59 +0800 From: "Tian, Feng" To: "Ni, Ruiyu" , "edk2-devel@lists.01.org" CC: "Tian, Feng" Thread-Topic: [PATCH v2 1/6] MdeModulePkg/PciSioSerialDxe: Use MAX_UINT8 instead of PCI_BAR_ALL Thread-Index: AQHSgD5p/a+K7lQHDUuaE4XWnciHlaFevfGg Date: Wed, 8 Feb 2017 07:44:58 +0000 Message-ID: <7F1BAD85ADEA444D97065A60D2E97EE5699B0434@SHSMSX101.ccr.corp.intel.com> References: <20170206060059.595976-1-ruiyu.ni@intel.com> <20170206060059.595976-2-ruiyu.ni@intel.com> In-Reply-To: <20170206060059.595976-2-ruiyu.ni@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH v2 1/6] 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: Wed, 08 Feb 2017 07:45:13 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Feng Tian Thanks Feng -----Original Message----- From: Ni, Ruiyu=20 Sent: Monday, February 6, 2017 2:01 PM To: edk2-devel@lists.01.org Cc: Tian, Feng Subject: [PATCH v2 1/6] MdeModulePkg/PciSioSerialDxe: Use MAX_UINT8 instead= of PCI_BAR_ALL When BarIndex equals to 0xFF, default value 0 is used as the BAR index. Tho= ugh PCI_BAR_ALL and MAX_UINT8 shares the same value, using PCI_BAR_ALL is l= ike 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/B= us/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 !=3D NULL) { - BarIndex =3D (PciSerialParameter->BarIndex =3D=3D PCI_BAR_ALL) ? 0 : P= ciSerialParameter->BarIndex; + BarIndex =3D (PciSerialParameter->BarIndex =3D=3D MAX_UINT8) ? 0 :=20 + PciSerialParameter->BarIndex; Offset =3D PciSerialParameter->Offset; if (PciSerialParameter->RegisterStride !=3D 0) { SerialDevice->RegisterStride =3D PciSerialParameter->RegisterStride; -- 2.9.0.windows.1