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

Configure Feed

Select the types of activity you want to include in your feed.

mfd: tps65219: Constify struct regmap_irq_sub_irq_map and tps65219_chip_data

'struct regmap_irq_sub_irq_map' and 'struct tps65219_chip_data' are not
modified in this driver.

Constifying these structures moves some data to a read-only section, so
increases overall security.

On a x86_64, with allmodconfig:
Before:
======
text data bss dec hex filename
27804 10016 256 38076 94bc drivers/mfd/tps65219.o

After:
=====
text data bss dec hex filename
27893 9792 256 37941 9435 drivers/mfd/tps65219.o

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/117946696551de41b706ea9b973a7ccaacea5178.1750530460.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Lee Jones <lee@kernel.org>

authored by

Christophe JAILLET and committed by
Lee Jones
238b671d 86b0fc4b

+3 -3
+3 -3
drivers/mfd/tps65219.c
··· 260 260 REGMAP_IRQ_MAIN_REG_OFFSET(bit7_offsets), 261 261 }; 262 262 263 - static struct regmap_irq_sub_irq_map tps65214_sub_irq_offsets[] = { 263 + static const struct regmap_irq_sub_irq_map tps65214_sub_irq_offsets[] = { 264 264 REGMAP_IRQ_MAIN_REG_OFFSET(tps65214_bit0_offsets), 265 265 REGMAP_IRQ_MAIN_REG_OFFSET(tps65214_bit1_offsets), 266 266 REGMAP_IRQ_MAIN_REG_OFFSET(tps65214_bit2_offsets), ··· 455 455 int n_cells; 456 456 }; 457 457 458 - static struct tps65219_chip_data chip_info_table[] = { 458 + static const struct tps65219_chip_data chip_info_table[] = { 459 459 [TPS65214] = { 460 460 .irq_chip = &tps65214_irq_chip, 461 461 .cells = tps65214_cells, ··· 476 476 static int tps65219_probe(struct i2c_client *client) 477 477 { 478 478 struct tps65219 *tps; 479 - struct tps65219_chip_data *pmic; 479 + const struct tps65219_chip_data *pmic; 480 480 bool pwr_button; 481 481 int ret; 482 482