mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH -next] kcov: make some symbols static
@ 2020-07-02 11:55 Wei Yongjun
  2020-07-02 12:27 ` Andrey Konovalov
  0 siblings, 1 reply; 2+ messages in thread
From: Wei Yongjun @ 2020-07-02 11:55 UTC (permalink / raw)
  To: Hulk Robot, Andrey Konovalov, Andrew Morton, Dmitry Vyukov,
	Maciej Grochowski
  Cc: Wei Yongjun, linux-kernel

Fix sparse build warnings:

kernel/kcov.c:99:1: warning:
 symbol '__pcpu_scope_kcov_percpu_data' was not declared. Should it be static?
kernel/kcov.c:778:6: warning:
 symbol 'kcov_remote_softirq_start' was not declared. Should it be static?
kernel/kcov.c:795:6: warning:
 symbol 'kcov_remote_softirq_stop' was not declared. Should it be static?

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 kernel/kcov.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/kcov.c b/kernel/kcov.c
index 6afae0bcbac4..6b8368be89c8 100644
--- a/kernel/kcov.c
+++ b/kernel/kcov.c
@@ -96,7 +96,7 @@ struct kcov_percpu_data {
 	int			saved_sequence;
 };
 
-DEFINE_PER_CPU(struct kcov_percpu_data, kcov_percpu_data);
+static DEFINE_PER_CPU(struct kcov_percpu_data, kcov_percpu_data);
 
 /* Must be called with kcov_remote_lock locked. */
 static struct kcov_remote *kcov_remote_find(u64 handle)
@@ -775,7 +775,7 @@ static inline bool kcov_mode_enabled(unsigned int mode)
 	return (mode & ~KCOV_IN_CTXSW) != KCOV_MODE_DISABLED;
 }
 
-void kcov_remote_softirq_start(struct task_struct *t)
+static void kcov_remote_softirq_start(struct task_struct *t)
 {
 	struct kcov_percpu_data *data = this_cpu_ptr(&kcov_percpu_data);
 	unsigned int mode;
@@ -792,7 +792,7 @@ void kcov_remote_softirq_start(struct task_struct *t)
 	}
 }
 
-void kcov_remote_softirq_stop(struct task_struct *t)
+static void kcov_remote_softirq_stop(struct task_struct *t)
 {
 	struct kcov_percpu_data *data = this_cpu_ptr(&kcov_percpu_data);
 


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

* Re: [PATCH -next] kcov: make some symbols static
  2020-07-02 11:55 [PATCH -next] kcov: make some symbols static Wei Yongjun
@ 2020-07-02 12:27 ` Andrey Konovalov
  0 siblings, 0 replies; 2+ messages in thread
From: Andrey Konovalov @ 2020-07-02 12:27 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: Hulk Robot, Andrew Morton, Dmitry Vyukov, Maciej Grochowski, LKML

On Thu, Jul 2, 2020 at 1:44 PM Wei Yongjun <weiyongjun1@huawei.com> wrote:
>
> Fix sparse build warnings:
>
> kernel/kcov.c:99:1: warning:
>  symbol '__pcpu_scope_kcov_percpu_data' was not declared. Should it be static?
> kernel/kcov.c:778:6: warning:
>  symbol 'kcov_remote_softirq_start' was not declared. Should it be static?
> kernel/kcov.c:795:6: warning:
>  symbol 'kcov_remote_softirq_stop' was not declared. Should it be static?
>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
>  kernel/kcov.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/kernel/kcov.c b/kernel/kcov.c
> index 6afae0bcbac4..6b8368be89c8 100644
> --- a/kernel/kcov.c
> +++ b/kernel/kcov.c
> @@ -96,7 +96,7 @@ struct kcov_percpu_data {
>         int                     saved_sequence;
>  };
>
> -DEFINE_PER_CPU(struct kcov_percpu_data, kcov_percpu_data);
> +static DEFINE_PER_CPU(struct kcov_percpu_data, kcov_percpu_data);
>
>  /* Must be called with kcov_remote_lock locked. */
>  static struct kcov_remote *kcov_remote_find(u64 handle)
> @@ -775,7 +775,7 @@ static inline bool kcov_mode_enabled(unsigned int mode)
>         return (mode & ~KCOV_IN_CTXSW) != KCOV_MODE_DISABLED;
>  }
>
> -void kcov_remote_softirq_start(struct task_struct *t)
> +static void kcov_remote_softirq_start(struct task_struct *t)
>  {
>         struct kcov_percpu_data *data = this_cpu_ptr(&kcov_percpu_data);
>         unsigned int mode;
> @@ -792,7 +792,7 @@ void kcov_remote_softirq_start(struct task_struct *t)
>         }
>  }
>
> -void kcov_remote_softirq_stop(struct task_struct *t)
> +static void kcov_remote_softirq_stop(struct task_struct *t)
>  {
>         struct kcov_percpu_data *data = this_cpu_ptr(&kcov_percpu_data);
>
>

Reviewed-by: Andrey Konovalov <andreyknvl@google.com>

Thanks!

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

end of thread, other threads:[~2020-07-02 12:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-02 11:55 [PATCH -next] kcov: make some symbols static Wei Yongjun
2020-07-02 12:27 ` Andrey Konovalov

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®