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


Groups > linux.kernel > #1586011

Re: [V9fs-developer] [PATCH] fs/9p: Remove cast from memory allocation

From Greg Kurz <groug@kaod.org>
Newsgroups linux.kernel
Subject Re: [V9fs-developer] [PATCH] fs/9p: Remove cast from memory allocation
Date 2017-02-22 10:30 +0100
Message-ID <tdBpf-7UW-7@gated-at.bofh.it> (permalink)
References <tdyKK-5Ut-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

On Wed, 22 Feb 2017 17:34:13 +1100
"Tobin C. Harding" <me@tobin.cc> wrote:

> Coccinelle emits WARNING: casting value returned by memory allocation
> function to (struct v9fs_inode *) is useless.
> 
> Remove unnecessary cast.
> 
> Signed-off-by: Tobin C. Harding <me@tobin.cc>
> ---

Reviewed-by: Greg Kurz <groug@kaod.org>

>  fs/9p/vfs_inode.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c
> index f4f4450..462e9e4 100644
> --- a/fs/9p/vfs_inode.c
> +++ b/fs/9p/vfs_inode.c
> @@ -238,8 +238,7 @@ v9fs_blank_wstat(struct p9_wstat *wstat)
>  struct inode *v9fs_alloc_inode(struct super_block *sb)
>  {
>  	struct v9fs_inode *v9inode;
> -	v9inode = (struct v9fs_inode *)kmem_cache_alloc(v9fs_inode_cache,
> -							GFP_KERNEL);
> +	v9inode = kmem_cache_alloc(v9fs_inode_cache, GFP_KERNEL);
>  	if (!v9inode)
>  		return NULL;
>  #ifdef CONFIG_9P_FSCACHE

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH] fs/9p:  Remove cast from memory allocation "Tobin C. Harding" <me@tobin.cc> - 2017-02-22 07:40 +0100
  Re: [V9fs-developer] [PATCH] fs/9p: Remove cast from memory  allocation Greg Kurz <groug@kaod.org> - 2017-02-22 10:30 +0100

csiph-web