From e1b5c1d3da05c91129120d045dfcdfc7761f44f1 Mon Sep 17 00:00:00 2001 From: Vignesh Babu BM Date: Tue, 8 May 2007 00:24:30 -0700 Subject: is_power_of_2 in fs/hfs Replace (n & (n-1)) in the context of power of 2 checks with is_power_of_2 Signed-off-by: vignesh babu Cc: Roman Zippel Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- fs/hfs/btree.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'fs/hfs') diff --git a/fs/hfs/btree.c b/fs/hfs/btree.c index 5fd0ed71f92..8a3a650abc8 100644 --- a/fs/hfs/btree.c +++ b/fs/hfs/btree.c @@ -9,6 +9,7 @@ */ #include +#include #include "btree.h" @@ -76,7 +77,7 @@ struct hfs_btree *hfs_btree_open(struct super_block *sb, u32 id, btree_keycmp ke tree->depth = be16_to_cpu(head->depth); size = tree->node_size; - if (!size || size & (size - 1)) + if (!is_power_of_2(size)) goto fail_page; if (!tree->node_count) goto fail_page; -- cgit v1.2.3