diff options
author | Julia Lawall <Julia.Lawall@lip6.fr> | 2016-09-11 16:44:12 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2016-09-19 21:22:55 +0200 |
commit | 14c4bf3c6f7d76d2b2b50cc82f6830d6948f6faa (patch) | |
tree | b40e2f76707cb681a062bb89e70f09bd3780499c /drivers/media/dvb-frontends/horus3a.c | |
parent | [media] constify local structures (diff) | |
download | linux-14c4bf3c6f7d76d2b2b50cc82f6830d6948f6faa.tar.xz linux-14c4bf3c6f7d76d2b2b50cc82f6830d6948f6faa.zip |
[media] dvb-frontends: constify dvb_tuner_ops structures
These structures are only used to copy into other structures, so declare
them as const.
The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)
// <smpl>
@r disable optional_qualifier@
identifier i;
position p;
@@
static struct dvb_tuner_ops i@p = { ... };
@ok1@
identifier r.i;
expression e;
position p;
@@
e = i@p
@ok2@
identifier r.i;
expression e1, e2;
position p;
@@
memcpy(e1, &i@p, e2)
@bad@
position p != {r.p,ok1.p,ok2.p};
identifier r.i;
struct dvb_tuner_ops e;
@@
e@i@p
@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
struct dvb_tuner_ops i = { ... };
// </smpl>
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/dvb-frontends/horus3a.c')
-rw-r--r-- | drivers/media/dvb-frontends/horus3a.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/dvb-frontends/horus3a.c b/drivers/media/dvb-frontends/horus3a.c index a98bca5270d9..0c089b5986a1 100644 --- a/drivers/media/dvb-frontends/horus3a.c +++ b/drivers/media/dvb-frontends/horus3a.c @@ -326,7 +326,7 @@ static int horus3a_get_frequency(struct dvb_frontend *fe, u32 *frequency) return 0; } -static struct dvb_tuner_ops horus3a_tuner_ops = { +static const struct dvb_tuner_ops horus3a_tuner_ops = { .info = { .name = "Sony Horus3a", .frequency_min = 950000, |