From: Vignesh Babu Date: Wed, 18 Jul 2007 13:11:02 +0000 (-0400) Subject: ext4: Use is_power_of_2() X-Git-Tag: v2.6.23-rc1~494^2~3 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=1330593eb2d055bdd6ed935886cf2c13c896b288;p=linux-2.6-omap-h63xx.git ext4: Use is_power_of_2() Replace (n & (n-1)) in the context of power of 2 checks with is_power_of_2() Signed-off-by: Vignesh Babu Cc: Signed-off-by: Andrew Morton Signed-off-by: Dave Kleikamp Signed-off-by: "Theodore Ts'o" --- diff --git a/fs/ext4/super.c b/fs/ext4/super.c index b47259f6f39..6dcbb28dc06 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -36,6 +36,7 @@ #include #include #include +#include #include @@ -1644,7 +1645,7 @@ static int ext4_fill_super (struct super_block *sb, void *data, int silent) sbi->s_inode_size = le16_to_cpu(es->s_inode_size); sbi->s_first_ino = le32_to_cpu(es->s_first_ino); if ((sbi->s_inode_size < EXT4_GOOD_OLD_INODE_SIZE) || - (sbi->s_inode_size & (sbi->s_inode_size - 1)) || + (!is_power_of_2(sbi->s_inode_size)) || (sbi->s_inode_size > blocksize)) { printk (KERN_ERR "EXT4-fs: unsupported inode size: %d\n",