* [PATCH] reboot: hide unused hw_protection_attr
@ 2025-02-24 14:16 Arnd Bergmann
2025-02-25 1:00 ` Tzung-Bi Shih
0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2025-02-24 14:16 UTC (permalink / raw)
To: Ahmad Fatoum, Tzung-Bi Shih, Andrew Morton
Cc: Arnd Bergmann, Joel Granados, linux-kernel
From: Arnd Bergmann <arnd@arndb.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@arndb.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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] reboot: hide unused hw_protection_attr
2025-02-24 14:16 [PATCH] reboot: hide unused hw_protection_attr Arnd Bergmann
@ 2025-02-25 1:00 ` Tzung-Bi Shih
0 siblings, 0 replies; 2+ messages in thread
From: Tzung-Bi Shih @ 2025-02-25 1:00 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Ahmad Fatoum, Andrew Morton, Arnd Bergmann, Joel Granados,
linux-kernel
On Mon, Feb 24, 2025 at 03:16:09PM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.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@arndb.de>
Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-02-25 1:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-24 14:16 [PATCH] reboot: hide unused hw_protection_attr Arnd Bergmann
2025-02-25 1:00 ` Tzung-Bi Shih
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox