Skip to content

Commit b5289ba

Browse files
t-8chsre
authored andcommitted
power: supply: samsung-sdi-battery: constify ocv table
The power supply core now allows this constification. Prevent accidental or malicious modification of the data. Signed-off-by: Thomas Weißschuh <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Link: https://lore.kernel.org/r/20241005-power-supply-battery-const-v1-7-c1f721927048@weissschuh.net Signed-off-by: Sebastian Reichel <[email protected]>
1 parent b7b6bf4 commit b5289ba

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/power/supply/samsung-sdi-battery.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ static const struct power_supply_resistance_temp_table samsung_temp2res[] = {
447447
* These must be sorted by falling OCV value.
448448
*/
449449

450-
static struct power_supply_battery_ocv_table samsung_ocv_cap_eb485159lu[] = {
450+
static const struct power_supply_battery_ocv_table samsung_ocv_cap_eb485159lu[] = {
451451
{ .ocv = 4330000, .capacity = 100},
452452
{ .ocv = 4320000, .capacity = 99},
453453
{ .ocv = 4283000, .capacity = 95},
@@ -499,7 +499,7 @@ static struct power_supply_battery_ocv_table samsung_ocv_cap_eb485159lu[] = {
499499
};
500500

501501
/* Same capacity table is used by eb-l1m7flu, eb425161la, eb425161lu */
502-
static struct power_supply_battery_ocv_table samsung_ocv_cap_1500mah[] = {
502+
static const struct power_supply_battery_ocv_table samsung_ocv_cap_1500mah[] = {
503503
{ .ocv = 4328000, .capacity = 100},
504504
{ .ocv = 4299000, .capacity = 99},
505505
{ .ocv = 4281000, .capacity = 98},
@@ -540,7 +540,7 @@ static struct power_supply_battery_ocv_table samsung_ocv_cap_1500mah[] = {
540540
{ .ocv = 3300000, .capacity = 0},
541541
};
542542

543-
static struct power_supply_battery_ocv_table samsung_ocv_cap_eb535151vu[] = {
543+
static const struct power_supply_battery_ocv_table samsung_ocv_cap_eb535151vu[] = {
544544
{ .ocv = 4178000, .capacity = 100},
545545
{ .ocv = 4148000, .capacity = 99},
546546
{ .ocv = 4105000, .capacity = 95},
@@ -572,7 +572,7 @@ static struct power_supply_battery_ocv_table samsung_ocv_cap_eb535151vu[] = {
572572
{ .ocv = 3300000, .capacity = 0},
573573
};
574574

575-
static struct power_supply_battery_ocv_table samsung_ocv_cap_eb585157lu[] = {
575+
static const struct power_supply_battery_ocv_table samsung_ocv_cap_eb585157lu[] = {
576576
{ .ocv = 4320000, .capacity = 100},
577577
{ .ocv = 4296000, .capacity = 99},
578578
{ .ocv = 4283000, .capacity = 98},

0 commit comments

Comments
 (0)