summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiaohe Lin <linmiaohe@huawei.com>2022-02-17 17:16:09 +0800
committerVlastimil Babka <vbabka@suse.cz>2022-02-21 11:38:12 +0100
commit7d6b6cc355378a66044cbd25ccee4153bf60dea9 (patch)
treed638f7397abcb8724e97338833b3992460e655da
parentbd53ce4da252ddb1ae4257c164f80aea3d8ab90c (diff)
downloadlinux-7d6b6cc355378a66044cbd25ccee4153bf60dea9.tar.gz
linux-7d6b6cc355378a66044cbd25ccee4153bf60dea9.tar.bz2
linux-7d6b6cc355378a66044cbd25ccee4153bf60dea9.zip
mm/slab_common: use helper function is_power_of_2()
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
-rw-r--r--mm/slab_common.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/slab_common.c b/mm/slab_common.c
index 23f2ab0713b7..6ee64d6208b3 100644
--- 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);