]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/PciSioSerialDxe: Use MAX_UINT8 instead of PCI_BAR_ALL
authorRuiyu Ni <ruiyu.ni@intel.com>
Wed, 25 Jan 2017 07:22:54 +0000 (15:22 +0800)
committerRuiyu Ni <ruiyu.ni@intel.com>
Fri, 10 Feb 2017 08:52:00 +0000 (16:52 +0800)
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 <ruiyu.ni@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
MdeModulePkg/Bus/Pci/PciSioSerialDxe/Serial.c

index 65ddf5dc2ba70fc7ac3c0f3c21466b3033ce6518..a9dc8274d92fa97740b31303ffdbb97843a33442 100644 (file)
@@ -473,7 +473,7 @@ CreateSerialDevice (
   // For PCI serial device, use the information from PCD\r
   //\r
   if (PciSerialParameter != NULL) {\r
-    BarIndex = (PciSerialParameter->BarIndex == PCI_BAR_ALL) ? 0 : PciSerialParameter->BarIndex;\r
+    BarIndex = (PciSerialParameter->BarIndex == MAX_UINT8) ? 0 : PciSerialParameter->BarIndex;\r
     Offset = PciSerialParameter->Offset;\r
     if (PciSerialParameter->RegisterStride != 0) {\r
       SerialDevice->RegisterStride = PciSerialParameter->RegisterStride;\r