video: fbdev: constify fb_fix_screeninfo and fb_var_screeninfo structures
authorJulia Lawall <Julia.Lawall@lip6.fr>
Sun, 11 Sep 2016 15:17:20 +0000 (17:17 +0200)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Tue, 27 Sep 2016 08:16:35 +0000 (11:16 +0300)
commitca9384c5911199257cbdf48f1bc3e3986de611a2
treebe526bb6c590a0b30425a71367d1a447ba40ad35
parent1d2ffbd3e06d852362dbaa3457e0796cb32ee8ff
video: fbdev: constify fb_fix_screeninfo and fb_var_screeninfo structures

These structures are only used to copy into other structures, so declare
them as const.

The semantic patch that makes this change in the fb_fix_screeninfo case is
as follows (http://coccinelle.lip6.fr/).  The fb_var_screeninfo case is
analogous.

// <smpl>
@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 = { ... };
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
18 files changed:
drivers/video/fbdev/arcfb.c
drivers/video/fbdev/asiliantfb.c
drivers/video/fbdev/aty/aty128fb.c
drivers/video/fbdev/aty/atyfb_base.c
drivers/video/fbdev/aty/radeon_monitor.c
drivers/video/fbdev/hecubafb.c
drivers/video/fbdev/hgafb.c
drivers/video/fbdev/i740fb.c
drivers/video/fbdev/kyro/fbdev.c
drivers/video/fbdev/pm2fb.c
drivers/video/fbdev/s1d13xxxfb.c
drivers/video/fbdev/savage/savagefb_driver.c
drivers/video/fbdev/simplefb.c
drivers/video/fbdev/sm712fb.c
drivers/video/fbdev/ssd1307fb.c
drivers/video/fbdev/tdfxfb.c
drivers/video/fbdev/uvesafb.c
drivers/video/fbdev/vga16fb.c