From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f45.google.com (mail-wm0-f45.google.com [74.125.82.45]) by dpdk.org (Postfix) with ESMTP id 1D00591DC for ; Fri, 22 Jan 2016 16:27:59 +0100 (CET) Received: by mail-wm0-f45.google.com with SMTP id n5so137667768wmn.0 for ; Fri, 22 Jan 2016 07:27:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=49Eqk5WgK9wAERt0XpMnhFeceGoiBEuq79th2g5flJI=; b=RsTX7hlNhiFJM8XQwEieEuLbTb4AWXou8EqKCHWKdp+NA2y1mBjahZ6ecvzIOVGn+W 0LwllnSzkHz1xec04+57sB9XcremFERWjtUxNaXcof0OVv5zb7wjnsq5N5mpmxDqwrDG 2k43uFLxvcGbUV4d1cTcBiLXWzvg9Rx5VI1qARltNLovp/FiwsQW5vT6yEe6TvaxmAkd NMsmUiu2j1Smvw05MI1+Fp6kIiEt3KUmSUasF8Yu7dRDVM6tbxtzGi/ENvcigFPkzUjR h4KPXMjE69WKzJsmkbf2mghUFdDtgd5sbLzDejzHeO+fUcl1/S0TizITcrhDrBpzPfjD mFrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=49Eqk5WgK9wAERt0XpMnhFeceGoiBEuq79th2g5flJI=; b=hjmT+4HVJutUOyMPG/IF2jClz+OUVq37JQ3EVyb4HeTKZXIdZpgsUvlg0oxiGIn+0K ACpzVWHsCOL487T15+mE+eD/bVVaAk3yeJ7gps6nfc3v9Bl/0jKh6Q9nnRHCT3/H2CB1 9fk57/8d4MJwRqaEnWw/rR5rQCHCs8BpejZy6fe6vLGaXo21g+sOvQYXhMtthR9Y7msX 8vUKP3y+3sPdcseFAk4Lrgf11Z6qodS0yy9ui6q9KidsZQrtNxvcgJXF85CaZaIhybXJ v7qYSuB00GDbC2hfqfPZ2zF9fD6etlLsflvgn88Un8tpF4RhocKmd5RZftsmXD6iyfm9 ck0Q== X-Gm-Message-State: AG10YOQ8E7uqC6I1q8EMWbmcOo1d6ivR5ayrhjZPNgHL8VwuNCkSG/r6BZdDu/B0uOq/nz+y X-Received: by 10.28.5.213 with SMTP id 204mr4051860wmf.20.1453476477982; Fri, 22 Jan 2016 07:27:57 -0800 (PST) Received: from gloops.dev.6wind.com (144.77.126.78.rev.sfr.net. [78.126.77.144]) by smtp.gmail.com with ESMTPSA id w73sm3359464wmw.21.2016.01.22.07.27.56 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 22 Jan 2016 07:27:57 -0800 (PST) From: David Marchand To: dev@dpdk.org Date: Fri, 22 Jan 2016 16:27:41 +0100 Message-Id: <1453476464-31767-7-git-send-email-david.marchand@6wind.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1453476464-31767-1-git-send-email-david.marchand@6wind.com> References: <1453476464-31767-1-git-send-email-david.marchand@6wind.com> Cc: viktorin@rehivetech.com Subject: [dpdk-dev] [PATCH 6/9] pci: cosmetic change X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jan 2016 15:27:59 -0000 Indent previous commit, rename functions (internal and local functions do not need rte_eal_ prefix). Signed-off-by: David Marchand --- lib/librte_eal/common/eal_common_pci.c | 106 ++++++++++++++++----------------- 1 file changed, 52 insertions(+), 54 deletions(-) diff --git a/lib/librte_eal/common/eal_common_pci.c b/lib/librte_eal/common/eal_common_pci.c index 44549f7..769c42e 100644 --- a/lib/librte_eal/common/eal_common_pci.c +++ b/lib/librte_eal/common/eal_common_pci.c @@ -206,50 +206,49 @@ pci_driver_supports_device(const struct rte_pci_driver *dr, * driver. */ static int -rte_eal_pci_probe_one_driver(struct rte_pci_driver *dr, - struct rte_pci_device *dev) +pci_probe_device(struct rte_pci_driver *dr, struct rte_pci_device *dev) { int ret; - struct rte_pci_addr *loc = &dev->addr; + struct rte_pci_addr *loc = &dev->addr; - RTE_LOG(DEBUG, EAL, "PCI device "PCI_PRI_FMT" on NUMA socket %i\n", - loc->domain, loc->bus, loc->devid, loc->function, - dev->numa_node); + RTE_LOG(DEBUG, EAL, "PCI device "PCI_PRI_FMT" on NUMA socket %i\n", + loc->domain, loc->bus, loc->devid, loc->function, + dev->numa_node); - RTE_LOG(DEBUG, EAL, " probe driver: %x:%x %s\n", dev->id.vendor_id, - dev->id.device_id, dr->name); + RTE_LOG(DEBUG, EAL, " probe driver: %x:%x %s\n", dev->id.vendor_id, + dev->id.device_id, dr->name); - /* no initialization when blacklisted, return without error */ - if (dev->devargs != NULL && - dev->devargs->type == RTE_DEVTYPE_BLACKLISTED_PCI) { - RTE_LOG(DEBUG, EAL, " Device is blacklisted, not initializing\n"); - return 1; - } + /* no initialization when blacklisted, return without error */ + if (dev->devargs != NULL && + dev->devargs->type == RTE_DEVTYPE_BLACKLISTED_PCI) { + RTE_LOG(DEBUG, EAL, " Device is blacklisted, not initializing\n"); + return 1; + } - if (dr->drv_flags & RTE_PCI_DRV_NEED_MAPPING) { + if (dr->drv_flags & RTE_PCI_DRV_NEED_MAPPING) { #ifdef RTE_PCI_CONFIG - /* - * Set PCIe config space for high performance. - * Return value can be ignored. - */ - pci_config_space_set(dev); + /* + * Set PCIe config space for high performance. + * Return value can be ignored. + */ + pci_config_space_set(dev); #endif - /* map resources for devices that use igb_uio */ - ret = pci_map_device(dev); - if (ret != 0) - return ret; - } else if (dr->drv_flags & RTE_PCI_DRV_FORCE_UNBIND && - rte_eal_process_type() == RTE_PROC_PRIMARY) { - /* unbind current driver */ - if (pci_unbind_kernel_driver(dev) < 0) - return -1; - } - - /* reference driver structure */ - dev->driver = dr; - - /* call the driver devinit() function */ - return dr->devinit(dr, dev); + /* map resources for devices that use igb_uio */ + ret = pci_map_device(dev); + if (ret != 0) + return ret; + } else if (dr->drv_flags & RTE_PCI_DRV_FORCE_UNBIND && + rte_eal_process_type() == RTE_PROC_PRIMARY) { + /* unbind current driver */ + if (pci_unbind_kernel_driver(dev) < 0) + return -1; + } + + /* reference driver structure */ + dev->driver = dr; + + /* call the driver devinit() function */ + return dr->devinit(dr, dev); } /* @@ -257,29 +256,28 @@ rte_eal_pci_probe_one_driver(struct rte_pci_driver *dr, * driver. */ static int -rte_eal_pci_detach_dev(struct rte_pci_driver *dr, - struct rte_pci_device *dev) +pci_detach_device(struct rte_pci_driver *dr, struct rte_pci_device *dev) { - struct rte_pci_addr *loc = &dev->addr; + struct rte_pci_addr *loc = &dev->addr; - RTE_LOG(DEBUG, EAL, "PCI device "PCI_PRI_FMT" on NUMA socket %i\n", - loc->domain, loc->bus, loc->devid, - loc->function, dev->numa_node); + RTE_LOG(DEBUG, EAL, "PCI device "PCI_PRI_FMT" on NUMA socket %i\n", + loc->domain, loc->bus, loc->devid, + loc->function, dev->numa_node); - RTE_LOG(DEBUG, EAL, " remove driver: %x:%x %s\n", dev->id.vendor_id, - dev->id.device_id, dr->name); + RTE_LOG(DEBUG, EAL, " remove driver: %x:%x %s\n", dev->id.vendor_id, + dev->id.device_id, dr->name); - if (dr->devuninit && (dr->devuninit(dev) < 0)) - return -1; /* negative value is an error */ + if (dr->devuninit && (dr->devuninit(dev) < 0)) + return -1; /* negative value is an error */ - /* clear driver structure */ - dev->driver = NULL; + /* clear driver structure */ + dev->driver = NULL; - if (dr->drv_flags & RTE_PCI_DRV_NEED_MAPPING) - /* unmap resources for devices that use igb_uio */ - pci_unmap_device(dev); + if (dr->drv_flags & RTE_PCI_DRV_NEED_MAPPING) + /* unmap resources for devices that use igb_uio */ + pci_unmap_device(dev); - return 0; + return 0; } /* @@ -297,7 +295,7 @@ pci_probe_all_drivers(struct rte_pci_device *dev) if (!pci_driver_supports_device(dr, dev)) continue; - rc = rte_eal_pci_probe_one_driver(dr, dev); + rc = pci_probe_device(dr, dev); if (rc < 0) /* negative value is an error */ return -1; @@ -324,7 +322,7 @@ pci_detach_all_drivers(struct rte_pci_device *dev) if (!pci_driver_supports_device(dr, dev)) continue; - rc = rte_eal_pci_detach_dev(dr, dev); + rc = pci_detach_device(dr, dev); if (rc < 0) /* negative value is an error */ return -1; -- 1.9.1