From: Javier Martinez Canillas <javier@osg.samsung.com>
To: linux-kernel@vger.kernel.org
Cc: Javier Martinez Canillas <javier@osg.samsung.com>,
iss_storagedev@hp.com, linux-scsi@vger.kernel.org,
"James E.J. Bottomley" <jejb@linux.vnet.ibm.com>,
esc.storagedev@microsemi.com, Don Brace <don.brace@microsemi.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>
Subject: [PATCH] scsi: hpsa: remove unneeded void pointer cast
Date: Thu, 13 Oct 2016 13:10:08 -0300 [thread overview]
Message-ID: <1476375008-10034-1-git-send-email-javier@osg.samsung.com> (raw)
It's not necessary to cast the result of kmalloc, since void pointers are
promoted to any other type. This also fixes following coccinelle warning:
casting value returned by memory allocation function to (BIG_IOCTL_Command_struct *) is useless.
Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
---
drivers/scsi/hpsa.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index d007ec18179a..4e82b692298e 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -6657,8 +6657,7 @@ static int hpsa_big_passthru_ioctl(struct ctlr_info *h, void __user *argp)
return -EINVAL;
if (!capable(CAP_SYS_RAWIO))
return -EPERM;
- ioc = (BIG_IOCTL_Command_struct *)
- kmalloc(sizeof(*ioc), GFP_KERNEL);
+ ioc = kmalloc(sizeof(*ioc), GFP_KERNEL);
if (!ioc) {
status = -ENOMEM;
goto cleanup1;
--
2.7.4
next reply other threads:[~2016-10-13 16:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-13 16:10 Javier Martinez Canillas [this message]
2016-10-13 20:45 ` Don Brace
2016-10-14 20:23 ` Martin K. Petersen
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=1476375008-10034-1-git-send-email-javier@osg.samsung.com \
--to=javier@osg.samsung.com \
--cc=don.brace@microsemi.com \
--cc=esc.storagedev@microsemi.com \
--cc=iss_storagedev@hp.com \
--cc=jejb@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.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®