From: Dominique Martinet <asmadeus@codewreck.org>
To: Li Heng <liheng40@huawei.com>
Cc: ericvh@gmail.com, lucho@ionkov.net,
v9fs-developer@lists.sourceforge.net,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH -next] 9p: Remove unneeded cast from memory allocation
Date: Fri, 31 Jul 2020 07:24:21 +0200 [thread overview]
Message-ID: <20200731052421.GA22875@nautica> (raw)
In-Reply-To: <1596013140-49744-1-git-send-email-liheng40@huawei.com>
Li Heng wrote on Wed, Jul 29, 2020:
> Remove casting the values returned by memory allocation function.
>
> Coccinelle emits WARNING:
>
> ./fs/9p/vfs_inode.c:226:12-29: WARNING: casting value returned by memory allocation function to (struct v9fs_inode *) is useless.
>
> Signed-off-by: Li Heng <liheng40@huawei.com>
Why not, I'll take this for next.
Please pay a bit more attention to the commit message next time though,
neither "Remove casting the values" nor "x emits warning" are proper
English -- I've taken the liberty to fix the grammar a bit...
> ---
> 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 0fd5bf2..ae0c38a 100644
> --- a/fs/9p/vfs_inode.c
> +++ b/fs/9p/vfs_inode.c
> @@ -223,8 +223,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
prev parent reply other threads:[~2020-07-31 5:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-29 8:59 Li Heng
2020-07-31 5:24 ` Dominique Martinet [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200731052421.GA22875@nautica \
--to=asmadeus@codewreck.org \
--cc=ericvh@gmail.com \
--cc=liheng40@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lucho@ionkov.net \
--cc=v9fs-developer@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®