diff options
author | Bhumika Goyal <bhumirks@gmail.com> | 2016-12-12 16:03:57 -0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2017-01-31 10:04:52 -0200 |
commit | a2fafda66dccb84592d4b9e42e429471c356c4fc (patch) | |
tree | afde5dab5b80bbef1d228269e076ae66182057ae /drivers/media/platform/exynos4-is/fimc-capture.c | |
parent | 4742575cde1f3cee0ea6b41af42781672315b04b (diff) | |
download | lwn-a2fafda66dccb84592d4b9e42e429471c356c4fc.tar.gz lwn-a2fafda66dccb84592d4b9e42e429471c356c4fc.zip |
[media] exynos4-is: 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_ops i@p = {...};
@ok1@
identifier r1.i;
position p;
expression e1;
@@
v4l2_subdev_init(e1,&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_ops i;
File size before:
text data bss dec hex filename
16830 1064 0 17894 45e6 platform/exynos4-is/fimc-capture.o
7787 704 20 8511 213f platform/exynos4-is/mipi-csis.o
File size after:
text data bss dec hex filename
17022 880 0 17902 45ee platform/exynos4-is/fimc-capture.o
8299 192 20 8511 213f platform/exynos4-is/mipi-csis.o
Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/platform/exynos4-is/fimc-capture.c')
-rw-r--r-- | drivers/media/platform/exynos4-is/fimc-capture.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/platform/exynos4-is/fimc-capture.c b/drivers/media/platform/exynos4-is/fimc-capture.c index 7bde62f28e4c..8a7cd07dbe28 100644 --- a/drivers/media/platform/exynos4-is/fimc-capture.c +++ b/drivers/media/platform/exynos4-is/fimc-capture.c @@ -1695,7 +1695,7 @@ static int fimc_subdev_set_selection(struct v4l2_subdev *sd, return 0; } -static struct v4l2_subdev_pad_ops fimc_subdev_pad_ops = { +static const struct v4l2_subdev_pad_ops fimc_subdev_pad_ops = { .enum_mbus_code = fimc_subdev_enum_mbus_code, .get_selection = fimc_subdev_get_selection, .set_selection = fimc_subdev_set_selection, @@ -1703,7 +1703,7 @@ static struct v4l2_subdev_pad_ops fimc_subdev_pad_ops = { .set_fmt = fimc_subdev_set_fmt, }; -static struct v4l2_subdev_ops fimc_subdev_ops = { +static const struct v4l2_subdev_ops fimc_subdev_ops = { .pad = &fimc_subdev_pad_ops, }; |