]> git.baikalelectronics.ru Git - kernel.git/commit
media: zr364xx: constify videobuf_queue_ops structures
authorJulia Lawall <Julia.Lawall@lip6.fr>
Fri, 4 Aug 2017 12:09:48 +0000 (08:09 -0400)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Sun, 20 Aug 2017 12:07:45 +0000 (08:07 -0400)
commit505369d519f2dfab8cc410e6ae21d9cec6c15854
tree424c24866c55028638b3fc2a3f4a15a9dd509e44
parentf9b6e373a844a65970b0d80f334ff13c3245efe3
media: zr364xx: 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>

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>
drivers/media/usb/zr364xx/zr364xx.c