]> git.baikalelectronics.ru Git - kernel.git/commitdiff
ext4: remove unnecessary type castings
authorYu Zhe <yuzhe@nfschina.com>
Fri, 1 Apr 2022 08:13:21 +0000 (01:13 -0700)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 11 May 2022 19:19:06 +0000 (15:19 -0400)
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>
fs/ext4/dir.c
fs/ext4/fast_commit.c
fs/ext4/inline.c
fs/ext4/mballoc.c
fs/ext4/mmp.c
fs/ext4/namei.c
fs/ext4/super.c

index a6bb86f52b9aa27363cf4932fd016548661e7dc7..fc982d2dc0715be55b10c237ec4624ea17372cda 100644 (file)
@@ -648,7 +648,7 @@ int ext4_check_all_de(struct inode *dir, struct buffer_head *bh, void *buf,
        unsigned int offset = 0;
        char *top;
 
-       de = (struct ext4_dir_entry_2 *)buf;
+       de = buf;
        top = buf + buf_size;
        while ((char *) de < top) {
                if (ext4_check_dir_entry(dir, NULL, de, bh,
index 3d72565ec6e85f8a6cb0cf84d8df4f44845e06fe..7b0b57be86152217da98617120c24bd886ec3816 100644 (file)
@@ -970,7 +970,7 @@ static int ext4_fc_write_inode_data(struct inode *inode, u32 *crc)
 /* Submit data for all the fast commit inodes */
 static int ext4_fc_submit_inode_data_all(journal_t *journal)
 {
-       struct super_block *sb = (struct super_block *)(journal->j_private);
+       struct super_block *sb = journal->j_private;
        struct ext4_sb_info *sbi = EXT4_SB(sb);
        struct ext4_inode_info *ei;
        int ret = 0;
@@ -1004,7 +1004,7 @@ static int ext4_fc_submit_inode_data_all(journal_t *journal)
 /* Wait for completion of data for all the fast commit inodes */
 static int ext4_fc_wait_inode_data_all(journal_t *journal)
 {
-       struct super_block *sb = (struct super_block *)(journal->j_private);
+       struct super_block *sb = journal->j_private;
        struct ext4_sb_info *sbi = EXT4_SB(sb);
        struct ext4_inode_info *pos, *n;
        int ret = 0;
@@ -1031,7 +1031,7 @@ static int ext4_fc_commit_dentry_updates(journal_t *journal, u32 *crc)
 __acquires(&sbi->s_fc_lock)
 __releases(&sbi->s_fc_lock)
 {
-       struct super_block *sb = (struct super_block *)(journal->j_private);
+       struct super_block *sb = journal->j_private;
        struct ext4_sb_info *sbi = EXT4_SB(sb);
        struct ext4_fc_dentry_update *fc_dentry, *fc_dentry_n;
        struct inode *inode;
@@ -1093,7 +1093,7 @@ lock_and_exit:
 
 static int ext4_fc_perform_commit(journal_t *journal)
 {
-       struct super_block *sb = (struct super_block *)(journal->j_private);
+       struct super_block *sb = journal->j_private;
        struct ext4_sb_info *sbi = EXT4_SB(sb);
        struct ext4_inode_info *iter;
        struct ext4_fc_head head;
@@ -1198,7 +1198,7 @@ static void ext4_fc_update_stats(struct super_block *sb, int status,
  */
 int ext4_fc_commit(journal_t *journal, tid_t commit_tid)
 {
-       struct super_block *sb = (struct super_block *)(journal->j_private);
+       struct super_block *sb = journal->j_private;
        struct ext4_sb_info *sbi = EXT4_SB(sb);
        int nblks = 0, ret, bsize = journal->j_blocksize;
        int subtid = atomic_read(&sbi->s_fc_subtid);
index 9c076262770d9cbcf6f9dc64decb0844b9b6616b..13a63e3639b195fa476ef29b63bb67b28771bbde 100644 (file)
@@ -1083,14 +1083,14 @@ static void ext4_update_final_de(void *de_buf, int old_size, int new_size)
        void *limit;
        int de_len;
 
-       de = (struct ext4_dir_entry_2 *)de_buf;
+       de = de_buf;
        if (old_size) {
                limit = de_buf + old_size;
                do {
                        prev_de = de;
                        de_len = ext4_rec_len_from_disk(de->rec_len, old_size);
                        de_buf += de_len;
-                       de = (struct ext4_dir_entry_2 *)de_buf;
+                       de = de_buf;
                } while (de_buf < limit);
 
                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,
         * First create "." and ".." and then copy the dir information
         * back to the block.
         */
-       de = (struct ext4_dir_entry_2 *)target;
+       de = target;
        de = ext4_init_dot_dotdot(inode, de,
                inode->i_sb->s_blocksize, csum_size,
                le32_to_cpu(((struct ext4_dir_entry_2 *)buf)->inode), 1);
index 252c168454c7fcfd83a89a7207351190395dba86..dcb81352b8642b6354a530d961a78ecd1e0f60f3 100644 (file)
@@ -2919,7 +2919,7 @@ const struct seq_operations ext4_mb_seq_groups_ops = {
 
 int ext4_seq_mb_stats_show(struct seq_file *seq, void *offset)
 {
-       struct super_block *sb = (struct super_block *)seq->private;
+       struct super_block *sb = seq->private;
        struct ext4_sb_info *sbi = EXT4_SB(sb);
 
        seq_puts(seq, "mballoc:\n");
index cebea4270817e7c0218cc2f3034449ce0d0ef342..79d05e464c432594aeed09ad0f8c3a1c3101a592 100644 (file)
@@ -127,7 +127,7 @@ void __dump_mmp_msg(struct super_block *sb, struct mmp_struct *mmp,
  */
 static int kmmpd(void *data)
 {
-       struct super_block *sb = (struct super_block *) data;
+       struct super_block *sb = data;
        struct ext4_super_block *es = EXT4_SB(sb)->s_es;
        struct buffer_head *bh = EXT4_SB(sb)->s_mmp_bh;
        struct mmp_struct *mmp;
index 767b4bfe39c38974fb90767ad2bbcf3d0638d345..5675d3b38032455418abc5d8587742f9920a690a 100644 (file)
@@ -2031,7 +2031,7 @@ int ext4_find_dest_de(struct inode *dir, struct inode *inode,
        unsigned int offset = 0;
        char *top;
 
-       de = (struct ext4_dir_entry_2 *)buf;
+       de = buf;
        top = buf + buf_size - reclen;
        while ((char *) de <= top) {
                if (ext4_check_dir_entry(dir, NULL, de, bh,
@@ -2587,7 +2587,7 @@ int ext4_generic_delete_entry(struct inode *dir,
 
        i = 0;
        pde = NULL;
-       de = (struct ext4_dir_entry_2 *)entry_buf;
+       de = entry_buf;
        while (i < buf_size - csum_size) {
                if (ext4_check_dir_entry(dir, NULL, de, bh,
                                         entry_buf, buf_size, i))
index 218f6bc83368a9a8e24b952ad5fb0644bf77b841..b70ab3d3165daf5ee01eff853ed277617ed6310e 100644 (file)
@@ -1397,7 +1397,7 @@ static void ext4_destroy_inode(struct inode *inode)
 
 static void init_once(void *foo)
 {
-       struct ext4_inode_info *ei = (struct ext4_inode_info *) foo;
+       struct ext4_inode_info *ei = foo;
 
        INIT_LIST_HEAD(&ei->i_orphan);
        init_rwsem(&ei->xattr_sem);
@@ -3836,7 +3836,7 @@ static struct task_struct *ext4_lazyinit_task;
  */
 static int ext4_lazyinit_thread(void *arg)
 {
-       struct ext4_lazy_init *eli = (struct ext4_lazy_init *)arg;
+       struct ext4_lazy_init *eli = arg;
        struct list_head *pos, *n;
        struct ext4_li_request *elr;
        unsigned long next_wakeup, cur;