diff options
author | Bhumika Goyal <bhumirks@gmail.com> | 2016-12-12 05:45:32 -0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2017-02-03 09:23:19 -0200 |
commit | 7c137c601b1104bddfc77937a12091a8a4c38287 (patch) | |
tree | 69ef930796e13ae2f75f114dacc45bc6c6e5f65a /drivers/media/i2c/noon010pc30.c | |
parent | cebb31c8b5fdea701b94b4a1664b50b7705736eb (diff) | |
download | talos-obmc-linux-7c137c601b1104bddfc77937a12091a8a4c38287.tar.gz talos-obmc-linux-7c137c601b1104bddfc77937a12091a8a4c38287.zip |
[media] drivers: media: i2c: constify v4l2_subdev_* structures
v4l2_subdev_{core/pad/video}_ops structures are stored in the
fields of the v4l2_subdev_ops structure which are of type const.
Also, v4l2_subdev_ops structure is passed to a function
having its argument of type const. As these structures are never
modified, so declare them as const.
Done using Coccinelle: (One of the scripts used)
@r1 disable optional_qualifier @
identifier i;
position p;
@@
static struct v4l2_subdev_video_ops i@p = {...};
@ok1@
identifier r1.i;
position p;
struct v4l2_subdev_ops obj;
@@
obj.video=&i@p;
@bad@
position p!={r1.p,ok1.p};
identifier r1.i;
@@
i@p
@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
+const
struct v4l2_subdev_video_ops i;
File sizes before:
text data bss dec hex filename
7810 736 16 8562 2172 drivers/media/i2c/mt9p031.o
9652 736 24 10412 28ac drivers/media/i2c/mt9v032.o
4613 552 20 5185 1441 drivers/media/i2c/noon010pc30.o
2615 552 8 3175 c67 drivers/media/i2c/s5k6a3.o
File sizes after:
text data bss dec hex filename
8322 232 16 8570 217a drivers/media/i2c/mt9p031.o
10164 232 24 10420 28b4 drivers/media/i2c/mt9v032.o
4933 232 20 5185 1441 drivers/media/i2c/noon010pc30.o
2935 232 8 3175 c67 drivers/media/i2c/s5k6a3.o
Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/i2c/noon010pc30.c')
-rw-r--r-- | drivers/media/i2c/noon010pc30.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/i2c/noon010pc30.c b/drivers/media/i2c/noon010pc30.c index 30cb90b88d75..88c498ad45df 100644 --- a/drivers/media/i2c/noon010pc30.c +++ b/drivers/media/i2c/noon010pc30.c @@ -664,13 +664,13 @@ static const struct v4l2_subdev_core_ops noon010_core_ops = { .log_status = noon010_log_status, }; -static struct v4l2_subdev_pad_ops noon010_pad_ops = { +static const struct v4l2_subdev_pad_ops noon010_pad_ops = { .enum_mbus_code = noon010_enum_mbus_code, .get_fmt = noon010_get_fmt, .set_fmt = noon010_set_fmt, }; -static struct v4l2_subdev_video_ops noon010_video_ops = { +static const struct v4l2_subdev_video_ops noon010_video_ops = { .s_stream = noon010_s_stream, }; |