linux-trace-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] rv/include: set variable 'da_mon_##name' to static
@ 2023-08-09  4:09 Yu Liao
  2023-08-22 14:11 ` Steven Rostedt
  0 siblings, 1 reply; 3+ messages in thread
From: Yu Liao @ 2023-08-09  4:09 UTC (permalink / raw)
  To: linux-trace-kernel; +Cc: liaoyu15, liwei391, bristot, rostedt

gcc with W=1 reports
kernel/trace/rv/monitors/wip/wip.c:20:1: sparse: sparse: symbol 'da_mon_wip' was not declared. Should it be static?

The per-cpu variable 'da_mon_##name' is only used in its defining file, so
it should be static.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202307280030.7EjUG9gR-lkp@intel.com/
Signed-off-by: Yu Liao <liaoyu15@huawei.com>
---
 include/rv/da_monitor.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/rv/da_monitor.h b/include/rv/da_monitor.h
index 9eb75683e012..dfab1a586cdc 100644
--- a/include/rv/da_monitor.h
+++ b/include/rv/da_monitor.h
@@ -262,7 +262,7 @@ static inline void da_monitor_destroy_##name(void)						\
 /*												\
  * per-cpu monitor variables									\
  */												\
-DEFINE_PER_CPU(struct da_monitor, da_mon_##name);						\
+static DEFINE_PER_CPU(struct da_monitor, da_mon_##name);						\
 												\
 /*												\
  * da_get_monitor_##name - return current CPU monitor address					\
-- 
2.25.1


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

* Re: [PATCH -next] rv/include: set variable 'da_mon_##name' to static
  2023-08-09  4:09 [PATCH -next] rv/include: set variable 'da_mon_##name' to static Yu Liao
@ 2023-08-22 14:11 ` Steven Rostedt
  2023-08-23  1:09   ` Yu Liao
  0 siblings, 1 reply; 3+ messages in thread
From: Steven Rostedt @ 2023-08-22 14:11 UTC (permalink / raw)
  To: Yu Liao; +Cc: linux-trace-kernel, liwei391, bristot

On Wed, 9 Aug 2023 12:09:37 +0800
Yu Liao <liaoyu15@huawei.com> wrote:

> @@ -262,7 +262,7 @@ static inline void da_monitor_destroy_##name(void)						\
>  /*												\
>   * per-cpu monitor variables									\
>   */												\
> -DEFINE_PER_CPU(struct da_monitor, da_mon_##name);						\
> +static DEFINE_PER_CPU(struct da_monitor, da_mon_##name);						\

You need to fix the backslash when you add text.

-- Steve

>  												\
>  /*												\

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

* Re: [PATCH -next] rv/include: set variable 'da_mon_##name' to static
  2023-08-22 14:11 ` Steven Rostedt
@ 2023-08-23  1:09   ` Yu Liao
  0 siblings, 0 replies; 3+ messages in thread
From: Yu Liao @ 2023-08-23  1:09 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: linux-trace-kernel, liwei391, bristot

On 2023/8/22 22:11, Steven Rostedt wrote:
> On Wed, 9 Aug 2023 12:09:37 +0800
> Yu Liao <liaoyu15@huawei.com> wrote:
> 
>> @@ -262,7 +262,7 @@ static inline void da_monitor_destroy_##name(void)						\
>>  /*												\
>>   * per-cpu monitor variables									\
>>   */												\
>> -DEFINE_PER_CPU(struct da_monitor, da_mon_##name);						\
>> +static DEFINE_PER_CPU(struct da_monitor, da_mon_##name);						\
> 
> You need to fix the backslash when you add text.
> 
> -- Steve

Thank you for the review. I'll make the suggested changes and send you
the V2.

Best regards,
Yu
> 
>>  												\
>>  /*												\
> 


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

end of thread, other threads:[~2023-08-23  1:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-09  4:09 [PATCH -next] rv/include: set variable 'da_mon_##name' to static Yu Liao
2023-08-22 14:11 ` Steven Rostedt
2023-08-23  1:09   ` Yu Liao

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).