]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
scsi: hpsa: Remove unneeded void pointer cast
authorJavier Martinez Canillas <javier@osg.samsung.com>
Thu, 13 Oct 2016 16:10:08 +0000 (13:10 -0300)
committerChuck Anderson <chuck.anderson@oracle.com>
Mon, 6 Mar 2017 20:17:50 +0000 (12:17 -0800)
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>
Acked-by: Don Brace <don.brace@microsemi.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug: 25605941
(cherry picked from commit 19be606be1df35479333bd04e2cdaddc9d77e38c)
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
drivers/scsi/hpsa.c

index 01869f92d5b336e0c1005e81b01dea78f26c4e69..c72378df46c56c958beb1b0c418ed7d418859156 100644 (file)
@@ -6698,8 +6698,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;