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

regulator: qcom_rpm: Constify struct regulator_ops

These are never modified, so make them const to allow the compiler to
put them in read-only memory.

Before:
text data bss dec hex filename
17485 500 8 17993 4649 drivers/regulator/qcom_rpm-regulator.o

After:
text data bss dec hex filename
17881 104 8 17993 4649 drivers/regulator/qcom_rpm-regulator.o

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

authored by

Rikard Falkeborn and committed by
Mark Brown
8d41df64 bfa29acd

+3 -3
+3 -3
drivers/regulator/qcom_rpm-regulator.c
··· 407 407 return ret; 408 408 } 409 409 410 - static struct regulator_ops uV_ops = { 410 + static const struct regulator_ops uV_ops = { 411 411 .list_voltage = regulator_list_voltage_linear_range, 412 412 413 413 .set_voltage_sel = rpm_reg_set_uV_sel, ··· 420 420 .set_load = rpm_reg_set_load, 421 421 }; 422 422 423 - static struct regulator_ops mV_ops = { 423 + static const struct regulator_ops mV_ops = { 424 424 .list_voltage = regulator_list_voltage_linear_range, 425 425 426 426 .set_voltage_sel = rpm_reg_set_mV_sel, ··· 433 433 .set_load = rpm_reg_set_load, 434 434 }; 435 435 436 - static struct regulator_ops switch_ops = { 436 + static const struct regulator_ops switch_ops = { 437 437 .enable = rpm_reg_switch_enable, 438 438 .disable = rpm_reg_switch_disable, 439 439 .is_enabled = rpm_reg_is_enabled,