From: Vignesh Babu BM 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 --- fs/hfs/btree.c | 3 ++- fs/hfsplus/btree.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff -puN fs/hfs/btree.c~is_power_of_2-in-fs-hfs fs/hfs/btree.c --- a/fs/hfs/btree.c~is_power_of_2-in-fs-hfs +++ a/fs/hfs/btree.c @@ -9,6 +9,7 @@ */ #include +#include #include "btree.h" @@ -76,7 +77,7 @@ struct hfs_btree *hfs_btree_open(struct 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; diff -puN fs/hfsplus/btree.c~is_power_of_2-in-fs-hfs fs/hfsplus/btree.c --- a/fs/hfsplus/btree.c~is_power_of_2-in-fs-hfs +++ a/fs/hfsplus/btree.c @@ -10,6 +10,7 @@ #include #include +#include #include "hfsplus_fs.h" #include "hfsplus_raw.h" @@ -69,7 +70,7 @@ struct hfs_btree *hfs_btree_open(struct } 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; _