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


Groups > linux.kernel > #1254972 > unrolled thread

[PATCH 2/2] scsi: remove useless casting value returned by kmalloc to structure

Started byPunit Vara <punitvara@gmail.com>
First post2015-10-23 22:10 +0200
Last post2015-10-24 01:30 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 2/2] scsi: remove useless casting value returned by kmalloc to structure Punit Vara <punitvara@gmail.com> - 2015-10-23 22:10 +0200
    Re: [PATCH 2/2] scsi: remove useless casting value returned by kmalloc to structure "Matthew R. Ochs" <mrochs@linux.vnet.ibm.com> - 2015-10-24 01:30 +0200

#1254972 — [PATCH 2/2] scsi: remove useless casting value returned by kmalloc to structure

FromPunit Vara <punitvara@gmail.com>
Date2015-10-23 22:10 +0200
Subject[PATCH 2/2] scsi: remove useless casting value returned by kmalloc to structure
Message-ID<qmQOZ-3lW-3@gated-at.bofh.it>
This is the patch to the hpsa.c file that resolves following warning
reported by coccicheck:

WARNING: casting value returned by memory allocation function to
(BIG_IOCTL_Command_struct *) is useless.

Signed-off-by: Punit Vara <punitvara@gmail.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 40669f8..8d971b3 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -6027,8 +6027,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.5.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1255050

From"Matthew R. Ochs" <mrochs@linux.vnet.ibm.com>
Date2015-10-24 01:30 +0200
Message-ID<qmTWy-7MT-13@gated-at.bofh.it>
In reply to#1254972
Reviewed-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web