All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] sysctl: Fix 'one_thousand' defined but not used warning
@ 2022-01-17  1:23 Suren Baghdasaryan
  2022-01-23  9:09 ` Jisheng Zhang
  0 siblings, 1 reply; 3+ messages in thread
From: Suren Baghdasaryan @ 2022-01-17  1:23 UTC (permalink / raw)
  To: sfr; +Cc: akpm, torvalds, linux-kernel, linux-next, surenb

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]

Fixes: 39c65a94cd96 ("mm/pagealloc: sysctl: change watermark_scale_factor max limit to 30%")
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
---
 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.34.1.703.g22d0c6ccf7-goog


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

* Re: [PATCH 1/1] sysctl: Fix 'one_thousand' defined but not used warning
  2022-01-17  1:23 [PATCH 1/1] sysctl: Fix 'one_thousand' defined but not used warning Suren Baghdasaryan
@ 2022-01-23  9:09 ` Jisheng Zhang
  2022-01-23 11:24   ` Stephen Rothwell
  0 siblings, 1 reply; 3+ messages in thread
From: Jisheng Zhang @ 2022-01-23  9:09 UTC (permalink / raw)
  To: Suren Baghdasaryan; +Cc: sfr, akpm, torvalds, linux-kernel, linux-next

On Sun, Jan 16, 2022 at 05:23:17PM -0800, Suren Baghdasaryan wrote:
> 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]
> 
> Fixes: 39c65a94cd96 ("mm/pagealloc: sysctl: change watermark_scale_factor max limit to 30%")
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Signed-off-by: Suren Baghdasaryan <surenb@google.com>
> ---
>  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;

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

> +#endif
>  static int three_thousand = 3000;
>  #ifdef CONFIG_PRINTK
>  static int ten_thousand = 10000;
> -- 
> 2.34.1.703.g22d0c6ccf7-goog
> 

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

* Re: [PATCH 1/1] sysctl: Fix 'one_thousand' defined but not used warning
  2022-01-23  9:09 ` Jisheng Zhang
@ 2022-01-23 11:24   ` Stephen Rothwell
  0 siblings, 0 replies; 3+ messages in thread
From: Stephen Rothwell @ 2022-01-23 11:24 UTC (permalink / raw)
  To: Jisheng Zhang
  Cc: Suren Baghdasaryan, akpm, torvalds, linux-kernel, linux-next

[-- Attachment #1: Type: text/plain, Size: 1483 bytes --]

Hi Jisheng,

On Sun, 23 Jan 2022 17:09:36 +0800 Jisheng Zhang <jszhang@kernel.org> wrote:
>
> On Sun, Jan 16, 2022 at 05:23:17PM -0800, Suren Baghdasaryan wrote:
> > 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]
> > 
> > Fixes: 39c65a94cd96 ("mm/pagealloc: sysctl: change watermark_scale_factor max limit to 30%")
> > Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> > Signed-off-by: Suren Baghdasaryan <surenb@google.com>
> > ---
> >  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;  
> 
> 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
> 
> > +#endif
> >  static int three_thousand = 3000;
> >  #ifdef CONFIG_PRINTK
> >  static int ten_thousand = 10000;
> > -- 
> > 2.34.1.703.g22d0c6ccf7-goog
> >   

This has been fixed in Linus' current tree.

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

end of thread, other threads:[~2022-01-23 11:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-17  1:23 [PATCH 1/1] sysctl: Fix 'one_thousand' defined but not used warning Suren Baghdasaryan
2022-01-23  9:09 ` Jisheng Zhang
2022-01-23 11:24   ` Stephen Rothwell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.