From: Thorsten Blum <blum@kernel.org>
To: Tobias Schrammm <t.schramm@manjaro.org>,
Sebastian Reichel <sre@kernel.org>
Cc: Thorsten Blum <blum@kernel.org>,
linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] power: supply: cw2015: Use ARRAY_SIZE() to set n_yes_ranges
Date: Mon, 2 Nov 2026 12:09:51 +0100 [thread overview]
Message-ID: <20261102110951.229606-2-blum@kernel.org> (raw)
Use ARRAY_SIZE() to replace the hard-coded values.
Signed-off-by: Thorsten Blum <blum@kernel.org>
---
drivers/power/supply/cw2015_battery.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/power/supply/cw2015_battery.c b/drivers/power/supply/cw2015_battery.c
index 1bcb60cf763d..7c82ba6ca0ce 100644
--- a/drivers/power/supply/cw2015_battery.c
+++ b/drivers/power/supply/cw2015_battery.c
@@ -603,7 +603,7 @@ static const struct regmap_range regmap_ranges_rd_yes[] = {
static const struct regmap_access_table regmap_rd_table = {
.yes_ranges = regmap_ranges_rd_yes,
- .n_yes_ranges = 4,
+ .n_yes_ranges = ARRAY_SIZE(regmap_ranges_rd_yes),
};
static const struct regmap_range regmap_ranges_wr_yes[] = {
@@ -615,7 +615,7 @@ static const struct regmap_range regmap_ranges_wr_yes[] = {
static const struct regmap_access_table regmap_wr_table = {
.yes_ranges = regmap_ranges_wr_yes,
- .n_yes_ranges = 3,
+ .n_yes_ranges = ARRAY_SIZE(regmap_ranges_wr_yes),
};
static const struct regmap_range regmap_ranges_vol_yes[] = {
@@ -624,7 +624,7 @@ static const struct regmap_range regmap_ranges_vol_yes[] = {
static const struct regmap_access_table regmap_vol_table = {
.yes_ranges = regmap_ranges_vol_yes,
- .n_yes_ranges = 1,
+ .n_yes_ranges = ARRAY_SIZE(regmap_ranges_vol_yes),
};
static const struct regmap_config cw2015_regmap_config = {
reply other threads:[~2026-11-02 11:10 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20261102110951.229606-2-blum@kernel.org \
--to=blum@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=sre@kernel.org \
--cc=t.schramm@manjaro.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 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®