linux/drivers/media/i2c/m5mols
Bhumika Goyal 646c3ae9d9 [media] media: i2c: m5mols: m5mols_core: constify v4l2_subdev_pad_ops structures
v4l2_subdev_pad_ops structures are stored in the pad field
of the v4l2_subdev_ops structure and this field is of type const.
As the v4l2_subdev_pad_ops structures are never modified, they can be
declared as const.
Done using Coccinelle:

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

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

File size before:
 text	   data	    bss	    dec	    hex	filename
   7633	    512	     20	   8165	   1fe5	media/i2c/m5mols/m5mols_core.o

File size after:
  text	   data	    bss	    dec	    hex	filename
   7761	    384	     20	   8165	   1fe5	media/i2c/m5mols/m5mols_core.o

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-02-03 09:28:32 -02:00
..
Kconfig
m5mols.h [media] m5mols: Add missing #include <linux/sizes.h> 2012-10-10 08:17:16 -03:00
m5mols_capture.c [media] include/media: move driver interface headers to a separate dir 2015-11-17 06:57:29 -02:00
m5mols_controls.c [media] m5mols: potential uninitialized variable 2016-04-13 17:10:59 -03:00
m5mols_core.c [media] media: i2c: m5mols: m5mols_core: constify v4l2_subdev_pad_ops structures 2017-02-03 09:28:32 -02:00
m5mols_reg.h [media] m5mols: Implement .get_frame_desc subdev callback 2012-10-05 21:28:06 -03:00
Makefile