[PATCH 2/4] fs: Cocci spatch "alloc_cast"

From: Thomas Meyer
Date: Thu Sep 21 2017 - 02:43:14 EST


Remove casting the values returned by memory allocation functions like
kmalloc, kzalloc, kmem_cache_alloc, kmem_cache_zalloc etc."
Found by coccinelle spatch "api/alloc/alloc_cast.cocci"

Signed-off-by: Thomas Meyer <thomas@xxxxxxxx>
---

diff -u -p a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c
--- a/fs/9p/vfs_inode.c
+++ b/fs/9p/vfs_inode.c
@@ -238,7 +238,7 @@ v9fs_blank_wstat(struct p9_wstat *wstat)
struct inode *v9fs_alloc_inode(struct super_block *sb)
{
struct v9fs_inode *v9inode;
- v9inode = (struct v9fs_inode *)kmem_cache_alloc(v9fs_inode_cache,
+ v9inode = kmem_cache_alloc(v9fs_inode_cache,
GFP_KERNEL);
if (!v9inode)
return NULL;