summaryrefslogtreecommitdiffstats
path: root/fs/hfsplus/btree.c
diff options
context:
space:
mode:
authorVignesh Babu BM <vignesh.babu@wipro.com>2007-05-08 09:24:30 +0200
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-08 20:14:59 +0200
commite1b5c1d3da05c91129120d045dfcdfc7761f44f1 (patch)
tree0d29f32fbad55a9cc90b05ef1974103b6afe4ea9 /fs/hfsplus/btree.c
parentis_power_of_2 in fat (diff)
downloadlinux-e1b5c1d3da05c91129120d045dfcdfc7761f44f1.tar.xz
linux-e1b5c1d3da05c91129120d045dfcdfc7761f44f1.zip
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 <vignesh.babu@wipro.com> Cc: Roman Zippel <zippel@linux-m68k.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/hfsplus/btree.c')
-rw-r--r--fs/hfsplus/btree.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/hfsplus/btree.c b/fs/hfsplus/btree.c
index a9b9e872e29a..90ebab753d30 100644
--- a/fs/hfsplus/btree.c
+++ b/fs/hfsplus/btree.c
@@ -10,6 +10,7 @@
#include <linux/slab.h>
#include <linux/pagemap.h>
+#include <linux/log2.h>
#include "hfsplus_fs.h"
#include "hfsplus_raw.h"
@@ -69,7 +70,7 @@ struct hfs_btree *hfs_btree_open(struct super_block *sb, u32 id)
}
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;