diff mbox series

[4/7] power: supply: sc27xx: use const reference to ocv table

Message ID 20241005-power-supply-battery-const-v1-4-c1f721927048@weissschuh.net (mailing list archive)
State Handled Elsewhere, archived
Headers show
Series power: supply: constify ocv and resistance tables | expand

Commit Message

Thomas Weißschuh Oct. 5, 2024, 10:04 a.m. UTC
The table is not modified, so constify the reference.
This enables a constification in the power supply core.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
 drivers/power/supply/sc27xx_fuel_gauge.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Baolin Wang Oct. 10, 2024, 9:24 a.m. UTC | #1
On 2024/10/5 18:04, Thomas Weißschuh wrote:
> The table is not modified, so constify the reference.
> This enables a constification in the power supply core.
> 
> Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>

Thanks.
Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>

> ---
>   drivers/power/supply/sc27xx_fuel_gauge.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/power/supply/sc27xx_fuel_gauge.c b/drivers/power/supply/sc27xx_fuel_gauge.c
> index bd23c4d9fed43482e972ccc086311e7bfcec2d54..426d423b935b581a7673be076ae71b8899f17e2e 100644
> --- a/drivers/power/supply/sc27xx_fuel_gauge.c
> +++ b/drivers/power/supply/sc27xx_fuel_gauge.c
> @@ -992,7 +992,7 @@ static int sc27xx_fgu_calibration(struct sc27xx_fgu_data *data)
>   static int sc27xx_fgu_hw_init(struct sc27xx_fgu_data *data)
>   {
>   	struct power_supply_battery_info *info;
> -	struct power_supply_battery_ocv_table *table;
> +	const struct power_supply_battery_ocv_table *table;
>   	int ret, delta_clbcnt, alarm_adc;
>   
>   	ret = power_supply_get_battery_info(data->battery, &info);
>
diff mbox series

Patch

diff --git a/drivers/power/supply/sc27xx_fuel_gauge.c b/drivers/power/supply/sc27xx_fuel_gauge.c
index bd23c4d9fed43482e972ccc086311e7bfcec2d54..426d423b935b581a7673be076ae71b8899f17e2e 100644
--- a/drivers/power/supply/sc27xx_fuel_gauge.c
+++ b/drivers/power/supply/sc27xx_fuel_gauge.c
@@ -992,7 +992,7 @@  static int sc27xx_fgu_calibration(struct sc27xx_fgu_data *data)
 static int sc27xx_fgu_hw_init(struct sc27xx_fgu_data *data)
 {
 	struct power_supply_battery_info *info;
-	struct power_supply_battery_ocv_table *table;
+	const struct power_supply_battery_ocv_table *table;
 	int ret, delta_clbcnt, alarm_adc;
 
 	ret = power_supply_get_battery_info(data->battery, &info);