* [PATCH] power: supply: cw2015: Use ARRAY_SIZE() to set n_yes_ranges
@ 2026-11-02 11:09 Thorsten Blum
0 siblings, 0 replies; only message in thread
From: Thorsten Blum @ 2026-11-02 11:09 UTC (permalink / raw)
To: Tobias Schrammm, Sebastian Reichel; +Cc: Thorsten Blum, linux-pm, linux-kernel
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 = {
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-02 11:10 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-02 11:09 [PATCH] power: supply: cw2015: Use ARRAY_SIZE() to set n_yes_ranges Thorsten Blum
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®