Re: [PATCH] video: fbdev: constify fb_fix_screeninfo and fb_var_screeninfo structures

From: Tomi Valkeinen
Date: Tue Sep 27 2016 - 04:19:15 EST


On 11/09/16 18:17, Julia Lawall wrote:
> 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@xxxxxxx>
>
> ---
> drivers/video/fbdev/arcfb.c | 4 ++--
> drivers/video/fbdev/asiliantfb.c | 4 ++--
> drivers/video/fbdev/aty/aty128fb.c | 6 +++---
> drivers/video/fbdev/aty/atyfb_base.c | 2 +-
> drivers/video/fbdev/aty/radeon_monitor.c | 2 +-
> drivers/video/fbdev/hecubafb.c | 4 ++--
> drivers/video/fbdev/hgafb.c | 2 +-
> drivers/video/fbdev/i740fb.c | 2 +-
> drivers/video/fbdev/kyro/fbdev.c | 2 +-
> drivers/video/fbdev/pm2fb.c | 2 +-
> drivers/video/fbdev/s1d13xxxfb.c | 2 +-
> drivers/video/fbdev/savage/savagefb_driver.c | 2 +-
> drivers/video/fbdev/simplefb.c | 4 ++--
> drivers/video/fbdev/sm712fb.c | 2 +-
> drivers/video/fbdev/ssd1307fb.c | 4 ++--
> drivers/video/fbdev/tdfxfb.c | 4 ++--
> drivers/video/fbdev/uvesafb.c | 2 +-
> drivers/video/fbdev/vfb.c | 2 +-
> drivers/video/fbdev/vga16fb.c | 2 +-
> 19 files changed, 27 insertions(+), 27 deletions(-)

Thanks, queued for 4.9. There was a minor conflict in vfb.c, I resolved
that.

Tomi

Attachment: signature.asc
Description: OpenPGP digital signature