patches for DPDK stable branches
 help / color / mirror / Atom feed
From: wangyunjian <wangyunjian@huawei.com>
To: <dev@dpdk.org>
Cc: <anatoly.burakov@intel.com>, <rsanford2@gmail.com>,
	<jerry.lilijun@huawei.com>, <xudingke@huawei.com>,
	Yunjian Wang <wangyunjian@huawei.com>, <stable@dpdk.org>
Subject: [dpdk-stable] [dpdk-dev] [PATCH] malloc: cleanup coding style
Date: Thu, 12 Nov 2020 17:31:15 +0800	[thread overview]
Message-ID: <1605173475-18044-1-git-send-email-wangyunjian@huawei.com> (raw)

From: Yunjian Wang <wangyunjian@huawei.com>

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 <wangyunjian@huawei.com>
---
 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


             reply	other threads:[~2020-11-12  9:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-12  9:31 wangyunjian [this message]
2020-11-12 11:40 ` Burakov, Anatoly
2020-11-12 13:41   ` wangyunjian
2020-11-22 17:44     ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1605173475-18044-1-git-send-email-wangyunjian@huawei.com \
    --to=wangyunjian@huawei.com \
    --cc=anatoly.burakov@intel.com \
    --cc=dev@dpdk.org \
    --cc=jerry.lilijun@huawei.com \
    --cc=rsanford2@gmail.com \
    --cc=stable@dpdk.org \
    --cc=xudingke@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).