mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH -next] trace: wwnr: Make local symbol 'rv_wwnr' static
@ 2022-08-22  6:30 Zeng Heng
  2022-08-23 14:05 ` Daniel Bristot de Oliveira
  0 siblings, 1 reply; 3+ messages in thread
From: Zeng Heng @ 2022-08-22  6:30 UTC (permalink / raw)
  To: rostedt, mingo, bristot; +Cc: liwei391, zengheng4, linux-kernel

The sparse tool complains as follows:

kernel/trace/rv/monitors/wwnr/wwnr.c:18:19:
warning: symbol 'rv_wwnr' was not declared. Should it be static?

The `rv_wwnr` symbol is not dereferenced by other extern files,
so add static qualifier for it.

Signed-off-by: Zeng Heng <zengheng4@huawei.com>
---
 kernel/trace/rv/monitors/wwnr/wwnr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/trace/rv/monitors/wwnr/wwnr.c b/kernel/trace/rv/monitors/wwnr/wwnr.c
index 599225d9cf38..a063b93c6a1d 100644
--- a/kernel/trace/rv/monitors/wwnr/wwnr.c
+++ b/kernel/trace/rv/monitors/wwnr/wwnr.c
@@ -15,7 +15,7 @@
 
 #include "wwnr.h"
 
-struct rv_monitor rv_wwnr;
+static struct rv_monitor rv_wwnr;
 DECLARE_DA_MON_PER_TASK(wwnr, unsigned char);
 
 static void handle_switch(void *data, bool preempt, struct task_struct *p,
@@ -59,7 +59,7 @@ static void disable_wwnr(void)
 	da_monitor_destroy_wwnr();
 }
 
-struct rv_monitor rv_wwnr = {
+static struct rv_monitor rv_wwnr = {
 	.name = "wwnr",
 	.description = "wakeup while not running per-task testing model.",
 	.enable = enable_wwnr,
-- 
2.25.1


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

* Re: [PATCH -next] trace: wwnr: Make local symbol 'rv_wwnr' static
  2022-08-22  6:30 [PATCH -next] trace: wwnr: Make local symbol 'rv_wwnr' static Zeng Heng
@ 2022-08-23 14:05 ` Daniel Bristot de Oliveira
  2022-08-24  1:25   ` Zeng Heng
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Bristot de Oliveira @ 2022-08-23 14:05 UTC (permalink / raw)
  To: Zeng Heng, rostedt, mingo; +Cc: liwei391, linux-kernel

On 8/22/22 08:30, Zeng Heng wrote:
> The sparse tool complains as follows:
> 
> kernel/trace/rv/monitors/wwnr/wwnr.c:18:19:
> warning: symbol 'rv_wwnr' was not declared. Should it be static?
> 
> The `rv_wwnr` symbol is not dereferenced by other exter files,
> so add static qualifier for it.

Would you mind re-sending this patch with some changes?

- Use "rv/monitors:" as the subsystem
- Do the same change for wip monitor
- Add the fixes tags:
  Fixes:	ccc319dcb450 ("rv/monitor: Add the wwnr monitor")
  Fixes:	8812d21219b9 ("rv/monitor: Add the wip monitor skeleton created by dot2k")

Also, to fix this problem for new monitors, do another patch changing the dot2k
templates files, adding the same 'static' attribute. The files are:

- tools/verification/dot2/dot2k_templates/main_global.c
- tools/verification/dot2/dot2k_templates/main_per_cpu.c
- tools/verification/dot2/dot2k_templates/main_per_task.c

In this second patch, add the subsystem as "rv/dot2k" and the following tags:

  Fixes:	24bce201d798 ("tools/rv: Add dot2k")
  Suggested-by: Daniel Bristot de Oliveira <bristot@kernel.org>

Thanks!
-- Daniel


> Signed-off-by: Zeng Heng <zengheng4@huawei.com>
> ---
>  kernel/trace/rv/monitors/wwnr/wwnr.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel/trace/rv/monitors/wwnr/wwnr.c b/kernel/trace/rv/monitors/wwnr/wwnr.c
> index 599225d9cf38..a063b93c6a1d 100644
> --- a/kernel/trace/rv/monitors/wwnr/wwnr.c
> +++ b/kernel/trace/rv/monitors/wwnr/wwnr.c
> @@ -15,7 +15,7 @@
>  
>  #include "wwnr.h"
>  
> -struct rv_monitor rv_wwnr;
> +static struct rv_monitor rv_wwnr;
>  DECLARE_DA_MON_PER_TASK(wwnr, unsigned char);
>  
>  static void handle_switch(void *data, bool preempt, struct task_struct *p,
> @@ -59,7 +59,7 @@ static void disable_wwnr(void)
>  	da_monitor_destroy_wwnr();
>  }
>  
> -struct rv_monitor rv_wwnr = {
> +static struct rv_monitor rv_wwnr = {
>  	.name = "wwnr",
>  	.description = "wakeup while not running per-task testing model.",
>  	.enable = enable_wwnr,


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

* Re: [PATCH -next] trace: wwnr: Make local symbol 'rv_wwnr' static
  2022-08-23 14:05 ` Daniel Bristot de Oliveira
@ 2022-08-24  1:25   ` Zeng Heng
  0 siblings, 0 replies; 3+ messages in thread
From: Zeng Heng @ 2022-08-24  1:25 UTC (permalink / raw)
  To: Daniel Bristot de Oliveira; +Cc: linux-kernel, rostedt, mingo

Got it, it's pleasure. And I will re-send the below patch series ASAP.


B.R.,

Zeng Heng


在 2022/8/23 22:05, Daniel Bristot de Oliveira 写道:
> On 8/22/22 08:30, Zeng Heng wrote:
>> The sparse tool complains as follows:
>>
>> kernel/trace/rv/monitors/wwnr/wwnr.c:18:19:
>> warning: symbol 'rv_wwnr' was not declared. Should it be static?
>>
>> The `rv_wwnr` symbol is not dereferenced by other exter files,
>> so add static qualifier for it.
> Would you mind re-sending this patch with some changes?
>
> - Use "rv/monitors:" as the subsystem
> - Do the same change for wip monitor
> - Add the fixes tags:
>    Fixes:	ccc319dcb450 ("rv/monitor: Add the wwnr monitor")
>    Fixes:	8812d21219b9 ("rv/monitor: Add the wip monitor skeleton created by dot2k")
>
> Also, to fix this problem for new monitors, do another patch changing the dot2k
> templates files, adding the same 'static' attribute. The files are:
>
> - tools/verification/dot2/dot2k_templates/main_global.c
> - tools/verification/dot2/dot2k_templates/main_per_cpu.c
> - tools/verification/dot2/dot2k_templates/main_per_task.c
>
> In this second patch, add the subsystem as "rv/dot2k" and the following tags:
>
>    Fixes:	24bce201d798 ("tools/rv: Add dot2k")
>    Suggested-by: Daniel Bristot de Oliveira <bristot@kernel.org>
>
> Thanks!
> -- Daniel
>
>
>> Signed-off-by: Zeng Heng <zengheng4@huawei.com>
>> ---
>>   kernel/trace/rv/monitors/wwnr/wwnr.c | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/kernel/trace/rv/monitors/wwnr/wwnr.c b/kernel/trace/rv/monitors/wwnr/wwnr.c
>> index 599225d9cf38..a063b93c6a1d 100644
>> --- a/kernel/trace/rv/monitors/wwnr/wwnr.c
>> +++ b/kernel/trace/rv/monitors/wwnr/wwnr.c
>> @@ -15,7 +15,7 @@
>>   
>>   #include "wwnr.h"
>>   
>> -struct rv_monitor rv_wwnr;
>> +static struct rv_monitor rv_wwnr;
>>   DECLARE_DA_MON_PER_TASK(wwnr, unsigned char);
>>   
>>   static void handle_switch(void *data, bool preempt, struct task_struct *p,
>> @@ -59,7 +59,7 @@ static void disable_wwnr(void)
>>   	da_monitor_destroy_wwnr();
>>   }
>>   
>> -struct rv_monitor rv_wwnr = {
>> +static struct rv_monitor rv_wwnr = {
>>   	.name = "wwnr",
>>   	.description = "wakeup while not running per-task testing model.",
>>   	.enable = enable_wwnr,

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

end of thread, other threads:[~2022-08-24  1:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-22  6:30 [PATCH -next] trace: wwnr: Make local symbol 'rv_wwnr' static Zeng Heng
2022-08-23 14:05 ` Daniel Bristot de Oliveira
2022-08-24  1:25   ` Zeng Heng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®