linux/drivers/media/usb/cx231xx
Julia Lawall 177267a950 media: cx231xx: constify videobuf_queue_ops structures
These videobuf_queue_ops structures are only passed as the second
argument to videobuf_queue_vmalloc_init, which is declared as const.
Thus the videobuf_queue_ops structures themselves can be const.

Done with the help of Coccinelle.

// <smpl>
@r disable optional_qualifier@
identifier i;
position p;
@@
static struct videobuf_queue_ops i@p = { ... };

@ok1@
identifier r.i;
expression e1;
position p;
@@
videobuf_queue_vmalloc_init(e1,&i@p,...)

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

@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
 struct videobuf_queue_ops i = { ... };
// </smpl>

In the first case, there is a second commented call to
videobuf_queue_sg_init with the structure as the second argument.  If that
code will be uncommented, the const will remain correct, because the second
parameter of that function is also const.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-08-20 08:06:58 -04:00
..
cx231xx-417.c media: cx231xx: constify videobuf_queue_ops structures 2017-08-20 08:06:58 -04:00
cx231xx-audio.c media: usb: make snd_pcm_hardware const 2017-08-20 08:05:10 -04:00
cx231xx-avcore.c [media] cx231xx: don't return error on success 2016-09-05 15:26:30 -03:00
cx231xx-cards.c [media] cx231xx: Initial support Astrometa T2hybrid 2017-06-06 07:53:26 -03:00
cx231xx-conf-reg.h
cx231xx-core.c media: cx231xx: only unregister successfully registered i2c adapters 2017-08-09 11:03:13 -04:00
cx231xx-dif.h [media] media: Drop FSF's postal address from the source code files 2017-01-27 11:38:09 -02:00
cx231xx-dvb.c [media] cx231xx: Initial support Astrometa T2hybrid 2017-06-06 07:53:26 -03:00
cx231xx-i2c.c media: cx231xx: only unregister successfully registered i2c adapters 2017-08-09 11:03:13 -04:00
cx231xx-input.c [media] rc-core: cx231xx - leave the internals of rc_dev alone 2017-06-06 09:09:34 -03:00
cx231xx-pcb-cfg.c [media] cx231xx: Improve the log message 2014-11-03 15:59:59 -02:00
cx231xx-pcb-cfg.h [media] cx231xx: return an error if it can't read PCB config 2014-07-27 16:57:43 -03:00
cx231xx-reg.h
cx231xx-vbi.c [media] media: usb: cx231xx: cx231xx-vbi: don't print error when allocating urb fails 2016-08-24 08:49:55 -03:00
cx231xx-vbi.h
cx231xx-video.c media: cx231xx: constify videobuf_queue_ops structures 2017-08-20 08:06:58 -04:00
cx231xx.h media: cx231xx: drop return value of cx231xx_i2c_unregister 2017-08-09 10:17:00 -04:00
Kconfig [media] cx231xx: Initial support Astrometa T2hybrid 2017-06-06 07:53:26 -03:00
Makefile