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: <20250224141849.1546019-1-arnd@kernel.org>
Date: Mon, 24 Feb 2025 15:16:09 +0100
From: Arnd Bergmann <arnd@...nel.org>
To: Ahmad Fatoum <a.fatoum@...gutronix.de>,
	Tzung-Bi Shih <tzungbi@...nel.org>,
	Andrew Morton <akpm@...ux-foundation.org>
Cc: Arnd Bergmann <arnd@...db.de>,
	Joel Granados <joel.granados@...nel.org>,
	linux-kernel@...r.kernel.org
Subject: [PATCH] reboot: hide unused hw_protection_attr

From: Arnd Bergmann <arnd@...db.de>

The reference to hw_protection_attr is inside of an #ifdef block,
but the definition is not:

kernel/reboot.c:1092:30: error: unused variable 'hw_protection_attr' [-Werror,-Wunused-variable]
 1092 | static struct kobj_attribute hw_protection_attr = __ATTR_RW(hw_protection);
      |                              ^~~~~~~~~~~~~~~~~~

Add another #ifdef to match the first.

Fixes: 6f0ec17b2d82 ("reboot: add support for configuring emergency hardware protection action")
Signed-off-by: Arnd Bergmann <arnd@...db.de>
---
 kernel/reboot.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/reboot.c b/kernel/reboot.c
index 5299790a2832..2d6a06fe6c66 100644
--- a/kernel/reboot.c
+++ b/kernel/reboot.c
@@ -1071,6 +1071,7 @@ static int __init hw_protection_setup(char *str)
 }
 __setup("hw_protection=", hw_protection_setup);
 
+#ifdef CONFIG_SYSFS
 static ssize_t hw_protection_show(struct kobject *kobj,
 				  struct kobj_attribute *attr, char *buf)
 {
@@ -1090,6 +1091,7 @@ static ssize_t hw_protection_store(struct kobject *kobj,
 	return count;
 }
 static struct kobj_attribute hw_protection_attr = __ATTR_RW(hw_protection);
+#endif
 
 static int __init reboot_setup(char *str)
 {
-- 
2.39.5


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ