Skip to contentSkip to conversation

power: supply: cw2015: Use ARRAY_SIZE() to set n_yes_ranges

PATCH Applied Thorsten Blum 2 participants 2 messages Nov 2 – Nov 9

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 power: supply: cw2015: Use ARRAY_SIZE() to set n_yes_ranges

Use ARRAY_SIZE() to replace the hard-coded values.

---
 drivers/power/supply/cw2015_battery.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/power/supply/cw2015_battery.c +3 -3
index 1bcb60cf763d..7c82ba6ca0ce 100644
@@ -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 = {
#1 lore raw
Quoted 1 line · Thorsten Blum

Use ARRAY_SIZE() to replace the hard-coded values.

Applied, thanks!

[1/1] power: supply: cw2015: Use ARRAY_SIZE() to set n_yes_ranges

      commit: bc0652e00cb16384ba72a4ba3cc13c9b57571b20

Best regards,

Signature · 1 line
Sebastian Reichel <[email protected]>