linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] perf_events: sysctl: Avoid unused one_thousand definition
@ 2022-01-19 19:40 Palmer Dabbelt
  2022-01-20 14:50 ` Luis Chamberlain
  0 siblings, 1 reply; 2+ messages in thread
From: Palmer Dabbelt @ 2022-01-19 19:40 UTC (permalink / raw)
  To: keescook, yzaikin; +Cc: mcgrof, linux-kernel, linux-fsdevel, Palmer Dabbelt

From: Palmer Dabbelt <palmer@rivosinc.com>

The variable "one_thousand" is only used under CONFIG_PERF_EVENTS=y, but
is unconditionally defined.  This can fire a warning.

Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>

---

I went with an #ifdef instead of a __maybe_unused because that's what
the other code is using, and I left the one_thousand in order despite
that requiring another #ifdef.
---
 kernel/sysctl.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index ef77be575d87..81a6f2d47f77 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -122,7 +122,9 @@ static unsigned long one_ul = 1;
 static unsigned long long_max = LONG_MAX;
 static int one_hundred = 100;
 static int two_hundred = 200;
+#ifdef CONFIG_PERF_EVENTS
 static int one_thousand = 1000;
+#endif
 static int three_thousand = 3000;
 #ifdef CONFIG_PRINTK
 static int ten_thousand = 10000;
-- 
2.32.0


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

* Re: [PATCH] perf_events: sysctl: Avoid unused one_thousand definition
  2022-01-19 19:40 [PATCH] perf_events: sysctl: Avoid unused one_thousand definition Palmer Dabbelt
@ 2022-01-20 14:50 ` Luis Chamberlain
  0 siblings, 0 replies; 2+ messages in thread
From: Luis Chamberlain @ 2022-01-20 14:50 UTC (permalink / raw)
  To: Palmer Dabbelt; +Cc: keescook, yzaikin, linux-kernel, linux-fsdevel

On Wed, Jan 19, 2022 at 11:40:19AM -0800, Palmer Dabbelt wrote:
> From: Palmer Dabbelt <palmer@rivosinc.com>
> 
> The variable "one_thousand" is only used under CONFIG_PERF_EVENTS=y, but
> is unconditionally defined.  This can fire a warning.
> 
> Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
> 
> ---
> 
> I went with an #ifdef instead of a __maybe_unused because that's what
> the other code is using, and I left the one_thousand in order despite
> that requiring another #ifdef.
> ---
>  kernel/sysctl.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/kernel/sysctl.c b/kernel/sysctl.c
> index ef77be575d87..81a6f2d47f77 100644
> --- a/kernel/sysctl.c
> +++ b/kernel/sysctl.c
> @@ -122,7 +122,9 @@ static unsigned long one_ul = 1;
>  static unsigned long long_max = LONG_MAX;
>  static int one_hundred = 100;
>  static int two_hundred = 200;
> +#ifdef CONFIG_PERF_EVENTS
>  static int one_thousand = 1000;
> +#endif

Please use linux-next, this has changed quite a bit there.
You can git grep for SYSCTL_ONE_THOUSAND.

  Luis

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

end of thread, other threads:[~2022-01-20 14:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-19 19:40 [PATCH] perf_events: sysctl: Avoid unused one_thousand definition Palmer Dabbelt
2022-01-20 14:50 ` Luis Chamberlain

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