2015-02-11 11:58:58

by Bas Peters

[permalink] [raw]
Subject: [PATCH] fs: proc: inode.c: remove unnecessary type cast

Issue was detected using Coccinelle.

Signed-off-by: Bas Peters <[email protected]>
---
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 8420a2f..e16ee87 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.1.0


2015-02-11 14:06:01

by Eric W. Biederman

[permalink] [raw]
Subject: Re: [PATCH] fs: proc: inode.c: remove unnecessary type cast

Bas Peters <[email protected]> writes:

> Issue was detected using Coccinelle.

I believe Al Viro wrote that deliberately.

> Signed-off-by: Bas Peters <[email protected]>
> ---
> 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 8420a2f..e16ee87 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;

Eric