RE: [PATCH 3/3] cciss: Remove kmalloc cast

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -----Original Message-----
> From: linux-scsi-owner@xxxxxxxxxxxxxxx [mailto:linux-scsi-
> owner@xxxxxxxxxxxxxxx] On Behalf Of Tobin C. Harding
> Sent: Wednesday, February 22, 2017 12:13 AM
> To: Don Brace <don.brace@xxxxxxxxxxxxx>
> Cc: linux-scsi@xxxxxxxxxxxxxxx; kernel-janitors@xxxxxxxxxxxxxxx; Tobin C.
> Harding <me@xxxxxxxx>
> Subject: [PATCH 3/3] cciss: Remove kmalloc cast
> 
> EXTERNAL EMAIL
> 
> 
> 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@xxxxxxxx>

Acked-by: Don Brace <don.brace@xxxxxxxxxxxxx>
> ---
>  drivers/block/cciss_scsi.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/block/cciss_scsi.c b/drivers/block/cciss_scsi.c
> index f5c21f3..01a1f7e 100644
> --- a/drivers/block/cciss_scsi.c
> +++ b/drivers/block/cciss_scsi.c
> @@ -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;
> --
> 2.7.4

--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux