lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220119194019.27703-1-palmer@rivosinc.com>
Date:   Wed, 19 Jan 2022 11:40:19 -0800
From:   Palmer Dabbelt <palmer@...osinc.com>
To:     keescook@...omium.org, yzaikin@...gle.com
Cc:     mcgrof@...nel.org, linux-kernel@...r.kernel.org,
        linux-fsdevel@...r.kernel.org, Palmer Dabbelt <palmer@...osinc.com>
Subject: [PATCH] perf_events: sysctl: Avoid unused one_thousand definition

From: Palmer Dabbelt <palmer@...osinc.com>

The variable "one_thousand" is only used under CONFIG_PERF_EVENTS=y, but
is unconditionally defined.  This can fire a warning.

Signed-off-by: Palmer Dabbelt <palmer@...osinc.com>

---

I went with an #ifdef instead of a __maybe_unused because that's what
the other code is using, and I left the one_thousand in order despite
that requiring another #ifdef.
---
 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.32.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ