linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 -next] scsi: qla2xxx: Fix build error implicit-function-declaration
@ 2022-09-19 13:34 Ren Zhijie
  2022-09-19 14:11 ` Daniel Wagner
  2022-09-19 17:54 ` [EXT] " Arun Easi
  0 siblings, 2 replies; 4+ messages in thread
From: Ren Zhijie @ 2022-09-19 13:34 UTC (permalink / raw)
  To: njavali, GR-QLogic-Storage-Upstream, jejb, martin.petersen,
	aeasi, dwagner, himanshu.madhani
  Cc: linux-scsi, linux-kernel, Ren Zhijie

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 <renzhijie2@huawei.com>
---
Changes in v2:
 - warp the definition statement of qla_trace_init() and qla_trace_uninit() with CONFIG_TRACING.
---
 drivers/scsi/qla2xxx/qla_os.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 2c85f3cce726..f64063e56f3d 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);
@@ -2851,6 +2853,7 @@ static void qla2x00_iocb_work_fn(struct work_struct *work)
 static void
 qla_trace_init(void)
 {
+#ifdef CONFIG_TRACING
 	qla_trc_array = trace_array_get_by_name("qla2xxx");
 	if (!qla_trc_array) {
 		ql_log(ql_log_fatal, NULL, 0x0001,
@@ -2859,14 +2862,17 @@ qla_trace_init(void)
 	}
 
 	QLA_TRACE_ENABLE(qla_trc_array);
+#endif
 }
 
 static void
 qla_trace_uninit(void)
 {
+#ifdef CONFIG_TRACING
 	if (!qla_trc_array)
 		return;
 	trace_array_put(qla_trc_array);
+#endif
 }
 
 /*
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2 -next] scsi: qla2xxx: Fix build error implicit-function-declaration
  2022-09-19 13:34 [PATCH v2 -next] scsi: qla2xxx: Fix build error implicit-function-declaration Ren Zhijie
@ 2022-09-19 14:11 ` Daniel Wagner
  2022-09-19 17:54 ` [EXT] " Arun Easi
  1 sibling, 0 replies; 4+ messages in thread
From: Daniel Wagner @ 2022-09-19 14:11 UTC (permalink / raw)
  To: Ren Zhijie
  Cc: njavali, GR-QLogic-Storage-Upstream, jejb, martin.petersen,
	aeasi, himanshu.madhani, linux-scsi, linux-kernel

On Mon, Sep 19, 2022 at 09:34:04PM +0800, Ren Zhijie wrote:
> 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 <renzhijie2@huawei.com>

Reviewed-by: Daniel Wagner <dwagner@suse.de>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [EXT] [PATCH v2 -next] scsi: qla2xxx: Fix build error implicit-function-declaration
  2022-09-19 13:34 [PATCH v2 -next] scsi: qla2xxx: Fix build error implicit-function-declaration Ren Zhijie
  2022-09-19 14:11 ` Daniel Wagner
@ 2022-09-19 17:54 ` Arun Easi
  2022-09-19 18:50   ` Daniel Wagner
  1 sibling, 1 reply; 4+ messages in thread
From: Arun Easi @ 2022-09-19 17:54 UTC (permalink / raw)
  To: Ren Zhijie
  Cc: njavali, GR-QLogic-Storage-Upstream, jejb, martin.petersen,
	dwagner, himanshu.madhani, linux-scsi, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 3109 bytes --]

NAK.

Please see these threads for a fix in "trace.h" to address this issue and 
a related discussion.

Most recent (v3) patch posting:
https://lore.kernel.org/linux-scsi/20220907233308.4153-2-aeasi@marvell.com/

Steve suggesting to take the patch via SCSI tree:
https://lore.kernel.org/linux-scsi/20220906174140.41b46a5f@gandalf.local.home/

Hoping this would get a nod soon and can get merged.

Regards,
-Arun

On Mon, 19 Sep 2022, 6:34am, Ren Zhijie wrote:

> External Email
> 
> ----------------------------------------------------------------------
> 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 <renzhijie2@huawei.com>
> ---
> Changes in v2:
>  - warp the definition statement of qla_trace_init() and qla_trace_uninit() with CONFIG_TRACING.
> ---
>  drivers/scsi/qla2xxx/qla_os.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
> index 2c85f3cce726..f64063e56f3d 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);
> @@ -2851,6 +2853,7 @@ static void qla2x00_iocb_work_fn(struct work_struct *work)
>  static void
>  qla_trace_init(void)
>  {
> +#ifdef CONFIG_TRACING
>  	qla_trc_array = trace_array_get_by_name("qla2xxx");
>  	if (!qla_trc_array) {
>  		ql_log(ql_log_fatal, NULL, 0x0001,
> @@ -2859,14 +2862,17 @@ qla_trace_init(void)
>  	}
>  
>  	QLA_TRACE_ENABLE(qla_trc_array);
> +#endif
>  }
>  
>  static void
>  qla_trace_uninit(void)
>  {
> +#ifdef CONFIG_TRACING
>  	if (!qla_trc_array)
>  		return;
>  	trace_array_put(qla_trc_array);
> +#endif
>  }
>  
>  /*
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [EXT] [PATCH v2 -next] scsi: qla2xxx: Fix build error implicit-function-declaration
  2022-09-19 17:54 ` [EXT] " Arun Easi
@ 2022-09-19 18:50   ` Daniel Wagner
  0 siblings, 0 replies; 4+ messages in thread
From: Daniel Wagner @ 2022-09-19 18:50 UTC (permalink / raw)
  To: Arun Easi
  Cc: Ren Zhijie, njavali, GR-QLogic-Storage-Upstream, jejb,
	martin.petersen, himanshu.madhani, linux-scsi, linux-kernel

On Mon, Sep 19, 2022 at 10:54:24AM -0700, Arun Easi wrote:
> NAK.
> 
> Please see these threads for a fix in "trace.h" to address this issue and 
> a related discussion.
> 
> Most recent (v3) patch posting:
> https://lore.kernel.org/linux-scsi/20220907233308.4153-2-aeasi@marvell.com/
> 
> Steve suggesting to take the patch via SCSI tree:
> https://lore.kernel.org/linux-scsi/20220906174140.41b46a5f@gandalf.local.home/
> 
> Hoping this would get a nod soon and can get merged.

Ah indeed. Forgot about this one. I thought this is on top of the above
fix. Note, many folks were attending the Plumbers hence they might still
be traveling.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-09-19 18:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-19 13:34 [PATCH v2 -next] scsi: qla2xxx: Fix build error implicit-function-declaration Ren Zhijie
2022-09-19 14:11 ` Daniel Wagner
2022-09-19 17:54 ` [EXT] " Arun Easi
2022-09-19 18:50   ` Daniel Wagner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).