summaryrefslogtreecommitdiffstats
path: root/drivers/media/pci/cx18/cx18-streams.c
diff options
context:
space:
mode:
authorJulia Lawall2017-08-04 14:09:44 +0200
committerMauro Carvalho Chehab2017-08-20 14:06:42 +0200
commit6688324841d9fdc53bdb0aef88ab6352a7185513 (patch)
tree0dfa484cd5959b9cfc88a1ede9b0f7d1edcaa9a2 /drivers/media/pci/cx18/cx18-streams.c
parentmedia: pxa_camera: constify v4l2_clk_ops structure (diff)
downloadkernel-qcow2-linux-6688324841d9fdc53bdb0aef88ab6352a7185513.tar.gz
kernel-qcow2-linux-6688324841d9fdc53bdb0aef88ab6352a7185513.tar.xz
kernel-qcow2-linux-6688324841d9fdc53bdb0aef88ab6352a7185513.zip
media: cx18: 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>
Diffstat (limited to 'drivers/media/pci/cx18/cx18-streams.c')
-rw-r--r--drivers/media/pci/cx18/cx18-streams.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/pci/cx18/cx18-streams.c b/drivers/media/pci/cx18/cx18-streams.c
index 3c45e0071530..81d06c1a7796 100644
--- a/drivers/media/pci/cx18/cx18-streams.c
+++ b/drivers/media/pci/cx18/cx18-streams.c
@@ -240,7 +240,7 @@ static void buffer_queue(struct videobuf_queue *q, struct videobuf_buffer *vb)
list_add_tail(&buf->vb.queue, &s->vb_capture);
}
-static struct videobuf_queue_ops cx18_videobuf_qops = {
+static const struct videobuf_queue_ops cx18_videobuf_qops = {
.buf_setup = buffer_setup,
.buf_prepare = buffer_prepare,
.buf_queue = buffer_queue,