]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
fs/proc/inode.c: remove cast from memory allocation
authorTobin C. Harding <me@tobin.cc>
Mon, 8 May 2017 22:54:55 +0000 (15:54 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 9 May 2017 00:15:10 +0000 (17:15 -0700)
Coccinelle emits this warning:

  WARNING: casting value returned by memory allocation function to (struct proc_inode *) is useless.

Remove unnecessary cast.

Link: http://lkml.kernel.org/r/1487745720-16967-1-git-send-email-me@tobin.cc
Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/proc/inode.c

index 2cc7a8030275c1bc98a0da9adb870b33d99f5433..e250910cffc8fd54af942e8009da413ce76093ac 100644 (file)
@@ -58,7 +58,7 @@ static struct inode *proc_alloc_inode(struct super_block *sb)
        struct proc_inode *ei;
        struct inode *inode;
 
-       ei = (struct proc_inode *)kmem_cache_alloc(proc_inode_cachep, GFP_KERNEL);
+       ei = kmem_cache_alloc(proc_inode_cachep, GFP_KERNEL);
        if (!ei)
                return NULL;
        ei->pid = NULL;