Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp2267871ybh; Mon, 9 Mar 2020 02:25:51 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuVk7X0eoB+gy092vmpjIuOTzRpRGdzmqibHc68YPHVKR9ldNQXIQHztuKzz7qrqaVozApf X-Received: by 2002:a9d:10d:: with SMTP id 13mr12761303otu.334.1583745951680; Mon, 09 Mar 2020 02:25:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583745951; cv=none; d=google.com; s=arc-20160816; b=mVoLz5ofqlbGoMu2KXm/1emjlivbSgny1w+4xPwbOw0cOpQx3MPFBdD7aQNuNR4fS/ +GfzNf0G/9svLLjf4IraiylwazcONaCIK/6U774L3y3W1pEIwSyacrP35b2Pag/A5Un1 sOoL9npB0I/gQM5Ssw17q8Tz9J46HB0C7oE498QiNO1hBVZBK2jPwTqQCs1YfJ7ibv2c YbmwZYp29weR4txzPEqr3/cUtbURr02HTxTZkm0jcz9du+BvPWK8xeGQWU5Ibl1q8FoR JcNGJUu2F1pODpaYXB3VQ0brSzbcYeEdNs4AzEFI01PyUE0uiEvne5nj6eyTobiVBA3Q DDpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=kvAC33b72teSj88v1lOfvZCkHhWCiCLU/SYUeAFM1ts=; b=KQikMqVNobJZ/55Cz0W0rHlHet1EAuOllWL7LRCQm55AkmXqaV9RFdIz2ajhtmWq0h eusEMTwfmX8x/kJD8St/MNl1qEYmJ3xLkYfh2EJBBV7gnhXSkeRiADzI0/cmIb/FKDrI 3nY1cGFhcU3Pyu9xo4Z+vWDTrct5jPN+1R5ubnOoriVGRMTvZHn3R9y/MsndFfDF38k4 j7UAy9Kyi0HT0xoC9VQ3GUMcC6tTfnYKKUuiHYZrOE/Sniv/1zn80F0nJq9Dqwh6Q+DD UkfCV0KrXowo/O4Tz326RtZoUvvnTSXUoemzGst1TEQEu35u4NSFLMgMfWhmKG0gU4Fx LH3w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i1si6163356otk.2.2020.03.09.02.25.40; Mon, 09 Mar 2020 02:25:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726461AbgCIJXx (ORCPT + 99 others); Mon, 9 Mar 2020 05:23:53 -0400 Received: from lhrrgout.huawei.com ([185.176.76.210]:2518 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725956AbgCIJXx (ORCPT ); Mon, 9 Mar 2020 05:23:53 -0400 Received: from lhreml709-cah.china.huawei.com (unknown [172.18.7.107]) by Forcepoint Email with ESMTP id DA1F5627232FA6AA24A9; Mon, 9 Mar 2020 09:23:51 +0000 (GMT) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by lhreml709-cah.china.huawei.com (10.201.108.32) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 9 Mar 2020 09:23:51 +0000 Received: from [127.0.0.1] (10.202.226.45) by lhreml724-chm.china.huawei.com (10.201.108.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 9 Mar 2020 09:23:51 +0000 Subject: Re: [PATCH v2] scsi: aacraid: fix -Wcast-function-type To: Phong Tran , , , , CC: , , References: <20200307132103.4687-1-tranmanphong@gmail.com> <20200308020143.9351-1-tranmanphong@gmail.com> From: John Garry Message-ID: <9a0e6373-b4a3-0822-3b65-e3b326266832@huawei.com> Date: Mon, 9 Mar 2020 09:23:50 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.1.2 MIME-Version: 1.0 In-Reply-To: <20200308020143.9351-1-tranmanphong@gmail.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [10.202.226.45] X-ClientProxiedBy: lhreml720-chm.china.huawei.com (10.201.108.71) To lhreml724-chm.china.huawei.com (10.201.108.75) X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > 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; >