Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1585951 > unrolled thread

[PATCH] proc: Remove cast from memory allocation

Started by"Tobin C. Harding" <me@tobin.cc>
First post2017-02-22 07:50 +0100
Last post2017-02-22 07:50 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] proc:  Remove cast from memory allocation "Tobin C. Harding" <me@tobin.cc> - 2017-02-22 07:50 +0100

#1585951 — [PATCH] proc: Remove cast from memory allocation

From"Tobin C. Harding" <me@tobin.cc>
Date2017-02-22 07:50 +0100
Subject[PATCH] proc: Remove cast from memory allocation
Message-ID<tdyUp-5Yo-3@gated-at.bofh.it>
Coccinelle emits WARNING: casting value returned by memory allocation
function to (struct proc_inode *) is useless.

Remove unnecessary cast.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
---
 fs/proc/inode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/proc/inode.c b/fs/proc/inode.c
index 842a5ff..1eb2326 100644
--- a/fs/proc/inode.c
+++ b/fs/proc/inode.c
@@ -57,7 +57,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;
-- 
2.7.4

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web