From: Punit Vara <punitvara@gmail.com>
To: don.brace@pmcs.com
Cc: iss_storagedev@hp.com, storagedev@pmcs.com,
linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
Punit Vara <punitvara@gmail.com>
Subject: [PATCH] block: remove useless casting value returned by kmalloc to structure
Date: Sat, 24 Oct 2015 17:39:49 +0530 [thread overview]
Message-ID: <1445688589-5856-1-git-send-email-punitvara@gmail.com> (raw)
This is the patch to the cciss_scsi.c file that resolves following warning
reported by coccicheck:
WARNING: casting value returned by memory allocation function to (struct
cciss_scsi_adapter_data_t *) is useless.
Signed-off-by: Punit Vara <punitvara@gmail.com>
---
drivers/block/cciss_scsi.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/block/cciss_scsi.c b/drivers/block/cciss_scsi.c
index 1537302..4c27032 100644
--- a/drivers/block/cciss_scsi.c
+++ b/drivers/block/cciss_scsi.c
@@ -703,8 +703,7 @@ cciss_scsi_setup(ctlr_info_t *h)
struct cciss_scsi_adapter_data_t * shba;
ccissscsi[h->ctlr].ndevices = 0;
- shba = (struct cciss_scsi_adapter_data_t *)
- kmalloc(sizeof(*shba), GFP_KERNEL);
+ shba = kmalloc(sizeof(*shba), GFP_KERNEL);
if (shba == NULL)
return;
shba->scsi_host = NULL;
--
2.5.3
next reply other threads:[~2015-10-24 12:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-24 12:09 Punit Vara [this message]
2015-10-25 3:26 ` [PATCH] block: remove useless casting value returned by kmalloc to structure Matthew R. Ochs
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=1445688589-5856-1-git-send-email-punitvara@gmail.com \
--to=punitvara@gmail.com \
--cc=don.brace@pmcs.com \
--cc=iss_storagedev@hp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=storagedev@pmcs.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