From patchwork Fri Mar 27 08:39:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tetsuya Mukawa X-Patchwork-Id: 4157 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 44BAC5A85; Fri, 27 Mar 2015 09:39:36 +0100 (CET) Received: from mail-pd0-f182.google.com (mail-pd0-f182.google.com [209.85.192.182]) by dpdk.org (Postfix) with ESMTP id 3F5243238 for ; Fri, 27 Mar 2015 09:39:30 +0100 (CET) Received: by pdbop1 with SMTP id op1so89904730pdb.2 for ; Fri, 27 Mar 2015 01:39:29 -0700 (PDT) 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=fhrk1ljHNgJD/TSalurDjqBjxWLgOvbzpz5BlRytGeY=; b=I8k9kle3FYD6gnIeL1UM6g6K3j5103t+Vewt7fdRWvLv54wEhagf2k3KoFfgd7J4kL uBR1XNOY362ZOIReiq26+dgI4zruH6wfUPCvTX2A0pCYKVplU6HmEuekV34C6jGsWZI0 6tDeG+rrloQYgeTVHGFLnAdpqTibxqrcq3ZWdFaK2HSyAM2IE8MbBYMxQm3MzYUyY9nk Q24ZhOTl+byjK7Z2pAORyaliSSCzF40k87iyxSgDtucpoh/ln1en81mRAh/3Takt1LiP JrDAFjpqibCEQWbYHiDGSm+j3q8dV0yxX6v9dExWGFnhkDn0lS4d2axn4Adzwqarhj92 oi+Q== X-Gm-Message-State: ALoCoQlP8KQjjno/2S3GVpkgBw3tTaaa17y08epxNqJlsm5C3THhDZh565DEEGKWGyoIHRrqjqVg X-Received: by 10.67.14.73 with SMTP id fe9mr33924811pad.10.1427445569622; Fri, 27 Mar 2015 01:39:29 -0700 (PDT) Received: from localhost.localdomain (napt.igel.co.jp. [219.106.231.132]) by mx.google.com with ESMTPSA id fz1sm1396671pbb.12.2015.03.27.01.39.27 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 27 Mar 2015 01:39:28 -0700 (PDT) From: Tetsuya Mukawa To: dev@dpdk.org Date: Fri, 27 Mar 2015 17:39:09 +0900 Message-Id: <1427445553-3151-2-git-send-email-mukawa@igel.co.jp> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1427445553-3151-1-git-send-email-mukawa@igel.co.jp> References: <1426584645-28828-7-git-send-email-mukawa@igel.co.jp> <1427445553-3151-1-git-send-email-mukawa@igel.co.jp> Subject: [dpdk-dev] [PATCH v3 1/5] eal: Fix coding style of eal_pci.c and eal_pci_uio.c 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This patch fixes coding style of below files in linuxapp and bsdapp. - eal_pci.c - eal_pci_uio.c Signed-off-by: Tetsuya Mukawa --- lib/librte_eal/bsdapp/eal/eal_pci.c | 24 +++++++++++++----------- lib/librte_eal/linuxapp/eal/eal_pci_uio.c | 12 ++++++++---- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/lib/librte_eal/bsdapp/eal/eal_pci.c b/lib/librte_eal/bsdapp/eal/eal_pci.c index fe3ef86..3a22b49 100644 --- a/lib/librte_eal/bsdapp/eal/eal_pci.c +++ b/lib/librte_eal/bsdapp/eal/eal_pci.c @@ -161,9 +161,10 @@ fail: static int pci_uio_map_secondary(struct rte_pci_device *dev) { - size_t i; - struct uio_resource *uio_res; - struct uio_res_list *uio_res_list = RTE_TAILQ_CAST(rte_uio_tailq.head, uio_res_list); + size_t i; + struct uio_resource *uio_res; + struct uio_res_list *uio_res_list = + RTE_TAILQ_CAST(rte_uio_tailq.head, uio_res_list); TAILQ_FOREACH(uio_res, uio_res_list, next) { @@ -179,10 +180,10 @@ pci_uio_map_secondary(struct rte_pci_device *dev) != uio_res->maps[i].addr) { RTE_LOG(ERR, EAL, "Cannot mmap device resource\n"); - return (-1); + return -1; } } - return (0); + return 0; } RTE_LOG(ERR, EAL, "Cannot find resource for device\n"); @@ -201,7 +202,8 @@ pci_uio_map_resource(struct rte_pci_device *dev) uint64_t pagesz; struct rte_pci_addr *loc = &dev->addr; struct uio_resource *uio_res; - struct uio_res_list *uio_res_list = RTE_TAILQ_CAST(rte_uio_tailq.head, uio_res_list); + struct uio_res_list *uio_res_list = + RTE_TAILQ_CAST(rte_uio_tailq.head, uio_res_list); struct uio_map *maps; dev->intr_handle.fd = -1; @@ -209,7 +211,7 @@ pci_uio_map_resource(struct rte_pci_device *dev) /* secondary processes - use already recorded details */ if (rte_eal_process_type() != RTE_PROC_PRIMARY) - return (pci_uio_map_secondary(dev)); + return pci_uio_map_secondary(dev); snprintf(devname, sizeof(devname), "/dev/uio@pci:%u:%u:%u", dev->addr.bus, dev->addr.devid, dev->addr.function); @@ -233,7 +235,7 @@ pci_uio_map_resource(struct rte_pci_device *dev) if ((uio_res = rte_zmalloc("UIO_RES", sizeof (*uio_res), 0)) == NULL) { RTE_LOG(ERR, EAL, "%s(): cannot store uio mmap details\n", __func__); - return (-1); + return -1; } snprintf(uio_res->path, sizeof(uio_res->path), "%s", devname); @@ -261,7 +263,7 @@ pci_uio_map_resource(struct rte_pci_device *dev) (size_t)maps[j].size) ) == NULL) { rte_free(uio_res); - return (-1); + return -1; } maps[j].addr = mapaddr; @@ -271,7 +273,7 @@ pci_uio_map_resource(struct rte_pci_device *dev) TAILQ_INSERT_TAIL(uio_res_list, uio_res, next); - return (0); + return 0; } /* Scan one pci sysfs entry, and fill the devices list from it. */ @@ -311,7 +313,7 @@ pci_scan_one(int dev_pci_fd, struct pci_conf *conf) /* FreeBSD has no NUMA support (yet) */ dev->numa_node = 0; -/* parse resources */ + /* parse resources */ switch (conf->pc_hdr & PCIM_HDRTYPE) { case PCIM_HDRTYPE_NORMAL: max = PCIR_MAX_BAR_0; diff --git a/lib/librte_eal/linuxapp/eal/eal_pci_uio.c b/lib/librte_eal/linuxapp/eal/eal_pci_uio.c index 2d1c69b..9cdf24f 100644 --- a/lib/librte_eal/linuxapp/eal/eal_pci_uio.c +++ b/lib/librte_eal/linuxapp/eal/eal_pci_uio.c @@ -92,7 +92,8 @@ pci_uio_map_secondary(struct rte_pci_device *dev) { int fd, i; struct mapped_pci_resource *uio_res; - struct mapped_pci_res_list *uio_res_list = RTE_TAILQ_CAST(rte_uio_tailq.head, mapped_pci_res_list); + struct mapped_pci_res_list *uio_res_list = + RTE_TAILQ_CAST(rte_uio_tailq.head, mapped_pci_res_list); TAILQ_FOREACH(uio_res, uio_res_list, next) { @@ -272,7 +273,8 @@ pci_uio_map_resource(struct rte_pci_device *dev) uint64_t phaddr; struct rte_pci_addr *loc = &dev->addr; struct mapped_pci_resource *uio_res; - struct mapped_pci_res_list *uio_res_list = RTE_TAILQ_CAST(rte_uio_tailq.head, mapped_pci_res_list); + struct mapped_pci_res_list *uio_res_list = + RTE_TAILQ_CAST(rte_uio_tailq.head, mapped_pci_res_list); struct pci_map *maps; dev->intr_handle.fd = -1; @@ -412,7 +414,8 @@ static struct mapped_pci_resource * pci_uio_find_resource(struct rte_pci_device *dev) { struct mapped_pci_resource *uio_res; - struct mapped_pci_res_list *uio_res_list = RTE_TAILQ_CAST(rte_uio_tailq.head, mapped_pci_res_list); + struct mapped_pci_res_list *uio_res_list = + RTE_TAILQ_CAST(rte_uio_tailq.head, mapped_pci_res_list); if (dev == NULL) return NULL; @@ -431,7 +434,8 @@ void pci_uio_unmap_resource(struct rte_pci_device *dev) { struct mapped_pci_resource *uio_res; - struct mapped_pci_res_list *uio_res_list = RTE_TAILQ_CAST(rte_uio_tailq.head, mapped_pci_res_list); + struct mapped_pci_res_list *uio_res_list = + RTE_TAILQ_CAST(rte_uio_tailq.head, mapped_pci_res_list); if (dev == NULL) return;