From patchwork Mon Sep 19 03:08:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ren Zhijie X-Patchwork-Id: 607914 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 47401ECAAD8 for ; Mon, 19 Sep 2022 03:12:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229847AbiISDL6 (ORCPT ); Sun, 18 Sep 2022 23:11:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229825AbiISDLz (ORCPT ); Sun, 18 Sep 2022 23:11:55 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 258321A3A4; Sun, 18 Sep 2022 20:11:54 -0700 (PDT) Received: from dggpeml500021.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4MW8kD0D5QzlVyk; Mon, 19 Sep 2022 11:07:48 +0800 (CST) Received: from dggpeml500008.china.huawei.com (7.185.36.147) by dggpeml500021.china.huawei.com (7.185.36.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 19 Sep 2022 11:11:52 +0800 Received: from huawei.com (10.67.175.34) by dggpeml500008.china.huawei.com (7.185.36.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 19 Sep 2022 11:11:51 +0800 From: Ren Zhijie To: , , , , , , CC: , , Ren Zhijie Subject: [PATCH -next] scsi: qla2xxx: Fix build error implicit-function-declaration Date: Mon, 19 Sep 2022 11:08:10 +0800 Message-ID: <20220919030810.1626-1-renzhijie2@huawei.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-Originating-IP: [10.67.175.34] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpeml500008.china.huawei.com (7.185.36.147) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org If CONFIG_TRACING is not set, make ARCH=x86_64 CROSS_COMPILE=x86_64-linux-gnu-, will be failed, like this: drivers/scsi/qla2xxx/qla_os.c: In function ‘qla_trace_init’: drivers/scsi/qla2xxx/qla_os.c:2854:18: error: implicit declaration of function ‘trace_array_get_by_name’; did you mean ‘trace_array_set_clr_event’? [-Werror=implicit-function-declaration] qla_trc_array = trace_array_get_by_name("qla2xxx"); ^~~~~~~~~~~~~~~~~~~~~~~ trace_array_set_clr_event drivers/scsi/qla2xxx/qla_os.c:2854:16: error: assignment makes pointer from integer without a cast [-Werror=int-conversion] qla_trc_array = trace_array_get_by_name("qla2xxx"); ^ drivers/scsi/qla2xxx/qla_os.c: In function ‘qla_trace_uninit’: drivers/scsi/qla2xxx/qla_os.c:2869:2: error: implicit declaration of function ‘trace_array_put’; did you mean ‘trace_seq_putc’? [-Werror=implicit-function-declaration] trace_array_put(qla_trc_array); ^~~~~~~~~~~~~~~ trace_seq_putc cc1: all warnings being treated as errors To fix this error, wrap up all the relevant code with CONFIG_TRACING. Fixes: 8bfc149ba24c ("scsi: qla2xxx: Enhance driver tracing with separate tunable and more") Signed-off-by: Ren Zhijie --- drivers/scsi/qla2xxx/qla_os.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 2c85f3cce726..e445105ee16d 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -37,7 +37,9 @@ static int apidev_major; */ struct kmem_cache *srb_cachep; +#ifdef CONFIG_TRACING static struct trace_array *qla_trc_array; +#endif int ql2xfulldump_on_mpifail; module_param(ql2xfulldump_on_mpifail, int, S_IRUGO | S_IWUSR); @@ -2848,6 +2850,7 @@ static void qla2x00_iocb_work_fn(struct work_struct *work) spin_unlock_irqrestore(&vha->work_lock, flags); } +#ifdef CONFIG_TRACING static void qla_trace_init(void) { @@ -2868,7 +2871,7 @@ qla_trace_uninit(void) return; trace_array_put(qla_trc_array); } - +#endif /* * PCI driver interface */ @@ -8209,7 +8212,9 @@ qla2x00_module_init(void) BUILD_BUG_ON(sizeof(sw_info_t) != 32); BUILD_BUG_ON(sizeof(target_id_t) != 2); +#ifdef CONFIG_TRACING qla_trace_init(); +#endif /* Allocate cache for SRBs. */ srb_cachep = kmem_cache_create("qla2xxx_srbs", sizeof(srb_t), 0, @@ -8290,7 +8295,9 @@ qla2x00_module_init(void) destroy_cache: kmem_cache_destroy(srb_cachep); +#ifdef CONFIG_TRACING qla_trace_uninit(); +#endif return ret; } @@ -8309,7 +8316,9 @@ qla2x00_module_exit(void) fc_release_transport(qla2xxx_transport_template); qlt_exit(); kmem_cache_destroy(srb_cachep); +#ifdef CONFIG_TRACING qla_trace_uninit(); +#endif } module_init(qla2x00_module_init);