From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id A4795A09D3 for ; Thu, 12 Nov 2020 10:31:37 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8499E66DA; Thu, 12 Nov 2020 10:31:36 +0100 (CET) Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) by dpdk.org (Postfix) with ESMTP id 8E1385B3C; Thu, 12 Nov 2020 10:31:32 +0100 (CET) Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4CWxDh6q7yzkfcH; Thu, 12 Nov 2020 17:31:16 +0800 (CST) Received: from localhost (10.174.187.156) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.487.0; Thu, 12 Nov 2020 17:31:20 +0800 From: wangyunjian To: CC: , , , , Yunjian Wang , Date: Thu, 12 Nov 2020 17:31:15 +0800 Message-ID: <1605173475-18044-1-git-send-email-wangyunjian@huawei.com> X-Mailer: git-send-email 1.9.5.msysgit.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.174.187.156] X-CFilter-Loop: Reflected Subject: [dpdk-stable] [dpdk-dev] [PATCH] malloc: cleanup coding style X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" From: Yunjian Wang Cleanup code style issue reported by kernel checkpatch. As follows: * ERROR:CODE_INDENT: code indent should use tabs where possible * ERROR:SPACING: spaces required around that '?' (ctx:VxE) * WARNING:INDENTED_LABEL: labels should not be indented Fixes: b0489e7bca2f ("malloc: fix linear complexity") Cc: stable@dpdk.org Signed-off-by: Yunjian Wang --- lib/librte_eal/common/malloc_elem.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/librte_eal/common/malloc_elem.c b/lib/librte_eal/common/malloc_elem.c index c70112f84d..99cbfd02dc 100644 --- a/lib/librte_eal/common/malloc_elem.c +++ b/lib/librte_eal/common/malloc_elem.c @@ -391,14 +391,14 @@ malloc_elem_free_list_index(size_t size) return 0; /* Find next power of 2 >= size. */ - log2 = sizeof(size) * 8 - __builtin_clzl(size-1); + log2 = sizeof(size) * 8 - __builtin_clzl(size - 1); /* Compute freelist index, based on log2(size). */ index = (log2 - MALLOC_MINSIZE_LOG2 + MALLOC_LOG2_INCREMENT - 1) / - MALLOC_LOG2_INCREMENT; + MALLOC_LOG2_INCREMENT; - return index <= RTE_HEAP_NUM_FREELISTS-1? - index: RTE_HEAP_NUM_FREELISTS-1; + return index <= RTE_HEAP_NUM_FREELISTS - 1 ? + index : RTE_HEAP_NUM_FREELISTS - 1; } /* -- 2.19.1