linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sysctl: Fix one_thousand defined but not used warning
@ 2022-01-16 10:31 Geert Uytterhoeven
  0 siblings, 0 replies; only message in thread
From: Geert Uytterhoeven @ 2022-01-16 10:31 UTC (permalink / raw)
  To: Luis Chamberlain, Kees Cook, Iurii Zaikin, Andrew Morton,
	Suren Baghdasaryan, Johannes Weiner
  Cc: linux-fsdevel, linux-kernel

If CONFIG_PERF_EVENTS is not set:

    kernel/sysctl.c:125:12: warning: ‘one_thousand’ defined but not used [-Wunused-variable]
      125 | static int one_thousand = 1000;
	  |            ^~~~~~~~~~~~

Fix this by protecting the definition of one_thousand by a check for
CONFIG_PERF_EVENTS, as is used for its single remaining user.

Fixes: 39c65a94cd966153 ("mm/pagealloc: sysctl: change watermark_scale_factor max limit to 30%")
Reported-by: noreply@ellerman.id.au
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 kernel/sysctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index ef77be575d8754d2..d77208f9a56f2907 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -122,12 +122,12 @@ static unsigned long one_ul = 1;
 static unsigned long long_max = LONG_MAX;
 static int one_hundred = 100;
 static int two_hundred = 200;
-static int one_thousand = 1000;
 static int three_thousand = 3000;
 #ifdef CONFIG_PRINTK
 static int ten_thousand = 10000;
 #endif
 #ifdef CONFIG_PERF_EVENTS
+static int one_thousand = 1000;
 static int six_hundred_forty_kb = 640 * 1024;
 #endif
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-01-16 10:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-16 10:31 [PATCH] sysctl: Fix one_thousand defined but not used warning Geert Uytterhoeven

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