diff options
author | Bhumika Goyal <bhumirks@gmail.com> | 2016-10-09 16:05:23 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-10-16 10:25:01 +0200 |
commit | 7f140181b47e6cbac398a4aac908a7e29b3af4ee (patch) | |
tree | 9a371c5a2b691b6c46db39c7e0a78a7d79266da4 | |
parent | 5c065b53ec47eb6ee6551728070c12bd4bdb6b54 (diff) | |
download | linux-7f140181b47e6cbac398a4aac908a7e29b3af4ee.tar.bz2 |
Staging: media: radio-bcm2048: constify v4l2_ioctl_ops structure
Declare the structure v4l2_ioctl_ops as const as it is only stored in
the ioctl_ops field of video_device structure. As this field is of type
const struct v4l2_ioctl_ops *, so v4l2_ioctl_ops structures having this
property can also be made const.
Done using coccinelle:
@r1 disable optional_qualifier @
identifier i;
position p;
@@
static struct v4l2_ioctl_ops i@p = {...};
@ok1@
identifier r1.i;
position p;
struct video_device s;
@@
s.ioctl_ops=&i@p;
@bad@
position p!={r1.p,ok1.p};
identifier r1.i;
@@
i@p
@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
static
+const
struct v4l2_ioctl_ops i={...};
@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
+const
struct v4l2_ioctl_ops i;
File size before:
text data bss dec hex filename
20465 3220 32 23717 5ca5
drivers/staging/media/bcm2048/radio-bcm2048.o
File size after:
text data bss dec hex filename
21425 2260 32 23717 5ca5
drivers/staging/media/bcm2048/radio-bcm2048.o
Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/media/bcm2048/radio-bcm2048.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/media/bcm2048/radio-bcm2048.c b/drivers/staging/media/bcm2048/radio-bcm2048.c index ea15cc638097..fe637ce8f4e7 100644 --- a/drivers/staging/media/bcm2048/radio-bcm2048.c +++ b/drivers/staging/media/bcm2048/radio-bcm2048.c @@ -2540,7 +2540,7 @@ static int bcm2048_vidioc_s_hw_freq_seek(struct file *file, void *priv, return err; } -static struct v4l2_ioctl_ops bcm2048_ioctl_ops = { +static const struct v4l2_ioctl_ops bcm2048_ioctl_ops = { .vidioc_querycap = bcm2048_vidioc_querycap, .vidioc_g_input = bcm2048_vidioc_g_input, .vidioc_s_input = bcm2048_vidioc_s_input, |