Home
last modified time | relevance | path

Searched hist:"5610 ced4" (Results 1 – 1 of 1) sorted by relevance

/openbmc/linux/drivers/media/i2c/
H A Dml86v7667.c5610ced4 Tue Dec 13 11:31:45 CST 2016 Bhumika Goyal <bhumirks@gmail.com> [media] drivers: media: i2c: ml86v7667: 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 used)

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

@ok1@
identifier r1.i;
position p;
@@
v4l2_i2c_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
2732 608 8 3348 d14 drivers/media/i2c/ml86v7667.o

File size after:
text data bss dec hex filename
3100 232 8 3340 d0c drivers/media/i2c/ml86v7667.o

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
5610ced4 Tue Dec 13 11:31:45 CST 2016 Bhumika Goyal <bhumirks@gmail.com> [media] drivers: media: i2c: ml86v7667: 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 used)

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

@ok1@
identifier r1.i;
position p;
@@
v4l2_i2c_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
2732 608 8 3348 d14 drivers/media/i2c/ml86v7667.o

File size after:
text data bss dec hex filename
3100 232 8 3340 d0c drivers/media/i2c/ml86v7667.o

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>