From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wg0-f44.google.com (mail-wg0-f44.google.com [74.125.82.44]) by dpdk.org (Postfix) with ESMTP id 455305A65 for ; Tue, 7 Jul 2015 11:00:54 +0200 (CEST) Received: by wgfr2 with SMTP id r2so6676514wgf.1 for ; Tue, 07 Jul 2015 02:00:54 -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:subject:date:message-id:in-reply-to :references; bh=U2Ucaa9fYcau1Juw9Hx6IjcqYHc0u61R0n6YXyVy910=; b=M2bVCva0hwfJtf29jRdidcJqXzWtE9gUmFKOADxNiFfmDhaQXaRPuqoiV4oLJrmyFu YPXadBXS8BNQ9UrzizF6P2VbKq6XqCnkrdQp46GWJiovWN4wHDSximG8Ac1daF+lsqQc xgwWtII6cDYIpj6gdL7W3b4h4eYJTVACNlNWV+ERb+SwnGS/4Gviw63aZTDdzunEKjOG lAsAqm7hfw4Oaj8fF3//8ZPPTPVvn4AZb64fs/Qjiw2t2hlNjKBQoMN6AoUBCEzZ/N7X MVRqyzh5li583KEK48YIoNDfl5fuMsrk0z3nXKRbAcMY4pVfoPut41oZOrj2YXBW3GP9 6P5g== X-Gm-Message-State: ALoCoQnupoCNhoxkk9LqOb2mGif836hdzZ49ktpPdh1A4HfinEuC1irvXydzsMQ204npG5WuaQrZ X-Received: by 10.180.98.134 with SMTP id ei6mr94960318wib.49.1436259654086; Tue, 07 Jul 2015 02:00:54 -0700 (PDT) Received: from alcyon.dev.6wind.com (6wind.net2.nerim.net. [213.41.151.210]) by mx.google.com with ESMTPSA id y19sm32737674wia.15.2015.07.07.02.00.52 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Jul 2015 02:00:53 -0700 (PDT) From: David Marchand To: dev@dpdk.org Date: Tue, 7 Jul 2015 11:00:33 +0200 Message-Id: <1436259634-7077-6-git-send-email-david.marchand@6wind.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1436259634-7077-1-git-send-email-david.marchand@6wind.com> References: <1436259634-7077-1-git-send-email-david.marchand@6wind.com> Subject: [dpdk-dev] [PATCH 5/6] eal/linux: indent file 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: Tue, 07 Jul 2015 09:00:54 -0000 With this, we should be checkpatch compliant. Signed-off-by: David Marchand --- lib/librte_eal/linuxapp/eal/eal_hugepage_info.c | 73 ++++++++++++----------- 1 file changed, 39 insertions(+), 34 deletions(-) diff --git a/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c b/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c index de3f48d..df60f6e 100644 --- a/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c +++ b/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c @@ -289,45 +289,50 @@ eal_hugepage_info_init(void) dirent_start_len) != 0) continue; - hpi = &internal_config.hugepage_info[num_sizes]; - hpi->hugepage_sz = rte_str_to_size(&dirent->d_name[dirent_start_len]); - hpi->hugedir = get_hugepage_dir(hpi->hugepage_sz); - - /* first, check if we have a mountpoint */ - if (hpi->hugedir == NULL) { - unsigned long num_pages; - - num_pages = get_num_hugepages(dirent->d_name); - if (num_pages > 0) - RTE_LOG(INFO, EAL, "%lu hugepages of size %lu reserved, " - "but no mounted hugetlbfs found for that size\n", - num_pages, hpi->hugepage_sz); - continue; - } + hpi = &internal_config.hugepage_info[num_sizes]; + hpi->hugepage_sz = + rte_str_to_size(&dirent->d_name[dirent_start_len]); + hpi->hugedir = get_hugepage_dir(hpi->hugepage_sz); + + /* first, check if we have a mountpoint */ + if (hpi->hugedir == NULL) { + unsigned long num_pages; + + num_pages = get_num_hugepages(dirent->d_name); + if (num_pages > 0) + RTE_LOG(INFO, EAL, + "%lu hugepages of size %lu reserved, " + "but no mounted hugetlbfs found for " + "that size\n", + num_pages, hpi->hugepage_sz); + continue; + } - /* try to obtain a writelock */ - hpi->lock_descriptor = open(hpi->hugedir, O_RDONLY); + /* try to obtain a writelock */ + hpi->lock_descriptor = open(hpi->hugedir, O_RDONLY); - /* if blocking lock failed */ - if (flock(hpi->lock_descriptor, LOCK_EX) == -1) { - RTE_LOG(CRIT, EAL, "Failed to lock hugepage directory!\n"); - break; - } - /* clear out the hugepages dir from unused pages */ - if (clear_hugedir(hpi->hugedir) == -1) - break; + /* if blocking lock failed */ + if (flock(hpi->lock_descriptor, LOCK_EX) == -1) { + RTE_LOG(CRIT, EAL, + "Failed to lock hugepage directory!\n"); + break; + } + /* clear out the hugepages dir from unused pages */ + if (clear_hugedir(hpi->hugedir) == -1) + break; - /* for now, put all pages into socket 0, - * later they will be sorted */ - hpi->num_pages[0] = get_num_hugepages(dirent->d_name); + /* for now, put all pages into socket 0, + * later they will be sorted */ + hpi->num_pages[0] = get_num_hugepages(dirent->d_name); #ifndef RTE_ARCH_64 - /* for 32-bit systems, limit number of hugepages to 1GB per page size */ - hpi->num_pages[0] = RTE_MIN(hpi->num_pages[0], - RTE_PGSIZE_1G / hpi->hugepage_sz); + /* for 32-bit systems, limit number of hugepages to + * 1GB per page size */ + hpi->num_pages[0] = RTE_MIN(hpi->num_pages[0], + RTE_PGSIZE_1G / hpi->hugepage_sz); #endif - num_sizes++; + num_sizes++; } closedir(dir); @@ -342,9 +347,9 @@ eal_hugepage_info_init(void) unsigned j; for (j = i+1; j < num_sizes; j++) if (internal_config.hugepage_info[j-1].hugepage_sz < - internal_config.hugepage_info[j].hugepage_sz) + internal_config.hugepage_info[j].hugepage_sz) swap_hpi(&internal_config.hugepage_info[j-1], - &internal_config.hugepage_info[j]); + &internal_config.hugepage_info[j]); } /* now we have all info, check we have at least one valid size */ -- 1.7.10.4