From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bruce Richardson Subject: [PATCH v4 3/3] eal: remove unnecessary check for primary instance Date: Tue, 24 Feb 2015 13:30:47 +0000 Message-ID: <1424784647-19367-4-git-send-email-bruce.richardson@intel.com> References: <1424703444-30761-1-git-send-email-bruce.richardson@intel.com> <1424784647-19367-1-git-send-email-bruce.richardson@intel.com> To: dev-VfR2kkLFssw@public.gmane.org Return-path: In-Reply-To: <1424784647-19367-1-git-send-email-bruce.richardson-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" In pci_uio_map_resource we check that we are in a primary process before calling pci_uio_set_bus_master. However, there is already an earlier check which means that we are always in a primary instance at this point in the code, so the check can be removed. Signed-off-by: Bruce Richardson Acked-by: David Marchand --- lib/librte_eal/linuxapp/eal/eal_pci_uio.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/librte_eal/linuxapp/eal/eal_pci_uio.c b/lib/librte_eal/linuxapp/eal/eal_pci_uio.c index c12794e..0a95376 100644 --- a/lib/librte_eal/linuxapp/eal/eal_pci_uio.c +++ b/lib/librte_eal/linuxapp/eal/eal_pci_uio.c @@ -304,11 +304,9 @@ pci_uio_map_resource(struct rte_pci_device *dev) } /* set bus master that is not done by uio_pci_generic */ - if (rte_eal_process_type() == RTE_PROC_PRIMARY) { - if (pci_uio_set_bus_master(dev->intr_handle.uio_cfg_fd)) { - RTE_LOG(ERR, EAL, "Cannot set up bus mastering!\n"); - return -1; - } + if (pci_uio_set_bus_master(dev->intr_handle.uio_cfg_fd)) { + RTE_LOG(ERR, EAL, "Cannot set up bus mastering!\n"); + return -1; } /* allocate the mapping details for secondary processes*/ -- 2.1.0