From: Christophe JAILLET Date: Sat, 4 May 2024 22:43:07 +0000 (+0200) Subject: rtc: rx6110: Constify struct regmap_config X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=6a216cbadbe061f16472981982aa2bcc20ea54a0;p=linux.git 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 Link: https://lore.kernel.org/r/833a7f612c0de9dcb1179a0b75b189c237a335ac.1714862560.git.christophe.jaillet@wanadoo.fr Signed-off-by: Alexandre Belloni --- diff --git a/drivers/rtc/rtc-rx6110.c b/drivers/rtc/rtc-rx6110.c index 834274db8c3fd..af6dd6ccbe3b7 100644 --- a/drivers/rtc/rtc-rx6110.c +++ b/drivers/rtc/rtc-rx6110.c @@ -330,7 +330,7 @@ static int rx6110_probe(struct rx6110_data *rx6110, struct device *dev) } #if IS_ENABLED(CONFIG_SPI_MASTER) -static struct regmap_config regmap_spi_config = { +static const struct regmap_config regmap_spi_config = { .reg_bits = 8, .val_bits = 8, .max_register = RX6110_REG_IRQ, @@ -410,7 +410,7 @@ static void rx6110_spi_unregister(void) #endif /* CONFIG_SPI_MASTER */ #if IS_ENABLED(CONFIG_I2C) -static struct regmap_config regmap_i2c_config = { +static const struct regmap_config regmap_i2c_config = { .reg_bits = 8, .val_bits = 8, .max_register = RX6110_REG_IRQ,