Skip to contentSkip to conversation

sysctl: Fix one_thousand defined but not used warning

PATCH New Geert Uytterhoeven 1 participant 1 message Jan 16, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sysctl: Fix one_thousand defined but not used warning

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 [email protected]
---
 kernel/sysctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/sysctl.c +1 -1
index ef77be575d8754d2..d77208f9a56f2907 100644
@@ -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
 
Signature · 1 line
2.25.1