summaryrefslogtreecommitdiffstats
path: root/drivers/power/supply/power_supply_core.c
diff options
context:
space:
mode:
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>2024-06-23 08:45:33 +0200
committerSebastian Reichel <sebastian.reichel@collabora.com>2024-06-26 17:32:00 +0200
commit5d55721d6e24c8e99cc86ee1fcb90d776ef47964 (patch)
treec9ac367616efbe34b290b1d60821cb7cfa202feb /drivers/power/supply/power_supply_core.c
parentdb9cc848128eb174b24a5dff82fc3e7589a3bf25 (diff)
downloadlinux-stable-5d55721d6e24c8e99cc86ee1fcb90d776ef47964.tar.gz
linux-stable-5d55721d6e24c8e99cc86ee1fcb90d776ef47964.tar.bz2
linux-stable-5d55721d6e24c8e99cc86ee1fcb90d776ef47964.zip
power: supply: samsung-sdi-battery: Constify struct power_supply_vbat_ri_table
'struct power_supply_vbat_ri_table' are not modified in this driver. Constifying these structures moves some data to a read-only section, so increase overall security. In order to do it, some code also needs to be adjusted to this new const qualifier. On a x86_64, with allmodconfig: Before: ====== $ size drivers/power/supply/samsung-sdi-battery.o text data bss dec hex filename 955 7664 0 8619 21ab drivers/power/supply/samsung-sdi-battery.o After: ===== $ size drivers/power/supply/samsung-sdi-battery.o text data bss dec hex filename 4055 4584 0 8639 21bf drivers/power/supply/samsung-sdi-battery.o Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/d01818abd880bf435d1106a9a6cc11a7a8a3e661.1719125040.git.christophe.jaillet@wanadoo.fr Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Diffstat (limited to 'drivers/power/supply/power_supply_core.c')
-rw-r--r--drivers/power/supply/power_supply_core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/power/supply/power_supply_core.c b/drivers/power/supply/power_supply_core.c
index fefe938c9342..022d0e4bf621 100644
--- a/drivers/power/supply/power_supply_core.c
+++ b/drivers/power/supply/power_supply_core.c
@@ -1024,7 +1024,7 @@ EXPORT_SYMBOL_GPL(power_supply_temp2resist_simple);
int power_supply_vbat2ri(struct power_supply_battery_info *info,
int vbat_uv, bool charging)
{
- struct power_supply_vbat_ri_table *vbat2ri;
+ const struct power_supply_vbat_ri_table *vbat2ri;
int table_len;
int i, high, low;