scsi: hpsa: Remove unneeded void pointer cast
authorJavier Martinez Canillas <[email protected]>
Thu, 13 Oct 2016 16:10:08 +0000 (13:10 -0300)
committerMartin K. Petersen <[email protected]>
Tue, 8 Nov 2016 22:29:48 +0000 (17:29 -0500)
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 <[email protected]>
Acked-by: Don Brace <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
drivers/scsi/hpsa.c

index d007ec18179af9789a12e6ca7c9f5878374dc593..4e82b692298e5a01d927d5f406b77109ba3e21b1 100644 (file)
@@ -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;