summaryrefslogtreecommitdiffstats
path: root/fs/hfs
diff options
context:
space:
mode:
authorVignesh Babu BM <vignesh.babu@wipro.com>2007-05-08 00:24:30 -0700
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-08 11:14:59 -0700
commite1b5c1d3da05c91129120d045dfcdfc7761f44f1 (patch)
tree0d29f32fbad55a9cc90b05ef1974103b6afe4ea9 /fs/hfs
parente7d709c096487078652a1384d7a2d0e4459e18b6 (diff)
downloadlinux-stable-e1b5c1d3da05c91129120d045dfcdfc7761f44f1.tar.gz
linux-stable-e1b5c1d3da05c91129120d045dfcdfc7761f44f1.tar.bz2
linux-stable-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/hfs')
-rw-r--r--fs/hfs/btree.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/hfs/btree.c b/fs/hfs/btree.c
index 5fd0ed71f923..8a3a650abc87 100644
--- a/fs/hfs/btree.c
+++ b/fs/hfs/btree.c
@@ -9,6 +9,7 @@
*/
#include <linux/pagemap.h>
+#include <linux/log2.h>
#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;