[media] media: platform: s3c-camif: constify v4l2_subdev_ops structures
authorBhumika Goyal <bhumirks@gmail.com>
Wed, 14 Dec 2016 11:11:10 +0000 (09:11 -0200)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Fri, 3 Feb 2017 12:58:00 +0000 (10:58 -0200)
commit10106c13f444e3b5adf435d8c12e207f109f469c
tree9138cb72d985a6157d0f80b2068f5afb29026a60
parent5332b6263742cd75963eccdea9e3af4a464c2999
[media] media: platform: s3c-camif: constify v4l2_subdev_ops structures

Check for v4l2_subdev_ops structures that are only passed as an
argument to the function v4l2_subdev_init. This argument is of type
const, so v4l2_subdev_ops structures having this property can also  be
declared const.
Done using Coccinelle:

@r1 disable optional_qualifier @
identifier i;
position p;
@@
static struct v4l2_subdev_ops i@p = {...};

@ok1@
identifier r1.i;
position p;
@@
v4l2_subdev_init(...,&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
  17171    1912      20   19103    4a9f
platform/s3c-camif/camif-capture.o

File size after:
   text    data     bss     dec     hex filename
  17235    1848      20   19103    4a9f
platform/s3c-camif/camif-capture.o

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/platform/s3c-camif/camif-capture.c