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 E3151A09D3 for ; Thu, 12 Nov 2020 12:40:35 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BA29D5AB8; Thu, 12 Nov 2020 12:40:34 +0100 (CET) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id C07045928; Thu, 12 Nov 2020 12:40:30 +0100 (CET) IronPort-SDR: uTfQKrBHTYyIreGxU3EajP2b6qlkZWuzmx4eT+7HzYDdUY8l/oRt0rMFivO7+v+yJGTJGfmm/v j7BfUnZmEVww== X-IronPort-AV: E=McAfee;i="6000,8403,9802"; a="167711358" X-IronPort-AV: E=Sophos;i="5.77,471,1596524400"; d="scan'208";a="167711358" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Nov 2020 03:40:10 -0800 IronPort-SDR: KmCyX3QcWtgFYPwWRqG7deHaLxjh5dGaJXYRHpFjjw/IlBFU6HULnHWe3Xk4P3TqlzotfTUPjv nlucO3ufkW8Q== X-IronPort-AV: E=Sophos;i="5.77,471,1596524400"; d="scan'208";a="532117953" Received: from aburakov-mobl.ger.corp.intel.com (HELO [10.213.209.231]) ([10.213.209.231]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Nov 2020 03:40:08 -0800 To: wangyunjian , dev@dpdk.org Cc: rsanford2@gmail.com, jerry.lilijun@huawei.com, xudingke@huawei.com, stable@dpdk.org References: <1605173475-18044-1-git-send-email-wangyunjian@huawei.com> From: "Burakov, Anatoly" Message-ID: Date: Thu, 12 Nov 2020 11:40:06 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <1605173475-18044-1-git-send-email-wangyunjian@huawei.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [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" On 12-Nov-20 9:31 AM, wangyunjian wrote: > 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; Here and below, I believe we usually add two indents to the continuation line, to avoid confusing with things like if statements. With that fixed, Acked-by: Anatoly Burakov > > - 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; > } > > /* > -- Thanks, Anatoly