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

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>

authored by

Christophe JAILLET and committed by
Andy Shevchenko
93b216cb e4ee5c3c

+3 -3
+3 -3
drivers/auxdisplay/img-ascii-lcd.c
··· 69 69 #endif 70 70 } 71 71 72 - static struct img_ascii_lcd_config boston_config = { 72 + static const struct img_ascii_lcd_config boston_config = { 73 73 .num_chars = 8, 74 74 .ops = { 75 75 .update = boston_update, ··· 98 98 pr_err_ratelimited("Failed to update LCD display: %d\n", err); 99 99 } 100 100 101 - static struct img_ascii_lcd_config malta_config = { 101 + static const struct img_ascii_lcd_config malta_config = { 102 102 .num_chars = 8, 103 103 .external_regmap = true, 104 104 .ops = { ··· 200 200 pr_err_ratelimited("Failed to update LCD display: %d\n", err); 201 201 } 202 202 203 - static struct img_ascii_lcd_config sead3_config = { 203 + static const struct img_ascii_lcd_config sead3_config = { 204 204 .num_chars = 16, 205 205 .external_regmap = true, 206 206 .ops = {