From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f170.google.com (mail-wi0-f170.google.com [209.85.212.170]) by dpdk.org (Postfix) with ESMTP id E822AC376 for ; Thu, 9 Jul 2015 11:19:49 +0200 (CEST) Received: by wiga1 with SMTP id a1so307198332wig.0 for ; Thu, 09 Jul 2015 02:19:49 -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=BdagjryXSCJb3dh8anUtwTnVMfSa6EwOgjyi0AXB7/I=; b=S/QBIvw8oFIF/xcNgJYlqQtG/MZb0pi+pgAtghGsBM+8K56WjNZxQwzZebPBWHFAce j+feJH3t2IzLsx0p2p9mvwzJRD8PzFPXCTymbfFZlIVKcSSWW/nNpeUwDNeCIqKW8br6 U4u06tO49g1Hgr/eD/e2zOmDlUqyLGKt4p+fJae0ryk5nxM+8bk1krMTD2eKWjA42FUo KkT++roi3HqpsmidgyG6tpl80BDMMq6WwKNnFbBed+33ChiLjf+Miu8hzpYJLhzcv9eI dEHvJs92BTQK6iCtXCibM/ZzPBYJmWbWYRtHrUGwr4Q1r9+yTLBk/MpgsZZRErGe95ih qETQ== X-Gm-Message-State: ALoCoQkdQZxyL55YTgEX2YRcD8fw7yq8goGWUdFPhVZNPjtfhMg604Uys5MVHtLq73D/251PQKd0 X-Received: by 10.180.20.12 with SMTP id j12mr120228008wie.4.1436433589805; Thu, 09 Jul 2015 02:19:49 -0700 (PDT) Received: from alcyon.dev.6wind.com (6wind.net2.nerim.net. [213.41.151.210]) by smtp.gmail.com with ESMTPSA id um5sm7774777wjc.1.2015.07.09.02.19.48 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Jul 2015 02:19:48 -0700 (PDT) From: David Marchand To: dev@dpdk.org Date: Thu, 9 Jul 2015 11:19:25 +0200 Message-Id: <1436433566-328-6-git-send-email-david.marchand@6wind.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1436433566-328-1-git-send-email-david.marchand@6wind.com> References: <1436259634-7077-1-git-send-email-david.marchand@6wind.com> <1436433566-328-1-git-send-email-david.marchand@6wind.com> Subject: [dpdk-dev] [PATCH v2 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: Thu, 09 Jul 2015 09:19:50 -0000 With this, we should be checkpatch compliant. Signed-off-by: David Marchand Acked-by: Sergio Gonzalez Monroy --- 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 d602350..f097e71 100644 --- a/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c +++ b/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c @@ -294,45 +294,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) { - uint32_t num_pages; - - num_pages = get_num_hugepages(dirent->d_name); - if (num_pages > 0) - RTE_LOG(INFO, EAL, "%" PRIu32 " hugepages of size %" PRIu64 " 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) { + uint32_t num_pages; + + num_pages = get_num_hugepages(dirent->d_name); + if (num_pages > 0) + RTE_LOG(INFO, EAL, + "%" PRIu32 " hugepages of size " + "%" PRIu64 " 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); @@ -347,9 +352,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