Re: [PATCH] reboot: hide unused hw_protection_attr
From: Tzung-Bi Shih
Date: Mon Feb 24 2025 - 20:00:15 EST
On Mon, Feb 24, 2025 at 03:16:09PM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@xxxxxxxx>
>
> 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@xxxxxxxx>
Reviewed-by: Tzung-Bi Shih <tzungbi@xxxxxxxxxx>