sysctl: Fix 'one_thousand' defined but not used warning
Subsystems (2)
PATCH 1/1 sysctl: Fix 'one_thousand' defined but not used warning
Fix the following warning issued when CONFIG_PERF_EVENTS is not defined:
kernel/sysctl.c:125:12: warning: 'one_thousand' defined but not used [-Wunused-variable]
--- kernel/sysctl.c | 2 ++ 1 file changed, 2 insertions(+)
kernel/sysctl.c +2 -0
@@ -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 ;
Signature · 1 line
2.34.1.703.g22d0c6ccf7-goog
Quoted 17 lines · Suren Baghdasaryan
Fix the following warning issued when
CONFIG_PERF_EVENTSis not defined:
kernel/sysctl.c:125:12: warning: 'one_thousand' defined but not used [-Wunused-variable]Fixes 39c65a94cd96 ("mm/pagealloc: sysctl: change watermark_scale_factor max limit to 30%")Reported-by Stephen Rothwell <[email protected]>Signed-off-by Suren Baghdasaryan <[email protected]>--- kernel/sysctl.c | 2 ++ 1 file changed, 2 insertions(+)kernel/sysctl.c +0
-0
kernel/sysctl.c static unsigned long one_ul = 1; · line 126
Quoted 5 lines
kernel/sysctl.c +1
-0@@ -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 ;
what about moving one_thousand definition below to group it with six_hundred_forty_kb var together, so that we can avoid one #ifdef CONFIG_PERF_EVENTS ... #endif
Quoted 7 lines
kernel/sysctl.c +1
-0+#endif static int three_thousand =3000 ;#ifdef CONFIG_PRINTK static int ten_thousand =10000 ;Signature · 1 line
2.34.1.703.g22d0c6ccf7-goog
Hi Jisheng,
Quoted 14 lines · On Sun, 23 Jan 2022 17:09:36 +0800 Jisheng Zhang <[email protected]> wrote:
Quoted 12 lines · Suren Baghdasaryan
Fix the following warning issued when
CONFIG_PERF_EVENTSis not defined:
kernel/sysctl.c:125:12: warning: 'one_thousand' defined but not used [-Wunused-variable]Fixes 39c65a94cd96 ("mm/pagealloc: sysctl: change watermark_scale_factor max limit to 30%")Reported-by Stephen Rothwell <[email protected]>Signed-off-by Suren Baghdasaryan <[email protected]>--- kernel/sysctl.c | 2 ++ 1 file changed, 2 insertions(+)
Quoted 22 lines
kernel/sysctl.c static unsigned long one_ul = 1; · line 126
Quoted 10 lines
kernel/sysctl.c +1
-0@@ -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 ;what about moving
one_thousanddefinition below to group it withsix_hundred_forty_kbvar together, so that we can avoid one #ifdefCONFIG_PERF_EVENTS... #endifQuoted 7 lines
kernel/sysctl.c +1
-0+#endif static int three_thousand =3000 ;#ifdef CONFIG_PRINTK static int ten_thousand =10000 ;Signature · 1 line
2.34.1.703.g22d0c6ccf7-goog
This has been fixed in Linus' current tree.
Signature · 2 lines
Cheers, Stephen Rothwell