media: platform: allegro-dvt: Constify struct regmap_config

'allegro_regmap_config' and 'allegro_sram_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
  79587	   3706	    116	  83409	  145d1	drivers/media/platform/allegro-dvt/allegro-core.o

After:
   text	   data	    bss	    dec	    hex	filename
  80219	   3066	    116	  83401	  145c9	drivers/media/platform/allegro-dvt/allegro-core.o

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Michael Tretter <m.tretter@pengutronix.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
This commit is contained in:
Christophe JAILLET 2024-05-05 09:28:25 +02:00 committed by Hans Verkuil
parent f79f8a8a96
commit 343cb1ec7b

View File

@ -179,7 +179,7 @@ struct allegro_dev {
struct list_head channels;
};
static struct regmap_config allegro_regmap_config = {
static const struct regmap_config allegro_regmap_config = {
.name = "regmap",
.reg_bits = 32,
.val_bits = 32,
@ -188,7 +188,7 @@ static struct regmap_config allegro_regmap_config = {
.cache_type = REGCACHE_NONE,
};
static struct regmap_config allegro_sram_config = {
static const struct regmap_config allegro_sram_config = {
.name = "sram",
.reg_bits = 32,
.val_bits = 32,