Commit 2716b802 authored by Theodore Ts'o's avatar Theodore Ts'o

ext4: remove redundundant "(char *) bh->b_data" casts

The b_data field of the buffer_head is already a char *, so there's no
point casting it to a char *.
Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
parent 7e936b73
...@@ -1145,7 +1145,7 @@ static int ext4_setup_new_descs(handle_t *handle, struct super_block *sb, ...@@ -1145,7 +1145,7 @@ static int ext4_setup_new_descs(handle_t *handle, struct super_block *sb,
*/ */
gdb_bh = sbi->s_group_desc[gdb_num]; gdb_bh = sbi->s_group_desc[gdb_num];
/* Update group descriptor block for new group */ /* Update group descriptor block for new group */
gdp = (struct ext4_group_desc *)((char *)gdb_bh->b_data + gdp = (struct ext4_group_desc *)(gdb_bh->b_data +
gdb_off * EXT4_DESC_SIZE(sb)); gdb_off * EXT4_DESC_SIZE(sb));
memset(gdp, 0, EXT4_DESC_SIZE(sb)); memset(gdp, 0, EXT4_DESC_SIZE(sb));
......
...@@ -3126,7 +3126,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) ...@@ -3126,7 +3126,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
* Note: s_es must be initialized as soon as possible because * Note: s_es must be initialized as soon as possible because
* some ext4 macro-instructions depend on its value * some ext4 macro-instructions depend on its value
*/ */
es = (struct ext4_super_block *) (((char *)bh->b_data) + offset); es = (struct ext4_super_block *) (bh->b_data + offset);
sbi->s_es = es; sbi->s_es = es;
sb->s_magic = le16_to_cpu(es->s_magic); sb->s_magic = le16_to_cpu(es->s_magic);
if (sb->s_magic != EXT4_SUPER_MAGIC) if (sb->s_magic != EXT4_SUPER_MAGIC)
...@@ -3335,7 +3335,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) ...@@ -3335,7 +3335,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
"Can't read superblock on 2nd try"); "Can't read superblock on 2nd try");
goto failed_mount; goto failed_mount;
} }
es = (struct ext4_super_block *)(((char *)bh->b_data) + offset); es = (struct ext4_super_block *)(bh->b_data + offset);
sbi->s_es = es; sbi->s_es = es;
if (es->s_magic != cpu_to_le16(EXT4_SUPER_MAGIC)) { if (es->s_magic != cpu_to_le16(EXT4_SUPER_MAGIC)) {
ext4_msg(sb, KERN_ERR, ext4_msg(sb, KERN_ERR,
...@@ -3976,7 +3976,7 @@ static journal_t *ext4_get_dev_journal(struct super_block *sb, ...@@ -3976,7 +3976,7 @@ static journal_t *ext4_get_dev_journal(struct super_block *sb,
goto out_bdev; goto out_bdev;
} }
es = (struct ext4_super_block *) (((char *)bh->b_data) + offset); es = (struct ext4_super_block *) (bh->b_data + offset);
if ((le16_to_cpu(es->s_magic) != EXT4_SUPER_MAGIC) || if ((le16_to_cpu(es->s_magic) != EXT4_SUPER_MAGIC) ||
!(le32_to_cpu(es->s_feature_incompat) & !(le32_to_cpu(es->s_feature_incompat) &
EXT4_FEATURE_INCOMPAT_JOURNAL_DEV)) { EXT4_FEATURE_INCOMPAT_JOURNAL_DEV)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment