]> www.infradead.org Git - users/willy/pagecache.git/commitdiff
reboot: hide unused hw_protection_attr
authorArnd Bergmann <arnd@arndb.de>
Mon, 24 Feb 2025 14:16:09 +0000 (15:16 +0100)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 14 Mar 2025 22:56:04 +0000 (15:56 -0700)
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.

Link: https://lkml.kernel.org/r/20250224141849.1546019-1-arnd@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org>
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Cc: Joel Granados <joel.granados@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
kernel/reboot.c

index 5299790a2832d07a55c9d38502763b58d53f927b..2d6a06fe6c66d861a76576bdecbe9a18ee4216d3 100644 (file)
@@ -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)
 {