Message ID | 1429780279-5621-1-git-send-email-firogm@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Thu, Apr 23, 2015 at 11:11 AM, Firo Yang <firogm@gmail.com> wrote: > Remove unnecessary cast of allocation return value in > fs/proc/inode.c::proc_alloc_inode(). > > Signed-off-by: Firo Yang <firogm@gmail.com> > --- > 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 7697b66..08a7235 100644 > --- a/fs/proc/inode.c > +++ b/fs/proc/inode.c > @@ -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); It is not really unnecessary for at lest two reasons. - If the type of "ei" changes gcc will emit a warning - It is grep friendly At the end of the day it is a matter of taste. :-)
diff --git a/fs/proc/inode.c b/fs/proc/inode.c index 7697b66..08a7235 100644 --- a/fs/proc/inode.c +++ b/fs/proc/inode.c @@ -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;
Remove unnecessary cast of allocation return value in fs/proc/inode.c::proc_alloc_inode(). Signed-off-by: Firo Yang <firogm@gmail.com> --- fs/proc/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)