power: supply: cw2015: Use ARRAY_SIZE() to set n_yes_ranges
Subsystems (2)
PATCH 1/1 power: supply: cw2015: Use ARRAY_SIZE() to set n_yes_ranges
Use ARRAY_SIZE() to replace the hard-coded values.
Signed-off-by Thorsten Blum <[email protected]>
--- drivers/power/supply/cw2015_battery.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/power/supply/cw2015_battery.c +3 -3
@@ -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 = {
Sebastian Reichel
AppliedQuoted 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]>