From: Huawei Xie Date: Tue, 8 Mar 2016 15:33:41 +0000 (+0800) Subject: pci: rework ioport map error handling X-Git-Tag: spdx-start~7516 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=bd80d4730aca;p=dpdk.git pci: rework ioport map error handling Signed-off-by: Huawei Xie Acked-by: Yuanhan Liu Acked-by: David Marchand --- diff --git a/lib/librte_eal/linuxapp/eal/eal_pci.c b/lib/librte_eal/linuxapp/eal/eal_pci.c index f0299574a2..3c2198a152 100644 --- a/lib/librte_eal/linuxapp/eal/eal_pci.c +++ b/lib/librte_eal/linuxapp/eal/eal_pci.c @@ -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; }