Skip to content

Commit 6a216cb

Browse files
tititiou36alexandrebelloni
authored andcommitted
rtc: rx6110: Constify struct regmap_config
'regmap_spi_config' and 'regmap_i2c_config' are not modified in this diver and are only used as a const struct regmap_config. Constifying these structures moves some data to a read-only section, so increase overall security. On a x86_64, with allmodconfig: Before: text data bss dec hex filename 8896 1554 32 10482 28f2 drivers/rtc/rtc-rx6110.o After: text data bss dec hex filename 9536 914 32 10482 28f2 drivers/rtc/rtc-rx6110.o Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Link: https://lore.kernel.org/r/833a7f612c0de9dcb1179a0b75b189c237a335ac.1714862560.git.christophe.jaillet@wanadoo.fr Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
1 parent 1c431b9 commit 6a216cb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/rtc/rtc-rx6110.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ static int rx6110_probe(struct rx6110_data *rx6110, struct device *dev)
330330
}
331331

332332
#if IS_ENABLED(CONFIG_SPI_MASTER)
333-
static struct regmap_config regmap_spi_config = {
333+
static const struct regmap_config regmap_spi_config = {
334334
.reg_bits = 8,
335335
.val_bits = 8,
336336
.max_register = RX6110_REG_IRQ,
@@ -410,7 +410,7 @@ static void rx6110_spi_unregister(void)
410410
#endif /* CONFIG_SPI_MASTER */
411411

412412
#if IS_ENABLED(CONFIG_I2C)
413-
static struct regmap_config regmap_i2c_config = {
413+
static const struct regmap_config regmap_i2c_config = {
414414
.reg_bits = 8,
415415
.val_bits = 8,
416416
.max_register = RX6110_REG_IRQ,

0 commit comments

Comments
 (0)