media: ov7740: constify structures stored in fields of v4l2_subdev_ops structure
authorJulia Lawall <Julia.Lawall@lip6.fr>
Sat, 27 Oct 2018 12:49:04 +0000 (08:49 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Tue, 6 Nov 2018 12:17:02 +0000 (07:17 -0500)
The fields of a v4l2_subdev_ops structure are all const, so the
structures that are stored there and are not used elsewhere can be
const as well.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/i2c/ov7740.c

index 6e9c233cfbe352589ae2b042fca4d540023ec2a9..177688afd9a66f4120075d60f4888668b578ee8e 100644 (file)
@@ -322,7 +322,7 @@ static int ov7740_set_power(struct ov7740 *ov7740, int on)
        return 0;
 }
 
-static struct v4l2_subdev_core_ops ov7740_subdev_core_ops = {
+static const struct v4l2_subdev_core_ops ov7740_subdev_core_ops = {
        .log_status = v4l2_ctrl_subdev_log_status,
 #ifdef CONFIG_VIDEO_ADV_DEBUG
        .g_register = ov7740_get_register,
@@ -648,7 +648,7 @@ static int ov7740_s_frame_interval(struct v4l2_subdev *sd,
        return 0;
 }
 
-static struct v4l2_subdev_video_ops ov7740_subdev_video_ops = {
+static const struct v4l2_subdev_video_ops ov7740_subdev_video_ops = {
        .s_stream = ov7740_set_stream,
        .s_frame_interval = ov7740_s_frame_interval,
        .g_frame_interval = ov7740_g_frame_interval,