pci: rework ioport map error handling
authorHuawei Xie <huawei.xie@intel.com>
Tue, 8 Mar 2016 15:33:41 +0000 (23:33 +0800)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Wed, 9 Mar 2016 23:36:51 +0000 (00:36 +0100)
Signed-off-by: Huawei Xie <huawei.xie@intel.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Acked-by: David Marchand <david.marchand@6wind.com>
lib/librte_eal/linuxapp/eal/eal_pci.c

index f029957..3c2198a 100644 (file)
@@ -607,12 +607,11 @@ int
 rte_eal_pci_ioport_map(struct rte_pci_device *dev, int bar,
                       struct rte_pci_ioport *p)
 {
-       int ret;
+       int ret = -1;
 
        switch (dev->kdrv) {
 #ifdef VFIO_PRESENT
        case RTE_KDRV_VFIO:
-               ret = -1;
                if (pci_vfio_is_enabled())
                        ret = pci_vfio_ioport_map(dev, bar, p);
                break;
@@ -623,10 +622,7 @@ rte_eal_pci_ioport_map(struct rte_pci_device *dev, int bar,
                break;
        default:
 #if defined(RTE_ARCH_X86)
-               /* special case for x86 ... */
                ret = pci_ioport_map(dev, bar, p);
-#else
-               ret = -1;
 #endif
                break;
        }