All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kees Cook <keescook@chromium.org>
To: Phong Tran <tranmanphong@gmail.com>
Cc: john.garry@huawei.com, aacraid@microsemi.com, bvanassche@acm.org,
	jejb@linux.ibm.com, linux-kernel@vger.kernel.org,
	linux-scsi@vger.kernel.org, martin.petersen@oracle.com
Subject: Re: [PATCH v3] scsi: aacraid: cleanup warning cast-function-type
Date: Mon, 9 Mar 2020 09:17:12 -0700	[thread overview]
Message-ID: <202003090917.A3B8294@keescook> (raw)
In-Reply-To: <20200309155319.12658-1-tranmanphong@gmail.com>

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@acm.org>
> Signed-off-by: Phong Tran <tranmanphong@gmail.com>

Reviewed-by: Kees Cook <keescook@chromium.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

  reply	other threads:[~2020-03-09 16:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-07 13:21 [PATCH] scsi: aacraid: fix -Wcast-function-type Phong Tran
2020-03-07 16:35 ` Bart Van Assche
2020-03-08  2:08   ` Phong Tran
2020-03-08  2:01 ` [PATCH v2] " Phong Tran
2020-03-08  2:23   ` Bart Van Assche
2020-03-09  9:23   ` John Garry
2020-03-09 15:53     ` [PATCH v3] scsi: aacraid: cleanup warning cast-function-type Phong Tran
2020-03-09 16:17       ` Kees Cook [this message]
2020-03-11  2:36       ` Martin K. Petersen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202003090917.A3B8294@keescook \
    --to=keescook@chromium.org \
    --cc=aacraid@microsemi.com \
    --cc=bvanassche@acm.org \
    --cc=jejb@linux.ibm.com \
    --cc=john.garry@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=tranmanphong@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.