diff mbox series

sysctl: Fix one_thousand defined but not used warning

Message ID 20220116103142.2371807-1-geert@linux-m68k.org (mailing list archive)
State New, archived
Headers show
Series sysctl: Fix one_thousand defined but not used warning | expand

Commit Message

Geert Uytterhoeven Jan. 16, 2022, 10:31 a.m. UTC
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 mbox series

Patch

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