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

leds: is31fl319x: Constify struct regmap_config

'is31fl3190_regmap_config' and 'is31fl3196_regmap_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
13827 2002 32 15861 3df5 drivers/leds/leds-is31fl319x.o

After:
text data bss dec hex filename
14467 1370 32 15869 3dfd drivers/leds/leds-is31fl319x.o

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

authored by

Christophe JAILLET and committed by
Lee Jones
4a598907 59561ccd

+2 -2
+2 -2
drivers/leds/leds-is31fl319x.c
··· 140 140 { IS31FL3190_PWM(2), 0x00 }, 141 141 }; 142 142 143 - static struct regmap_config is31fl3190_regmap_config = { 143 + static const struct regmap_config is31fl3190_regmap_config = { 144 144 .reg_bits = 8, 145 145 .val_bits = 8, 146 146 .max_register = IS31FL3190_RESET, ··· 178 178 { IS31FL3196_PWM(8), 0x00 }, 179 179 }; 180 180 181 - static struct regmap_config is31fl3196_regmap_config = { 181 + static const struct regmap_config is31fl3196_regmap_config = { 182 182 .reg_bits = 8, 183 183 .val_bits = 8, 184 184 .max_register = IS31FL3196_REG_CNT,