Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

regulator: fixed: Constify static regulator_ops

The only usage of fixed_voltage_ops and fixed_voltage_clkenabled_ops is
to assign their address the ops field in the regulator_desc struct,
which is a const pointer. Make them const to allow the compiler to put
them in read-only memory.
make them const to allow the compiler to put them in read-only memory.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Link: https://lore.kernel.org/r/20200913084114.8851-3-rikard.falkeborn@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Rikard Falkeborn and committed by
Mark Brown
96ee75ff 087c09c2

+2 -2
+2 -2
drivers/regulator/fixed.c
··· 123 123 return config; 124 124 } 125 125 126 - static struct regulator_ops fixed_voltage_ops = { 126 + static const struct regulator_ops fixed_voltage_ops = { 127 127 }; 128 128 129 - static struct regulator_ops fixed_voltage_clkenabled_ops = { 129 + static const struct regulator_ops fixed_voltage_clkenabled_ops = { 130 130 .enable = reg_clock_enable, 131 131 .disable = reg_clock_disable, 132 132 .is_enabled = reg_clock_is_enabled,