From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Luis Chamberlain <mcgrof@kernel.org>,
Kees Cook <keescook@chromium.org>,
Iurii Zaikin <yzaikin@google.com>,
Andrew Morton <akpm@linux-foundation.org>,
Suren Baghdasaryan <surenb@google.com>,
Johannes Weiner <hannes@cmpxchg.org>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] sysctl: Fix one_thousand defined but not used warning
Date: Sun, 16 Jan 2022 11:31:42 +0100 [thread overview]
Message-ID: <20220116103142.2371807-1-geert@linux-m68k.org> (raw)
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
reply other threads:[~2022-01-16 10:44 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220116103142.2371807-1-geert@linux-m68k.org \
--to=geert@linux-m68k.org \
--cc=akpm@linux-foundation.org \
--cc=hannes@cmpxchg.org \
--cc=keescook@chromium.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mcgrof@kernel.org \
--cc=surenb@google.com \
--cc=yzaikin@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).