Skip to content

Commit 93b216c

Browse files
tititiou36andy-shev
authored andcommitted
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 <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
1 parent e4ee5c3 commit 93b216c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/auxdisplay/img-ascii-lcd.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ static void boston_update(struct linedisp *linedisp)
6969
#endif
7070
}
7171

72-
static struct img_ascii_lcd_config boston_config = {
72+
static const struct img_ascii_lcd_config boston_config = {
7373
.num_chars = 8,
7474
.ops = {
7575
.update = boston_update,
@@ -98,7 +98,7 @@ static void malta_update(struct linedisp *linedisp)
9898
pr_err_ratelimited("Failed to update LCD display: %d\n", err);
9999
}
100100

101-
static struct img_ascii_lcd_config malta_config = {
101+
static const struct img_ascii_lcd_config malta_config = {
102102
.num_chars = 8,
103103
.external_regmap = true,
104104
.ops = {
@@ -200,7 +200,7 @@ static void sead3_update(struct linedisp *linedisp)
200200
pr_err_ratelimited("Failed to update LCD display: %d\n", err);
201201
}
202202

203-
static struct img_ascii_lcd_config sead3_config = {
203+
static const struct img_ascii_lcd_config sead3_config = {
204204
.num_chars = 16,
205205
.external_regmap = true,
206206
.ops = {

0 commit comments

Comments
 (0)