lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202003090917.A3B8294@keescook>
Date:   Mon, 9 Mar 2020 09:17:12 -0700
From:   Kees Cook <keescook@...omium.org>
To:     Phong Tran <tranmanphong@...il.com>
Cc:     john.garry@...wei.com, aacraid@...rosemi.com, bvanassche@....org,
        jejb@...ux.ibm.com, linux-kernel@...r.kernel.org,
        linux-scsi@...r.kernel.org, martin.petersen@...cle.com
Subject: Re: [PATCH v3] scsi: aacraid: cleanup warning cast-function-type

On Mon, Mar 09, 2020 at 10:53:19PM +0700, Phong Tran wrote:
> Make the aacraid driver -Wcast-function-type clean
> Report by: https://github.com/KSPP/linux/issues/20
> 
> 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]
> 
> Reviewed-by: Bart van Assche <bvanassche@....org>
> Signed-off-by: Phong Tran <tranmanphong@...il.com>

Reviewed-by: Kees Cook <keescook@...omium.org>

-Kees

> ---
>  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..ebfb42af67f5 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)
> +{
> +	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;
> -- 
> 2.20.1
> 

-- 
Kees Cook

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ