Skip to content

Commit 238b671

Browse files
tititiou36lag-linaro
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/117946696551de41b706ea9b973a7ccaacea5178.1750530460.git.christophe.jaillet@wanadoo.fr Signed-off-by: Lee Jones <[email protected]>
1 parent 86b0fc4 commit 238b671

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/mfd/tps65219.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ static const struct regmap_irq_sub_irq_map tps65215_sub_irq_offsets[] = {
260260
REGMAP_IRQ_MAIN_REG_OFFSET(bit7_offsets),
261261
};
262262

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[] = {
264264
REGMAP_IRQ_MAIN_REG_OFFSET(tps65214_bit0_offsets),
265265
REGMAP_IRQ_MAIN_REG_OFFSET(tps65214_bit1_offsets),
266266
REGMAP_IRQ_MAIN_REG_OFFSET(tps65214_bit2_offsets),
@@ -455,7 +455,7 @@ struct tps65219_chip_data {
455455
int n_cells;
456456
};
457457

458-
static struct tps65219_chip_data chip_info_table[] = {
458+
static const struct tps65219_chip_data chip_info_table[] = {
459459
[TPS65214] = {
460460
.irq_chip = &tps65214_irq_chip,
461461
.cells = tps65214_cells,
@@ -476,7 +476,7 @@ static struct tps65219_chip_data chip_info_table[] = {
476476
static int tps65219_probe(struct i2c_client *client)
477477
{
478478
struct tps65219 *tps;
479-
struct tps65219_chip_data *pmic;
479+
const struct tps65219_chip_data *pmic;
480480
bool pwr_button;
481481
int ret;
482482

0 commit comments

Comments
 (0)