diff options
author | Bhumika Goyal <bhumirks@gmail.com> | 2017-01-21 04:45:31 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2017-02-03 11:23:39 -0500 |
commit | dd93e79c602c8219c0b69b0667601ed363b4191a (patch) | |
tree | a0109097f750b3d29c1d7a3e6078138757d19c6d | |
parent | 8b6fe20a5d7bc467865adb08c5abcf9e712cdc39 (diff) |
[media] media: dvb-frontends: constify vb2_ops structure
Declare vb2_ops structure as const as it is only stored in
the ops field of a vb2_queue structure. This field is of type
const, so vb2_ops structures having same properties can be made
const too.
Done using Coccinelle:
@r1 disable optional_qualifier@
identifier i;
position p;
@@
static struct vb2_ops i@p={...};
@ok1@
identifier r1.i;
position p;
struct sta2x11_vip vip;
struct vb2_queue q;
@@
(
vip.vb_vidq.ops=&i@p
|
q.ops=&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 vb2_ops i;
File size details of media/dvb-frontends/rtl2832_sdr.o file remains the
same before and after applying the patch.
Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
-rw-r--r-- | drivers/media/dvb-frontends/rtl2832_sdr.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/dvb-frontends/rtl2832_sdr.c b/drivers/media/dvb-frontends/rtl2832_sdr.c index e038e886731b..c6e78d870ccd 100644 --- a/drivers/media/dvb-frontends/rtl2832_sdr.c +++ b/drivers/media/dvb-frontends/rtl2832_sdr.c | |||
@@ -956,7 +956,7 @@ static void rtl2832_sdr_stop_streaming(struct vb2_queue *vq) | |||
956 | mutex_unlock(&dev->v4l2_lock); | 956 | mutex_unlock(&dev->v4l2_lock); |
957 | } | 957 | } |
958 | 958 | ||
959 | static struct vb2_ops rtl2832_sdr_vb2_ops = { | 959 | static const struct vb2_ops rtl2832_sdr_vb2_ops = { |
960 | .queue_setup = rtl2832_sdr_queue_setup, | 960 | .queue_setup = rtl2832_sdr_queue_setup, |
961 | .buf_prepare = rtl2832_sdr_buf_prepare, | 961 | .buf_prepare = rtl2832_sdr_buf_prepare, |
962 | .buf_queue = rtl2832_sdr_buf_queue, | 962 | .buf_queue = rtl2832_sdr_buf_queue, |