reboot: hide unused hw_protection_attr
PATCH 1/1 reboot: hide unused hw_protection_attr
From: Arnd Bergmann <[email protected]>
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 <[email protected]>
--- kernel/reboot.c | 2 ++ 1 file changed, 2 insertions(+)
kernel/reboot.c +2 -0
@@ -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) {
Signature · 1 line
2.39.5
Quoted 5 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
The reference to
hw_protection_attris inside of an #ifdef block, but the definition is not:
Quoted 8 lines
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 <[email protected]>
Reviewed-by Tzung-Bi Shih <[email protected]>