From: Sasha Levin <sashal@kernel.org>
To: Sebastian Reichel <sre@kernel.org>
Cc: Xu Rao <raoxu@uniontech.com>,
Nathan Chancellor <nathan@kernel.org>,
linux-pm@vger.kernel.org, llvm@lists.linux.dev,
linux-kernel@vger.kernel.org
Subject: [PATCH] power: supply: gpio-charger: mark gpio_charger_properties as __maybe_unused
Date: Mon, 16 Nov 2026 07:41:17 -0500 [thread overview]
Message-ID: <20261116124117.2922333-1-sashal@kernel.org> (raw)
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
next reply other threads:[~2026-11-16 12:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-16 12:41 Sasha Levin [this message]
2026-11-16 18:51 ` [PATCH] power: supply: gpio-charger: mark gpio_charger_properties as __maybe_unused Nathan Chancellor
2026-11-17 1:17 ` Sebastian Reichel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261116124117.2922333-1-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=nathan@kernel.org \
--cc=raoxu@uniontech.com \
--cc=sre@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.