From f482394ccbca7234d29cc146d4a2b94f976ce5a1 Mon Sep 17 00:00:00 2001 From: vignesh babu Date: Sun, 15 Jul 2007 23:41:17 -0700 Subject: is_power_of_2(): jbd Replace (n & (n-1)) in the context of power of 2 checks with is_power_of_2(). Signed-off-by: vignesh babu Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- fs/jbd/revoke.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'fs/jbd') diff --git a/fs/jbd/revoke.c b/fs/jbd/revoke.c index 824e3b7d4ec..8db2fa25170 100644 --- a/fs/jbd/revoke.c +++ b/fs/jbd/revoke.c @@ -68,6 +68,7 @@ #include #include #endif +#include static struct kmem_cache *revoke_record_cache; static struct kmem_cache *revoke_table_cache; @@ -211,7 +212,7 @@ int journal_init_revoke(journal_t *journal, int hash_size) journal->j_revoke = journal->j_revoke_table[0]; /* Check that the hash_size is a power of two */ - J_ASSERT ((hash_size & (hash_size-1)) == 0); + J_ASSERT(is_power_of_2(hash_size)); journal->j_revoke->hash_size = hash_size; @@ -238,7 +239,7 @@ int journal_init_revoke(journal_t *journal, int hash_size) journal->j_revoke = journal->j_revoke_table[1]; /* Check that the hash_size is a power of two */ - J_ASSERT ((hash_size & (hash_size-1)) == 0); + J_ASSERT(is_power_of_2(hash_size)); journal->j_revoke->hash_size = hash_size; -- cgit v1.2.3