Skip to contentSkip to conversation

fs/proc/inode.c: remove cast from memory allocation

PATCH New [email protected] 1 participant 1 message May 8, 2017 Proc filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 9/114 fs/proc/inode.c: remove cast from memory allocation

From: "Tobin C. Harding" <[email protected]>
Subject: fs/proc/inode.c: remove cast from memory allocation

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

Remove unnecessary cast.

---

 fs/proc/inode.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/proc/inode.c renamed from fs/proc/inode.c~proc-remove-cast-from-memory-allocation +1 -1
diff -puN fs/proc/inode.c~proc-remove-cast-from-memory-allocation fs/proc/inode.c
@@ -58,7 +58,7 @@ static struct inode *proc_alloc_inode(st
 	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;

_