Skip to content

Commit a180d02

Browse files
gaurijhangianiojeda
authored andcommitted
auxdisplay: ht16k33: Make ht16k33_fb_fix and ht16k33_fb_var constant
The static structures ht16k33_fb_fix and ht16k33_fb_var, of types fb_fix_screeninfo and fb_var_screeninfo respectively, are not used except to be copied into other variables. Hence make both of them constant to prevent unintended modification. Issue found with Coccinelle. Acked-by: Robin van der Gracht <[email protected]> Signed-off-by: Nishka Dasgupta <[email protected]> Signed-off-by: Miguel Ojeda <[email protected]>
1 parent d1abaeb commit a180d02

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/auxdisplay/ht16k33.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ struct ht16k33_priv {
7474
struct ht16k33_fbdev fbdev;
7575
};
7676

77-
static struct fb_fix_screeninfo ht16k33_fb_fix = {
77+
static const struct fb_fix_screeninfo ht16k33_fb_fix = {
7878
.id = DRIVER_NAME,
7979
.type = FB_TYPE_PACKED_PIXELS,
8080
.visual = FB_VISUAL_MONO10,
@@ -85,7 +85,7 @@ static struct fb_fix_screeninfo ht16k33_fb_fix = {
8585
.accel = FB_ACCEL_NONE,
8686
};
8787

88-
static struct fb_var_screeninfo ht16k33_fb_var = {
88+
static const struct fb_var_screeninfo ht16k33_fb_var = {
8989
.xres = HT16K33_MATRIX_LED_MAX_ROWS,
9090
.yres = HT16K33_MATRIX_LED_MAX_COLS,
9191
.xres_virtual = HT16K33_MATRIX_LED_MAX_ROWS,

0 commit comments

Comments
 (0)