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

regulator: max77802-regulator: constify regulator_ops structure

Declare regulator_ops structure as const as it is only stored in the ops
field of a regulator_desc structure. This field is of type const, so
regulator_ops structures having this property can be made const too.

File size before: drivers/regulator/max77802-regulator.o
text data bss dec hex filename
11811 1552 0 13363 3433 regulator/max77802-regulator.o

File size after: drivers/regulator/max77802-regulator.o
text data bss dec hex filename
13091 272 0 13363 3433 regulator/max77802-regulator.o

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Bhumika Goyal and committed by
Mark Brown
0301987a d00b7461

+5 -5
+5 -5
drivers/regulator/max77802-regulator.c
··· 288 288 /* 289 289 * LDOs 2, 4-19, 22-35 290 290 */ 291 - static struct regulator_ops max77802_ldo_ops_logic1 = { 291 + static const struct regulator_ops max77802_ldo_ops_logic1 = { 292 292 .list_voltage = regulator_list_voltage_linear, 293 293 .map_voltage = regulator_map_voltage_linear, 294 294 .is_enabled = regulator_is_enabled_regmap, ··· 304 304 /* 305 305 * LDOs 1, 20, 21, 3 306 306 */ 307 - static struct regulator_ops max77802_ldo_ops_logic2 = { 307 + static const struct regulator_ops max77802_ldo_ops_logic2 = { 308 308 .list_voltage = regulator_list_voltage_linear, 309 309 .map_voltage = regulator_map_voltage_linear, 310 310 .is_enabled = regulator_is_enabled_regmap, ··· 319 319 }; 320 320 321 321 /* BUCKS 1, 6 */ 322 - static struct regulator_ops max77802_buck_16_dvs_ops = { 322 + static const struct regulator_ops max77802_buck_16_dvs_ops = { 323 323 .list_voltage = regulator_list_voltage_linear, 324 324 .map_voltage = regulator_map_voltage_linear, 325 325 .is_enabled = regulator_is_enabled_regmap, ··· 333 333 }; 334 334 335 335 /* BUCKs 2-4 */ 336 - static struct regulator_ops max77802_buck_234_ops = { 336 + static const struct regulator_ops max77802_buck_234_ops = { 337 337 .list_voltage = regulator_list_voltage_linear, 338 338 .map_voltage = regulator_map_voltage_linear, 339 339 .is_enabled = regulator_is_enabled_regmap, ··· 348 348 }; 349 349 350 350 /* BUCKs 5, 7-10 */ 351 - static struct regulator_ops max77802_buck_dvs_ops = { 351 + static const struct regulator_ops max77802_buck_dvs_ops = { 352 352 .list_voltage = regulator_list_voltage_linear, 353 353 .map_voltage = regulator_map_voltage_linear, 354 354 .is_enabled = regulator_is_enabled_regmap,