auxdisplay: img-ascii-lcd: Constify struct img_ascii_lcd_config

'struct img_ascii_lcd_config' is not modified in this driver.

Constifying this structure moves some data to a read-only section, so
increase overall security, especially when the structure holds some
function pointers.

On a x86_64, with allmodconfig:
Before:
======
   text	   data	    bss	    dec	    hex	filename
   6110	    728	      0	   6838	   1ab6	drivers/auxdisplay/img-ascii-lcd.o

After:
=====
   text	   data	    bss	    dec	    hex	filename
   6198	    632	      0	   6830	   1aae	drivers/auxdisplay/img-ascii-lcd.o

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
This commit is contained in:
Christophe JAILLET 2024-12-06 23:25:42 +01:00 committed by Andy Shevchenko
parent e4ee5c3c43
commit 93b216cb31

View File

@ -69,7 +69,7 @@ static void boston_update(struct linedisp *linedisp)
#endif
}
static struct img_ascii_lcd_config boston_config = {
static const struct img_ascii_lcd_config boston_config = {
.num_chars = 8,
.ops = {
.update = boston_update,
@ -98,7 +98,7 @@ static void malta_update(struct linedisp *linedisp)
pr_err_ratelimited("Failed to update LCD display: %d\n", err);
}
static struct img_ascii_lcd_config malta_config = {
static const struct img_ascii_lcd_config malta_config = {
.num_chars = 8,
.external_regmap = true,
.ops = {
@ -200,7 +200,7 @@ static void sead3_update(struct linedisp *linedisp)
pr_err_ratelimited("Failed to update LCD display: %d\n", err);
}
static struct img_ascii_lcd_config sead3_config = {
static const struct img_ascii_lcd_config sead3_config = {
.num_chars = 16,
.external_regmap = true,
.ops = {