cciss: Remove kmalloc cast
authorTobin C. Harding <me@tobin.cc>
Wed, 22 Feb 2017 06:12:38 +0000 (17:12 +1100)
committerJens Axboe <axboe@fb.com>
Wed, 22 Feb 2017 18:54:49 +0000 (11:54 -0700)
Coccinelle emits a warning about casting the return value of
kmalloc(). Coccinelle suggests removing the cast as do
kerneljanitors.

Remove cast from kmalloc() call.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Acked-by: Don Brace <don.brace@microsemi.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
drivers/block/cciss_scsi.c

index f5c21f3..01a1f7e 100644 (file)
@@ -647,8 +647,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;