Code cleanup for hash_bits calculation by calling ilog2() in dcookie_init(). Signed-off-by: Chengguang Xu <cgxu519@xxxxxxxxxxx> --- fs/dcookies.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/fs/dcookies.c b/fs/dcookies.c index 6eeb61100a09..4c3253926b55 100644 --- a/fs/dcookies.c +++ b/fs/dcookies.c @@ -245,11 +245,7 @@ static int dcookie_init(void) * a power-of-two. */ hash_size = PAGE_SIZE / sizeof(struct list_head); - hash_bits = 0; - do { - hash_bits++; - } while ((hash_size >> hash_bits) != 0); - hash_bits--; + hash_bits = ilog2(hash_size); /* * Re-calculate the actual number of entries and the mask -- 2.20.1