From: kbuild test robot <fengguang.wu@intel.com>
To: Sachin Prabhu <sprabhu@redhat.com>
Cc: kbuild-all@01.org, linux-cifs@vger.kernel.org,
samba-technical@lists.samba.org,
Steve French <smfrench@gmail.com>,
Pavel Shilovsky <pshilov@microsoft.com>,
linux-kernel@vger.kernel.org
Subject: [PATCH] fix alloc_cast.cocci warnings
Date: Mon, 6 Mar 2017 06:42:41 +0800 [thread overview]
Message-ID: <20170305224241.GA108280@athens.lkp.intel.com> (raw)
In-Reply-To: <201703060637.SQGYTNgP%fengguang.wu@intel.com>
fs/cifs/smb2misc.c:689:14-41: WARNING: casting value returned by memory allocation function to (struct close_cancelled_open *) is useless.
Remove casting the values returned by memory allocation functions
like kmalloc, kzalloc, kmem_cache_alloc, kmem_cache_zalloc etc.
Semantic patch information:
This makes an effort to find cases of casting of values returned by
kmalloc, kzalloc, kcalloc, kmem_cache_alloc, kmem_cache_zalloc,
kmem_cache_alloc_node, kmalloc_node and kzalloc_node and removes
the casting as it is not required. The result in the patch case may
need some reformatting.
Generated by: scripts/coccinelle/api/alloc/alloc_cast.cocci
CC: Sachin Prabhu <sprabhu@redhat.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---
smb2misc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/fs/cifs/smb2misc.c
+++ b/fs/cifs/smb2misc.c
@@ -686,7 +686,7 @@ smb2_handle_cancelled_mid(char *buffer,
(sync_hdr->Status != STATUS_SUCCESS))
return 0;
- cancelled = (struct close_cancelled_open *)
+ cancelled =
kzalloc(sizeof(struct close_cancelled_open),
GFP_KERNEL);
if (!cancelled)
parent reply other threads:[~2017-03-05 22:43 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <201703060637.SQGYTNgP%fengguang.wu@intel.com>]
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=20170305224241.GA108280@athens.lkp.intel.com \
--to=fengguang.wu@intel.com \
--cc=kbuild-all@01.org \
--cc=linux-cifs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pshilov@microsoft.com \
--cc=samba-technical@lists.samba.org \
--cc=smfrench@gmail.com \
--cc=sprabhu@redhat.com \
/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®