diff options
author | Theodore Ts'o <tytso@mit.edu> | 2009-04-24 23:31:59 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2009-04-24 23:31:59 -0400 |
commit | f7c439504ccba0cca43271e651013ab97a221c62 (patch) | |
tree | 35f2489b2503bdc9273435e8b433ac58b8a1f276 /fs/ext4/super.c | |
parent | c5ca7c7636fa689a9746b6032f83aa7fffec31c6 (diff) |
ext4: Use is_power_of_2() for clarity
Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/super.c')
-rw-r--r-- | fs/ext4/super.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 3f4475daa66d..3e509bc647e3 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
@@ -1483,7 +1483,7 @@ set_qf_format: | |||
1483 | return 0; | 1483 | return 0; |
1484 | if (option < 0 || option > (1 << 30)) | 1484 | if (option < 0 || option > (1 << 30)) |
1485 | return 0; | 1485 | return 0; |
1486 | if (option & (option - 1)) { | 1486 | if (!is_power_of_2(option)) { |
1487 | printk(KERN_ERR "EXT4-fs: inode_readahead_blks" | 1487 | printk(KERN_ERR "EXT4-fs: inode_readahead_blks" |
1488 | " must be a power of 2\n"); | 1488 | " must be a power of 2\n"); |
1489 | return 0; | 1489 | return 0; |
@@ -2101,8 +2101,7 @@ static ssize_t inode_readahead_blks_store(struct ext4_attr *a, | |||
2101 | if (parse_strtoul(buf, 0x40000000, &t)) | 2101 | if (parse_strtoul(buf, 0x40000000, &t)) |
2102 | return -EINVAL; | 2102 | return -EINVAL; |
2103 | 2103 | ||
2104 | /* inode_readahead_blks must be a power of 2 */ | 2104 | if (!is_power_of_2(t)) |
2105 | if (t & (t-1)) | ||
2106 | return -EINVAL; | 2105 | return -EINVAL; |
2107 | 2106 | ||
2108 | sbi->s_inode_readahead_blks = t; | 2107 | sbi->s_inode_readahead_blks = t; |