Skip to content

Commit c30365b

Browse files
yuzhenfschinatytso
authored andcommitted
ext4: remove unnecessary type castings
remove unnecessary void* type castings. Signed-off-by: Yu Zhe <yuzhe@nfschina.com> Link: https://lore.kernel.org/r/20220401081321.73735-1-yuzhe@nfschina.com Signed-off-by: Theodore Ts'o <tytso@mit.edu>
1 parent f4534c9 commit c30365b

7 files changed

Lines changed: 15 additions & 15 deletions

File tree

fs/ext4/dir.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,7 @@ int ext4_check_all_de(struct inode *dir, struct buffer_head *bh, void *buf,
648648
unsigned int offset = 0;
649649
char *top;
650650

651-
de = (struct ext4_dir_entry_2 *)buf;
651+
de = buf;
652652
top = buf + buf_size;
653653
while ((char *) de < top) {
654654
if (ext4_check_dir_entry(dir, NULL, de, bh,

fs/ext4/fast_commit.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -970,7 +970,7 @@ static int ext4_fc_write_inode_data(struct inode *inode, u32 *crc)
970970
/* Submit data for all the fast commit inodes */
971971
static int ext4_fc_submit_inode_data_all(journal_t *journal)
972972
{
973-
struct super_block *sb = (struct super_block *)(journal->j_private);
973+
struct super_block *sb = journal->j_private;
974974
struct ext4_sb_info *sbi = EXT4_SB(sb);
975975
struct ext4_inode_info *ei;
976976
int ret = 0;
@@ -1004,7 +1004,7 @@ static int ext4_fc_submit_inode_data_all(journal_t *journal)
10041004
/* Wait for completion of data for all the fast commit inodes */
10051005
static int ext4_fc_wait_inode_data_all(journal_t *journal)
10061006
{
1007-
struct super_block *sb = (struct super_block *)(journal->j_private);
1007+
struct super_block *sb = journal->j_private;
10081008
struct ext4_sb_info *sbi = EXT4_SB(sb);
10091009
struct ext4_inode_info *pos, *n;
10101010
int ret = 0;
@@ -1031,7 +1031,7 @@ static int ext4_fc_commit_dentry_updates(journal_t *journal, u32 *crc)
10311031
__acquires(&sbi->s_fc_lock)
10321032
__releases(&sbi->s_fc_lock)
10331033
{
1034-
struct super_block *sb = (struct super_block *)(journal->j_private);
1034+
struct super_block *sb = journal->j_private;
10351035
struct ext4_sb_info *sbi = EXT4_SB(sb);
10361036
struct ext4_fc_dentry_update *fc_dentry, *fc_dentry_n;
10371037
struct inode *inode;
@@ -1093,7 +1093,7 @@ __releases(&sbi->s_fc_lock)
10931093

10941094
static int ext4_fc_perform_commit(journal_t *journal)
10951095
{
1096-
struct super_block *sb = (struct super_block *)(journal->j_private);
1096+
struct super_block *sb = journal->j_private;
10971097
struct ext4_sb_info *sbi = EXT4_SB(sb);
10981098
struct ext4_inode_info *iter;
10991099
struct ext4_fc_head head;
@@ -1198,7 +1198,7 @@ static void ext4_fc_update_stats(struct super_block *sb, int status,
11981198
*/
11991199
int ext4_fc_commit(journal_t *journal, tid_t commit_tid)
12001200
{
1201-
struct super_block *sb = (struct super_block *)(journal->j_private);
1201+
struct super_block *sb = journal->j_private;
12021202
struct ext4_sb_info *sbi = EXT4_SB(sb);
12031203
int nblks = 0, ret, bsize = journal->j_blocksize;
12041204
int subtid = atomic_read(&sbi->s_fc_subtid);

fs/ext4/inline.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,14 +1083,14 @@ static void ext4_update_final_de(void *de_buf, int old_size, int new_size)
10831083
void *limit;
10841084
int de_len;
10851085

1086-
de = (struct ext4_dir_entry_2 *)de_buf;
1086+
de = de_buf;
10871087
if (old_size) {
10881088
limit = de_buf + old_size;
10891089
do {
10901090
prev_de = de;
10911091
de_len = ext4_rec_len_from_disk(de->rec_len, old_size);
10921092
de_buf += de_len;
1093-
de = (struct ext4_dir_entry_2 *)de_buf;
1093+
de = de_buf;
10941094
} while (de_buf < limit);
10951095

10961096
prev_de->rec_len = ext4_rec_len_to_disk(de_len + new_size -
@@ -1155,7 +1155,7 @@ static int ext4_finish_convert_inline_dir(handle_t *handle,
11551155
* First create "." and ".." and then copy the dir information
11561156
* back to the block.
11571157
*/
1158-
de = (struct ext4_dir_entry_2 *)target;
1158+
de = target;
11591159
de = ext4_init_dot_dotdot(inode, de,
11601160
inode->i_sb->s_blocksize, csum_size,
11611161
le32_to_cpu(((struct ext4_dir_entry_2 *)buf)->inode), 1);

fs/ext4/mballoc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2919,7 +2919,7 @@ const struct seq_operations ext4_mb_seq_groups_ops = {
29192919

29202920
int ext4_seq_mb_stats_show(struct seq_file *seq, void *offset)
29212921
{
2922-
struct super_block *sb = (struct super_block *)seq->private;
2922+
struct super_block *sb = seq->private;
29232923
struct ext4_sb_info *sbi = EXT4_SB(sb);
29242924

29252925
seq_puts(seq, "mballoc:\n");

fs/ext4/mmp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ void __dump_mmp_msg(struct super_block *sb, struct mmp_struct *mmp,
127127
*/
128128
static int kmmpd(void *data)
129129
{
130-
struct super_block *sb = (struct super_block *) data;
130+
struct super_block *sb = data;
131131
struct ext4_super_block *es = EXT4_SB(sb)->s_es;
132132
struct buffer_head *bh = EXT4_SB(sb)->s_mmp_bh;
133133
struct mmp_struct *mmp;

fs/ext4/namei.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2031,7 +2031,7 @@ int ext4_find_dest_de(struct inode *dir, struct inode *inode,
20312031
unsigned int offset = 0;
20322032
char *top;
20332033

2034-
de = (struct ext4_dir_entry_2 *)buf;
2034+
de = buf;
20352035
top = buf + buf_size - reclen;
20362036
while ((char *) de <= top) {
20372037
if (ext4_check_dir_entry(dir, NULL, de, bh,
@@ -2587,7 +2587,7 @@ int ext4_generic_delete_entry(struct inode *dir,
25872587

25882588
i = 0;
25892589
pde = NULL;
2590-
de = (struct ext4_dir_entry_2 *)entry_buf;
2590+
de = entry_buf;
25912591
while (i < buf_size - csum_size) {
25922592
if (ext4_check_dir_entry(dir, NULL, de, bh,
25932593
entry_buf, buf_size, i))

fs/ext4/super.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1397,7 +1397,7 @@ static void ext4_destroy_inode(struct inode *inode)
13971397

13981398
static void init_once(void *foo)
13991399
{
1400-
struct ext4_inode_info *ei = (struct ext4_inode_info *) foo;
1400+
struct ext4_inode_info *ei = foo;
14011401

14021402
INIT_LIST_HEAD(&ei->i_orphan);
14031403
init_rwsem(&ei->xattr_sem);
@@ -3836,7 +3836,7 @@ static struct task_struct *ext4_lazyinit_task;
38363836
*/
38373837
static int ext4_lazyinit_thread(void *arg)
38383838
{
3839-
struct ext4_lazy_init *eli = (struct ext4_lazy_init *)arg;
3839+
struct ext4_lazy_init *eli = arg;
38403840
struct list_head *pos, *n;
38413841
struct ext4_li_request *elr;
38423842
unsigned long next_wakeup, cur;

0 commit comments

Comments
 (0)