diff options
author | Julia Lawall <Julia.Lawall@lip6.fr> | 2016-09-11 17:44:13 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2016-09-19 22:23:21 +0300 |
commit | 96105144475eeafa8445d2f9f3077a39dd7369a5 (patch) | |
tree | 8a05fcc7147804b6738efbc5be88a100dac8008e /drivers/media/tuners/mt20xx.c | |
parent | 14c4bf3c6f7d76d2b2b50cc82f6830d6948f6faa (diff) | |
download | linux-96105144475eeafa8445d2f9f3077a39dd7369a5.tar.xz |
[media] tuners: 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/tuners/mt20xx.c')
-rw-r--r-- | drivers/media/tuners/mt20xx.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/tuners/mt20xx.c b/drivers/media/tuners/mt20xx.c index 9e031040c13f..52da4671b0e0 100644 --- a/drivers/media/tuners/mt20xx.c +++ b/drivers/media/tuners/mt20xx.c @@ -363,7 +363,7 @@ static int mt2032_set_params(struct dvb_frontend *fe, return ret; } -static struct dvb_tuner_ops mt2032_tuner_ops = { +static const struct dvb_tuner_ops mt2032_tuner_ops = { .set_analog_params = mt2032_set_params, .release = microtune_release, .get_frequency = microtune_get_frequency, @@ -563,7 +563,7 @@ static int mt2050_set_params(struct dvb_frontend *fe, return ret; } -static struct dvb_tuner_ops mt2050_tuner_ops = { +static const struct dvb_tuner_ops mt2050_tuner_ops = { .set_analog_params = mt2050_set_params, .release = microtune_release, .get_frequency = microtune_get_frequency, |