Commit 48cc042b authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Mark Brown

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: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://patch.msgid.link/fde33ecfd9bbdbdc1da1620c9f3b1b7a72f9d805.1725906876.git.christophe.jaillet@wanadoo.frSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 0c0966b5
......@@ -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,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment