Skip to contentSkip to conversation

fs: proc: inode.c: remove unnecessary type cast

PATCH In review Bas Peters 2 participants 2 messages Feb 11, 2015

Subsystems (2)
lore
Share & tools
lore

Bas Peters

author
#0 lore raw

PATCH 1/1 fs: proc: inode.c: remove unnecessary type cast

Issue was detected using Coccinelle.

---
 fs/proc/inode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/proc/inode.c +1 -1
index 8420a2f..e16ee87 100644
@@ -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;
Signature · 1 line
2.1.0
#1 lore raw
Quoted 1 line · Bas Peters

Issue was detected using Coccinelle.

I believe Al Viro wrote that deliberately.

Quoted 10 lines
---
 fs/proc/inode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/proc/inode.c +0 -0
index 8420a2f..e16ee87 100644

fs/proc/inode.c static struct inode *proc_alloc_inode(struct super_block *sb) · line 63

Quoted 8 lines
fs/proc/inode.c +1 -1
@@ -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;

Eric