[PATCH linux-next] fs: remove void * casting in init_once()

From: Fabian Frederick
Date: Tue May 16 2017 - 14:39:16 EST


See Documentation/process/coding-style.rst:

"Casting the return value which is a void pointer is redundant. The
conversion from void pointer to any other pointer type is guaranteed by the C
programming language."

This will stop copy/paste cascade warnings.

Signed-off-by: Fabian Frederick <fabf@xxxxxxxxx>
---
fs/9p/v9fs.c | 2 +-
fs/adfs/super.c | 2 +-
fs/affs/super.c | 2 +-
fs/befs/linuxvfs.c | 2 +-
fs/block_dev.c | 2 +-
fs/btrfs/inode.c | 2 +-
fs/coda/inode.c | 2 +-
fs/ecryptfs/main.c | 2 +-
fs/efs/super.c | 2 +-
fs/ext2/super.c | 2 +-
fs/ext4/super.c | 2 +-
fs/f2fs/super.c | 2 +-
fs/fat/cache.c | 2 +-
fs/fat/inode.c | 2 +-
fs/hpfs/super.c | 2 +-
fs/hugetlbfs/inode.c | 2 +-
fs/inode.c | 2 +-
fs/jfs/super.c | 2 +-
fs/minix/inode.c | 2 +-
fs/ncpfs/inode.c | 2 +-
fs/nfs/inode.c | 2 +-
fs/ntfs/super.c | 2 +-
fs/openpromfs/inode.c | 2 +-
fs/proc/inode.c | 2 +-
fs/qnx6/inode.c | 2 +-
fs/reiserfs/super.c | 2 +-
fs/sysv/inode.c | 2 +-
fs/udf/super.c | 2 +-
fs/ufs/super.c | 2 +-
fs/userfaultfd.c | 2 +-
30 files changed, 30 insertions(+), 30 deletions(-)

diff --git a/fs/9p/v9fs.c b/fs/9p/v9fs.c
index c202930..eedc055 100644
--- a/fs/9p/v9fs.c
+++ b/fs/9p/v9fs.c
@@ -551,7 +551,7 @@ static void v9fs_sysfs_cleanup(void)

static void v9fs_inode_init_once(void *foo)
{
- struct v9fs_inode *v9inode = (struct v9fs_inode *)foo;
+ struct v9fs_inode *v9inode = foo;
#ifdef CONFIG_9P_FSCACHE
v9inode->fscache = NULL;
#endif
diff --git a/fs/adfs/super.c b/fs/adfs/super.c
index c9fdfb1..f5b1a91 100644
--- a/fs/adfs/super.c
+++ b/fs/adfs/super.c
@@ -261,7 +261,7 @@ static void adfs_destroy_inode(struct inode *inode)

static void init_once(void *foo)
{
- struct adfs_inode_info *ei = (struct adfs_inode_info *) foo;
+ struct adfs_inode_info *ei = foo;

inode_init_once(&ei->vfs_inode);
}
diff --git a/fs/affs/super.c b/fs/affs/super.c
index c2c27a8..3e3aa22 100644
--- a/fs/affs/super.c
+++ b/fs/affs/super.c
@@ -121,7 +121,7 @@ static void affs_destroy_inode(struct inode *inode)

static void init_once(void *foo)
{
- struct affs_inode_info *ei = (struct affs_inode_info *) foo;
+ struct affs_inode_info *ei = foo;

sema_init(&ei->i_link_lock, 1);
sema_init(&ei->i_ext_lock, 1);
diff --git a/fs/befs/linuxvfs.c b/fs/befs/linuxvfs.c
index 63e7c47..1872d2af 100644
--- a/fs/befs/linuxvfs.c
+++ b/fs/befs/linuxvfs.c
@@ -299,7 +299,7 @@ static void befs_destroy_inode(struct inode *inode)

static void init_once(void *foo)
{
- struct befs_inode_info *bi = (struct befs_inode_info *) foo;
+ struct befs_inode_info *bi = foo;

inode_init_once(&bi->vfs_inode);
}
diff --git a/fs/block_dev.c b/fs/block_dev.c
index 519599d..0c19bbc 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -747,7 +747,7 @@ static void bdev_destroy_inode(struct inode *inode)

static void init_once(void *foo)
{
- struct bdev_inode *ei = (struct bdev_inode *) foo;
+ struct bdev_inode *ei = foo;
struct block_device *bdev = &ei->bdev;

memset(bdev, 0, sizeof(*bdev));
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 337aef8..e51e8ee 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -9520,7 +9520,7 @@ int btrfs_drop_inode(struct inode *inode)

static void init_once(void *foo)
{
- struct btrfs_inode *ei = (struct btrfs_inode *) foo;
+ struct btrfs_inode *ei = foo;

inode_init_once(&ei->vfs_inode);
}
diff --git a/fs/coda/inode.c b/fs/coda/inode.c
index 6058df3..15e0ec4 100644
--- a/fs/coda/inode.c
+++ b/fs/coda/inode.c
@@ -66,7 +66,7 @@ static void coda_destroy_inode(struct inode *inode)

static void init_once(void *foo)
{
- struct coda_inode_info *ei = (struct coda_inode_info *) foo;
+ struct coda_inode_info *ei = foo;

inode_init_once(&ei->vfs_inode);
}
diff --git a/fs/ecryptfs/main.c b/fs/ecryptfs/main.c
index 21a909d..3b74b81 100644
--- a/fs/ecryptfs/main.c
+++ b/fs/ecryptfs/main.c
@@ -652,7 +652,7 @@ MODULE_ALIAS_FS("ecryptfs");
static void
inode_info_init_once(void *vptr)
{
- struct ecryptfs_inode_info *ei = (struct ecryptfs_inode_info *)vptr;
+ struct ecryptfs_inode_info *ei = vptr;

inode_init_once(&ei->vfs_inode);
}
diff --git a/fs/efs/super.c b/fs/efs/super.c
index 368f7dd..1ffb755 100644
--- a/fs/efs/super.c
+++ b/fs/efs/super.c
@@ -86,7 +86,7 @@ static void efs_destroy_inode(struct inode *inode)

static void init_once(void *foo)
{
- struct efs_inode_info *ei = (struct efs_inode_info *) foo;
+ struct efs_inode_info *ei = foo;

inode_init_once(&ei->vfs_inode);
}
diff --git a/fs/ext2/super.c b/fs/ext2/super.c
index 9c2028b..edd0e2d 100644
--- a/fs/ext2/super.c
+++ b/fs/ext2/super.c
@@ -204,7 +204,7 @@ static void ext2_destroy_inode(struct inode *inode)

static void init_once(void *foo)
{
- struct ext2_inode_info *ei = (struct ext2_inode_info *) foo;
+ struct ext2_inode_info *ei = foo;

rwlock_init(&ei->i_meta_lock);
#ifdef CONFIG_EXT2_FS_XATTR
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 0b177da..d90e754 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -1025,7 +1025,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);
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 83355ec..5753091 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -363,7 +363,7 @@ void f2fs_msg(struct super_block *sb, const char *level, const char *fmt, ...)

static void init_once(void *foo)
{
- struct f2fs_inode_info *fi = (struct f2fs_inode_info *) foo;
+ struct f2fs_inode_info *fi = foo;

inode_init_once(&fi->vfs_inode);
}
diff --git a/fs/fat/cache.c b/fs/fat/cache.c
index 5d38492..a8b7515 100644
--- a/fs/fat/cache.c
+++ b/fs/fat/cache.c
@@ -37,7 +37,7 @@ static struct kmem_cache *fat_cache_cachep;

static void init_once(void *foo)
{
- struct fat_cache *cache = (struct fat_cache *)foo;
+ struct fat_cache *cache = foo;

INIT_LIST_HEAD(&cache->cache_list);
}
diff --git a/fs/fat/inode.c b/fs/fat/inode.c
index a2c05f2..e58f238 100644
--- a/fs/fat/inode.c
+++ b/fs/fat/inode.c
@@ -744,7 +744,7 @@ static void fat_destroy_inode(struct inode *inode)

static void init_once(void *foo)
{
- struct msdos_inode_info *ei = (struct msdos_inode_info *)foo;
+ struct msdos_inode_info *ei = foo;

spin_lock_init(&ei->cache_lru_lock);
ei->nr_caches = 0;
diff --git a/fs/hpfs/super.c b/fs/hpfs/super.c
index 82067ca..5d68372 100644
--- a/fs/hpfs/super.c
+++ b/fs/hpfs/super.c
@@ -252,7 +252,7 @@ static void hpfs_destroy_inode(struct inode *inode)

static void init_once(void *foo)
{
- struct hpfs_inode_info *ei = (struct hpfs_inode_info *) foo;
+ struct hpfs_inode_info *ei = foo;

inode_init_once(&ei->vfs_inode);
}
diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
index dde8613..5e90440 100644
--- a/fs/hugetlbfs/inode.c
+++ b/fs/hugetlbfs/inode.c
@@ -971,7 +971,7 @@ static const struct address_space_operations hugetlbfs_aops = {

static void init_once(void *foo)
{
- struct hugetlbfs_inode_info *ei = (struct hugetlbfs_inode_info *)foo;
+ struct hugetlbfs_inode_info *ei = foo;

inode_init_once(&ei->vfs_inode);
}
diff --git a/fs/inode.c b/fs/inode.c
index 1d6c792..356d114 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -376,7 +376,7 @@ EXPORT_SYMBOL(inode_init_once);

static void init_once(void *foo)
{
- struct inode *inode = (struct inode *) foo;
+ struct inode *inode = foo;

inode_init_once(inode);
}
diff --git a/fs/jfs/super.c b/fs/jfs/super.c
index 78b41e1..ce34a14 100644
--- a/fs/jfs/super.c
+++ b/fs/jfs/super.c
@@ -954,7 +954,7 @@ MODULE_ALIAS_FS("jfs");

static void init_once(void *foo)
{
- struct jfs_inode_info *jfs_ip = (struct jfs_inode_info *) foo;
+ struct jfs_inode_info *jfs_ip = foo;

memset(jfs_ip, 0, sizeof(struct jfs_inode_info));
INIT_LIST_HEAD(&jfs_ip->anon_inode_list);
diff --git a/fs/minix/inode.c b/fs/minix/inode.c
index 6ac76b0..35c0bf6 100644
--- a/fs/minix/inode.c
+++ b/fs/minix/inode.c
@@ -81,7 +81,7 @@ static void minix_destroy_inode(struct inode *inode)

static void init_once(void *foo)
{
- struct minix_inode_info *ei = (struct minix_inode_info *) foo;
+ struct minix_inode_info *ei = foo;

inode_init_once(&ei->vfs_inode);
}
diff --git a/fs/ncpfs/inode.c b/fs/ncpfs/inode.c
index 6d0f14c..f8f8403 100644
--- a/fs/ncpfs/inode.c
+++ b/fs/ncpfs/inode.c
@@ -72,7 +72,7 @@ static void ncp_destroy_inode(struct inode *inode)

static void init_once(void *foo)
{
- struct ncp_inode_info *ei = (struct ncp_inode_info *) foo;
+ struct ncp_inode_info *ei = foo;

mutex_init(&ei->open_mutex);
inode_init_once(&ei->vfs_inode);
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
index 1de93ba..6d61d55 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -1977,7 +1977,7 @@ static inline void nfs4_init_once(struct nfs_inode *nfsi)

static void init_once(void *foo)
{
- struct nfs_inode *nfsi = (struct nfs_inode *) foo;
+ struct nfs_inode *nfsi = foo;

inode_init_once(&nfsi->vfs_inode);
INIT_LIST_HEAD(&nfsi->open_files);
diff --git a/fs/ntfs/super.c b/fs/ntfs/super.c
index ecb4987..ac8adaa 100644
--- a/fs/ntfs/super.c
+++ b/fs/ntfs/super.c
@@ -3047,7 +3047,7 @@ struct kmem_cache *ntfs_big_inode_cache;
/* Init once constructor for the inode slab cache. */
static void ntfs_big_inode_init_once(void *foo)
{
- ntfs_inode *ni = (ntfs_inode *)foo;
+ ntfs_inode *ni = foo;

inode_init_once(VFS_I(ni));
}
diff --git a/fs/openpromfs/inode.c b/fs/openpromfs/inode.c
index 13215f2..f4658fa 100644
--- a/fs/openpromfs/inode.c
+++ b/fs/openpromfs/inode.c
@@ -430,7 +430,7 @@ MODULE_ALIAS_FS("openpromfs");

static void op_inode_init_once(void *data)
{
- struct op_inode_info *oi = (struct op_inode_info *) data;
+ struct op_inode_info *oi = data;

inode_init_once(&oi->vfs_inode);
}
diff --git a/fs/proc/inode.c b/fs/proc/inode.c
index e250910..9ce68dd 100644
--- a/fs/proc/inode.c
+++ b/fs/proc/inode.c
@@ -85,7 +85,7 @@ static void proc_destroy_inode(struct inode *inode)

static void init_once(void *foo)
{
- struct proc_inode *ei = (struct proc_inode *) foo;
+ struct proc_inode *ei = foo;

inode_init_once(&ei->vfs_inode);
}
diff --git a/fs/qnx6/inode.c b/fs/qnx6/inode.c
index 1192422..a12b04d 100644
--- a/fs/qnx6/inode.c
+++ b/fs/qnx6/inode.c
@@ -615,7 +615,7 @@ static void qnx6_destroy_inode(struct inode *inode)

static void init_once(void *foo)
{
- struct qnx6_inode_info *ei = (struct qnx6_inode_info *) foo;
+ struct qnx6_inode_info *ei = foo;

inode_init_once(&ei->vfs_inode);
}
diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c
index 685f1e0..f41f606 100644
--- a/fs/reiserfs/super.c
+++ b/fs/reiserfs/super.c
@@ -663,7 +663,7 @@ static void reiserfs_destroy_inode(struct inode *inode)

static void init_once(void *foo)
{
- struct reiserfs_inode_info *ei = (struct reiserfs_inode_info *)foo;
+ struct reiserfs_inode_info *ei = foo;

INIT_LIST_HEAD(&ei->i_prealloc_list);
inode_init_once(&ei->vfs_inode);
diff --git a/fs/sysv/inode.c b/fs/sysv/inode.c
index 858fb72..dac8d4a 100644
--- a/fs/sysv/inode.c
+++ b/fs/sysv/inode.c
@@ -325,7 +325,7 @@ static void sysv_destroy_inode(struct inode *inode)

static void init_once(void *p)
{
- struct sysv_inode_info *si = (struct sysv_inode_info *)p;
+ struct sysv_inode_info *si = p;

inode_init_once(&si->vfs_inode);
}
diff --git a/fs/udf/super.c b/fs/udf/super.c
index 14b4bc1..dfa1702 100644
--- a/fs/udf/super.c
+++ b/fs/udf/super.c
@@ -177,7 +177,7 @@ static void udf_destroy_inode(struct inode *inode)

static void init_once(void *foo)
{
- struct udf_inode_info *ei = (struct udf_inode_info *)foo;
+ struct udf_inode_info *ei = foo;

ei->i_ext.i_data = NULL;
inode_init_once(&ei->vfs_inode);
diff --git a/fs/ufs/super.c b/fs/ufs/super.c
index 131b2b7..3420758 100644
--- a/fs/ufs/super.c
+++ b/fs/ufs/super.c
@@ -1417,7 +1417,7 @@ static void ufs_destroy_inode(struct inode *inode)

static void init_once(void *foo)
{
- struct ufs_inode_info *ei = (struct ufs_inode_info *) foo;
+ struct ufs_inode_info *ei = foo;

inode_init_once(&ei->vfs_inode);
}
diff --git a/fs/userfaultfd.c b/fs/userfaultfd.c
index f7555fc..7c98f3c 100644
--- a/fs/userfaultfd.c
+++ b/fs/userfaultfd.c
@@ -1775,7 +1775,7 @@ static const struct file_operations userfaultfd_fops = {

static void init_once_userfaultfd_ctx(void *mem)
{
- struct userfaultfd_ctx *ctx = (struct userfaultfd_ctx *) mem;
+ struct userfaultfd_ctx *ctx = mem;

init_waitqueue_head(&ctx->fault_pending_wqh);
init_waitqueue_head(&ctx->fault_wqh);
--
2.9.3