Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1491750

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

From Tomi Valkeinen <tomi.valkeinen@ti.com>
Newsgroups linux.kernel
Subject Re: [PATCH] video: fbdev: constify fb_fix_screeninfo and fb_var_screeninfo structures
Date 2016-09-27 10:20 +0200
Message-ID <slVMl-77s-5@gated-at.bofh.it> (permalink)
References <sgf1n-7Vg-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

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@lip6.fr>
> 
> ---
>  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

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

Re: [PATCH] video: fbdev: constify fb_fix_screeninfo and  fb_var_screeninfo structures Tomi Valkeinen <tomi.valkeinen@ti.com> - 2016-09-27 10:20 +0200

csiph-web