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

video: cobalt_lcdfb: constify fb_fix_screeninfo structure

This structure is only used to copy into other structures,
so declare it as const.

This issue was detected using Coccinelle and the following semantic patch:

@r disable optional_qualifier@
identifier i;
position p;
@@
static struct fb_fix_screeninfo i@p = { ... };

@ok@
identifier r.i;
expression e;
position p;
@@
e = i@p

@bad@
position p != {r.p,ok.p};
identifier r.i;
struct fb_fix_screeninfo e;
@@
e@i@p

@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
struct fb_fix_screeninfo i = { ... };

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>

authored by

Gustavo A. R. Silva and committed by
Bartlomiej Zolnierkiewicz
c9742729 40445365

+1 -1
+1 -1
drivers/video/fbdev/cobalt_lcdfb.c
··· 126 126 lcd_write_control(info, LCD_RESET); 127 127 } 128 128 129 - static struct fb_fix_screeninfo cobalt_lcdfb_fix = { 129 + static const struct fb_fix_screeninfo cobalt_lcdfb_fix = { 130 130 .id = "cobalt-lcd", 131 131 .type = FB_TYPE_TEXT, 132 132 .type_aux = FB_AUX_TEXT_MDA,