Skip to content

Commit 57e94d8

Browse files
namhyungjankara
authored andcommitted
ext3: Remove unnecessary casts on bh->b_data
bh->b_data is already a pointer to char so casts to 'char *' should be meaningless. Remove them. Signed-off-by: Namhyung Kim <namhyung@gmail.com> Signed-off-by: Jan Kara <jack@suse.cz>
1 parent df0d6b8 commit 57e94d8

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

‎fs/ext3/balloc.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -792,9 +792,9 @@ find_next_usable_block(ext3_grpblk_t start, struct buffer_head *bh,
792792
if (here < 0)
793793
here = 0;
794794

795-
p = ((char *)bh->b_data) + (here >> 3);
795+
p = bh->b_data + (here >> 3);
796796
r = memscan(p, 0, ((maxblocks + 7) >> 3) - (here >> 3));
797-
next = (r - ((char *)bh->b_data)) << 3;
797+
next = (r - bh->b_data) << 3;
798798

799799
if (next < maxblocks && next >= start && ext3_test_allocatable(next, bh))
800800
return next;

‎fs/ext3/super.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1654,7 +1654,7 @@ static int ext3_fill_super (struct super_block *sb, void *data, int silent)
16541654
* Note: s_es must be initialized as soon as possible because
16551655
* some ext3 macro-instructions depend on its value
16561656
*/
1657-
es = (struct ext3_super_block *) (((char *)bh->b_data) + offset);
1657+
es = (struct ext3_super_block *) (bh->b_data + offset);
16581658
sbi->s_es = es;
16591659
sb->s_magic = le16_to_cpu(es->s_magic);
16601660
if (sb->s_magic != EXT3_SUPER_MAGIC)
@@ -1765,7 +1765,7 @@ static int ext3_fill_super (struct super_block *sb, void *data, int silent)
17651765
"error: can't read superblock on 2nd try");
17661766
goto failed_mount;
17671767
}
1768-
es = (struct ext3_super_block *)(((char *)bh->b_data) + offset);
1768+
es = (struct ext3_super_block *)(bh->b_data + offset);
17691769
sbi->s_es = es;
17701770
if (es->s_magic != cpu_to_le16(EXT3_SUPER_MAGIC)) {
17711771
ext3_msg(sb, KERN_ERR,
@@ -2168,7 +2168,7 @@ static journal_t *ext3_get_dev_journal(struct super_block *sb,
21682168
goto out_bdev;
21692169
}
21702170

2171-
es = (struct ext3_super_block *) (((char *)bh->b_data) + offset);
2171+
es = (struct ext3_super_block *) (bh->b_data + offset);
21722172
if ((le16_to_cpu(es->s_magic) != EXT3_SUPER_MAGIC) ||
21732173
!(le32_to_cpu(es->s_feature_incompat) &
21742174
EXT3_FEATURE_INCOMPAT_JOURNAL_DEV)) {

0 commit comments

Comments
 (0)