lkml.org 
[lkml]   [2020]   [Mar]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2] scsi: aacraid: fix -Wcast-function-type
From
Date
On 08/03/2020 02:01, Phong Tran wrote:
> correct usage prototype of callback scsi_cmnd.scsi_done()
> Report by: https://github.com/KSPP/linux/issues/20
>

no harm to add:

drivers/scsi/aacraid/aachba.c:813:23: warning: cast between incompatible
function types from ‘int (*)(struct scsi_cmnd *)’ to ‘void (*)(struct
scsi_cmnd *)’ [-Wcast-function-type]


> Signed-off-by: Phong Tran <tranmanphong@gmail.com>
> ---
> drivers/scsi/aacraid/aachba.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c
> index 33dbc051bff9..20ca3647d211 100644
> --- a/drivers/scsi/aacraid/aachba.c
> +++ b/drivers/scsi/aacraid/aachba.c
> @@ -798,6 +798,11 @@ static int aac_probe_container_callback1(struct scsi_cmnd * scsicmd)
> return 0;
> }
>
> +static void aac_probe_container_scsi_done(struct scsi_cmnd *scsi_cmnd)

supernit: double whitespace

> +{
> + aac_probe_container_callback1(scsi_cmnd);
> +}
> +
> int aac_probe_container(struct aac_dev *dev, int cid)
> {
> struct scsi_cmnd *scsicmd = kmalloc(sizeof(*scsicmd), GFP_KERNEL);
> @@ -810,7 +815,7 @@ int aac_probe_container(struct aac_dev *dev, int cid)
> return -ENOMEM;
> }
> scsicmd->list.next = NULL;
> - scsicmd->scsi_done = (void (*)(struct scsi_cmnd*))aac_probe_container_callback1;
> + scsicmd->scsi_done = aac_probe_container_scsi_done;
>
> scsicmd->device = scsidev;
> scsidev->sdev_state = 0;
>

\
 
 \ /
  Last update: 2020-03-09 10:24    [W:0.096 / U:0.676 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site