diff options
author | Christophe JAILLET <christophe.jaillet@wanadoo.fr> | 2024-09-09 20:35:08 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2024-09-09 21:08:42 +0100 |
commit | 48cc042bd68e0225f1e6b137452e3d867e7c0942 (patch) | |
tree | e3d125752865cbf7488b2cc050a307851efa53f8 /drivers/regulator/wm8400-regulator.c | |
parent | 0c0966b5019f97e2af0ab802c1453162748b1166 (diff) | |
download | linux-48cc042bd68e0225f1e6b137452e3d867e7c0942.tar.gz linux-48cc042bd68e0225f1e6b137452e3d867e7c0942.tar.bz2 linux-48cc042bd68e0225f1e6b137452e3d867e7c0942.zip |
regulator: wm8400: Constify struct regulator_desc
'struct regulator_desc' is not modified in this driver.
Constifying this structure moves some data to a read-only section, so
increases overall security, especially when the structure holds some
function pointers.
On a x86_64, with allmodconfig:
Before:
======
text data bss dec hex filename
4419 2512 0 6931 1b13 drivers/regulator/wm8400-regulator.o
After:
=====
text data bss dec hex filename
6307 624 0 6931 1b13 drivers/regulator/wm8400-regulator.o
--
Compile tested only
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://patch.msgid.link/fde33ecfd9bbdbdc1da1620c9f3b1b7a72f9d805.1725906876.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/regulator/wm8400-regulator.c')
-rw-r--r-- | drivers/regulator/wm8400-regulator.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/regulator/wm8400-regulator.c b/drivers/regulator/wm8400-regulator.c index c4a229f66dec..fb3ca7956d00 100644 --- a/drivers/regulator/wm8400-regulator.c +++ b/drivers/regulator/wm8400-regulator.c @@ -112,7 +112,7 @@ static const struct regulator_ops wm8400_dcdc_ops = { .get_optimum_mode = wm8400_dcdc_get_optimum_mode, }; -static struct regulator_desc regulators[] = { +static const struct regulator_desc regulators[] = { { .name = "LDO1", .id = WM8400_LDO1, |