Skip to content

Commit

Permalink
malloc: fix style in free list index computation
Browse files Browse the repository at this point in the history
[ upstream commit a99d252 ]

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: b0489e7 ("malloc: fix linear complexity")

Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
  • Loading branch information
wyjwang authored and bluca committed Nov 24, 2020
1 parent 08e7b06 commit 6cd1803
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/librte_eal/common/malloc_elem.c
Original file line number Diff line number Diff line change
Expand Up @@ -382,14 +382,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;
}

/*
Expand Down

0 comments on commit 6cd1803

Please sign in to comment.