* [PATCH] power: supply: gpio-charger: mark gpio_charger_properties as __maybe_unused
@ 2026-11-16 12:41 Sasha Levin
2026-11-16 18:51 ` Nathan Chancellor
0 siblings, 1 reply; 2+ messages in thread
From: Sasha Levin @ 2026-11-16 12:41 UTC (permalink / raw)
To: Sebastian Reichel; +Cc: Xu Rao, Nathan Chancellor, linux-pm, llvm, linux-kernel
Commit fad4655224f60 ("power: supply: gpio-charger: Keep properties per
device") keeps gpio_charger_properties[] only to size the per-device array
with ARRAY_SIZE(). clang sees that the array itself is never emitted and
warns, which fails the build with CONFIG_WERROR:
drivers/power/supply/gpio-charger.c:26:35: error: variable 'gpio_charger_properties' is not needed and will not be emitted [-Werror,-Wunneeded-internal-declaration]
Mark the array __maybe_unused.
Fixes: fad4655224f60 ("power: supply: gpio-charger: Keep properties per device")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fad4655224f60 is the tip of power-supply's for-next.
drivers/power/supply/gpio-charger.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/power/supply/gpio-charger.c b/drivers/power/supply/gpio-charger.c
index c90c824382c62..647f5bde38c7c 100644
--- a/drivers/power/supply/gpio-charger.c
+++ b/drivers/power/supply/gpio-charger.c
@@ -23,7 +23,7 @@ struct gpio_mapping {
} __packed;
/* This list ensures, that the array is big enough for all optional features. */
-static enum power_supply_property gpio_charger_properties[] = {
+static enum power_supply_property gpio_charger_properties[] __maybe_unused = {
POWER_SUPPLY_PROP_ONLINE,
POWER_SUPPLY_PROP_STATUS,
POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT_MAX,
base-commit: fad4655224f60328cc9bcf4399eda8f6d7a587a6
--
2.53.0
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] power: supply: gpio-charger: mark gpio_charger_properties as __maybe_unused
2026-11-16 12:41 [PATCH] power: supply: gpio-charger: mark gpio_charger_properties as __maybe_unused Sasha Levin
@ 2026-11-16 18:51 ` Nathan Chancellor
0 siblings, 0 replies; 2+ messages in thread
From: Nathan Chancellor @ 2026-11-16 18:51 UTC (permalink / raw)
To: Sasha Levin; +Cc: Sebastian Reichel, Xu Rao, linux-pm, llvm, linux-kernel
On Mon, Nov 16, 2026 at 07:41:17AM -0500, Sasha Levin wrote:
> Commit fad4655224f60 ("power: supply: gpio-charger: Keep properties per
> device") keeps gpio_charger_properties[] only to size the per-device array
> with ARRAY_SIZE(). clang sees that the array itself is never emitted and
> warns, which fails the build with CONFIG_WERROR:
>
> drivers/power/supply/gpio-charger.c:26:35: error: variable 'gpio_charger_properties' is not needed and will not be emitted [-Werror,-Wunneeded-internal-declaration]
>
> Mark the array __maybe_unused.
>
> Fixes: fad4655224f60 ("power: supply: gpio-charger: Keep properties per device")
> Signed-off-by: Sasha Levin <sashal@kernel.org>
> ---
> fad4655224f60 is the tip of power-supply's for-next.
Since the Fixes has 'Cc: stable', this one should too (unless this is
just going to be squashed in).
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
> drivers/power/supply/gpio-charger.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/power/supply/gpio-charger.c b/drivers/power/supply/gpio-charger.c
> index c90c824382c62..647f5bde38c7c 100644
> --- a/drivers/power/supply/gpio-charger.c
> +++ b/drivers/power/supply/gpio-charger.c
> @@ -23,7 +23,7 @@ struct gpio_mapping {
> } __packed;
>
> /* This list ensures, that the array is big enough for all optional features. */
> -static enum power_supply_property gpio_charger_properties[] = {
> +static enum power_supply_property gpio_charger_properties[] __maybe_unused = {
> POWER_SUPPLY_PROP_ONLINE,
> POWER_SUPPLY_PROP_STATUS,
> POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT_MAX,
>
> base-commit: fad4655224f60328cc9bcf4399eda8f6d7a587a6
> --
> 2.53.0
>
--
Cheers,
Nathan
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-16 18:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-16 12:41 [PATCH] power: supply: gpio-charger: mark gpio_charger_properties as __maybe_unused Sasha Levin
2026-11-16 18:51 ` Nathan Chancellor
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®