summaryrefslogtreecommitdiff
path: root/drivers/media/platform/mtk-jpeg
diff options
context:
space:
mode:
authorGustavo A. R. Silva <garsilva@embeddedor.com>2017-07-06 23:51:27 +0300
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-07-19 22:10:52 +0300
commitfda7e347239343349fcce30be723ebf1290f34c9 (patch)
tree30168b40129c7c09f9cff1fe1f582d05180b9d2c /drivers/media/platform/mtk-jpeg
parent94e8f761d3ba4012fa75a6d66fe3d9cf76d08628 (diff)
downloadlinux-fda7e347239343349fcce30be723ebf1290f34c9.tar.xz
media: mediatek: constify vb2_ops structure
Check for vb2_ops structures that are only stored in the ops field of a vb2_queue structure. That field is declared const, so vb2_ops structures that have this property can be declared as const also. This issue was detected using Coccinelle and the following semantic patch: @r disable optional_qualifier@ identifier i; position p; @@ static struct vb2_ops i@p = { ... }; @ok@ identifier r.i; struct vb2_queue e; position p; @@ e.ops = &i@p; @bad@ position p != {r.p,ok.p}; identifier r.i; struct vb2_ops e; @@ e@i@p @depends on !bad disable optional_qualifier@ identifier r.i; @@ static +const struct vb2_ops i = { ... }; Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/platform/mtk-jpeg')
-rw-r--r--drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c b/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c
index 451a54039e65..f17a86b2f917 100644
--- a/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c
+++ b/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c
@@ -756,7 +756,7 @@ static void mtk_jpeg_stop_streaming(struct vb2_queue *q)
pm_runtime_put_sync(ctx->jpeg->dev);
}
-static struct vb2_ops mtk_jpeg_qops = {
+static const struct vb2_ops mtk_jpeg_qops = {
.queue_setup = mtk_jpeg_queue_setup,
.buf_prepare = mtk_jpeg_buf_prepare,
.buf_queue = mtk_jpeg_buf_queue,