kernel_optimize_test/drivers/media/platform/soc_camera
Bhumika Goyal 32dd9e873b [media] media: platform: soc_camera_platform : constify v4l2_subdev_* structures
v4l2_subdev_{core/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)

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

@ok1@
identifier r1.i;
position p;
struct v4l2_subdev_ops obj;
@@
obj.core=&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_core_ops i;

File size before:
    text   data	    bss	    dec	    hex	filename
    858	    576	      0	   1434	    59a soc_camera/soc_camera_platform.o

File size after:
  text	   data	    bss	    dec	    hex	filename
   1234	    192	      0	   1426	    592 soc_camera/soc_camera_platform.o

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-01-30 14:47:21 -02:00
..
atmel-isi.c [media] platform: constify vb2_ops structures 2016-09-19 16:21:06 -03:00
atmel-isi.h
Kconfig [media] soc-camera/rcar-vin: remove obsolete driver 2016-09-19 16:29:54 -03:00
Makefile [media] soc-camera/rcar-vin: remove obsolete driver 2016-09-19 16:29:54 -03:00
sh_mobile_ceu_camera.c [media] platform: constify vb2_ops structures 2016-09-19 16:21:06 -03:00
soc_camera_platform.c [media] media: platform: soc_camera_platform : constify v4l2_subdev_* structures 2017-01-30 14:47:21 -02:00
soc_camera.c [media] v4l2: remove g/s_crop from video ops 2016-08-24 09:46:09 -03:00
soc_mediabus.c
soc_scale_crop.c [media] v4l2: remove g/s_crop from video ops 2016-08-24 09:46:09 -03:00
soc_scale_crop.h [media] v4l2: remove g/s_crop from video ops 2016-08-24 09:46:09 -03:00