media: vicodec: constify v4l2_ctrl_ops structure
authorJulia Lawall <Julia.Lawall@lip6.fr>
Sat, 27 Oct 2018 12:16:39 +0000 (08:16 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Fri, 23 Nov 2018 11:03:33 +0000 (06:03 -0500)
The v4l2_ctrl_ops structure is only stored in the ops field of a
v4l2_ctrl_config structure, and this field is const, or passed as the
second argument of v4l2_ctrl_new_std, and the corresponding parameter
is declared as const.  Accordingly, the structure can also be const.

Done with the help of Coccinelle.

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+samsung@kernel.org>
drivers/media/platform/vicodec/vicodec-core.c

index 16e4db7c1e0a6614399c02cbac934c30c955b7f4..b7bdfe97215b8f92025e704730da880dbb78426e 100644 (file)
@@ -1125,7 +1125,7 @@ static int vicodec_s_ctrl(struct v4l2_ctrl *ctrl)
        return -EINVAL;
 }
 
-static struct v4l2_ctrl_ops vicodec_ctrl_ops = {
+static const struct v4l2_ctrl_ops vicodec_ctrl_ops = {
        .s_ctrl = vicodec_s_ctrl,
 };