projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bd53ce4
)
mm/slab_common: use helper function is_power_of_2()
author
Miaohe Lin
<linmiaohe@huawei.com>
Thu, 17 Feb 2022 09:16:09 +0000
(17:16 +0800)
committer
Vlastimil Babka
<vbabka@suse.cz>
Mon, 21 Feb 2022 10:38:12 +0000
(11:38 +0100)
Use helper function is_power_of_2() to check if KMALLOC_MIN_SIZE is power
of two. Minor readability improvement.
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Link:
https://lore.kernel.org/r/20220217091609.8214-1-linmiaohe@huawei.com
mm/slab_common.c
patch
|
blob
|
history
diff --git
a/mm/slab_common.c
b/mm/slab_common.c
index 23f2ab0713b7748accfb7c1154f1f93b412be67c..6ee64d6208b395980d346d8bf4518bd77eec3f60 100644
(file)
--- a/
mm/slab_common.c
+++ b/
mm/slab_common.c
@@
-807,7
+807,7
@@
void __init setup_kmalloc_cache_index_table(void)
unsigned int i;
BUILD_BUG_ON(KMALLOC_MIN_SIZE > 256 ||
-
(KMALLOC_MIN_SIZE & (KMALLOC_MIN_SIZE - 1)
));
+
!is_power_of_2(KMALLOC_MIN_SIZE
));
for (i = 8; i < KMALLOC_MIN_SIZE; i += 8) {
unsigned int elem = size_index_elem(i);