[media] dvb-frontends: constify dvb_tuner_ops structures
authorJulia Lawall <Julia.Lawall@lip6.fr>
Sun, 11 Sep 2016 14:44:12 +0000 (11:44 -0300)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Mon, 19 Sep 2016 19:22:55 +0000 (16:22 -0300)
commit14c4bf3c6f7d76d2b2b50cc82f6830d6948f6faa
treeb40e2f76707cb681a062bb89e70f09bd3780499c
parentdb83d08dee3324dc8b0bf0d02ba295ba25a01758
[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>
17 files changed:
drivers/media/dvb-frontends/ascot2e.c
drivers/media/dvb-frontends/dvb-pll.c
drivers/media/dvb-frontends/helene.c
drivers/media/dvb-frontends/horus3a.c
drivers/media/dvb-frontends/ix2505v.c
drivers/media/dvb-frontends/stb6000.c
drivers/media/dvb-frontends/stb6100.c
drivers/media/dvb-frontends/stv6110.c
drivers/media/dvb-frontends/stv6110x.c
drivers/media/dvb-frontends/tda18271c2dd.c
drivers/media/dvb-frontends/tda665x.c
drivers/media/dvb-frontends/tda8261.c
drivers/media/dvb-frontends/tda826x.c
drivers/media/dvb-frontends/ts2020.c
drivers/media/dvb-frontends/tua6100.c
drivers/media/dvb-frontends/zl10036.c
drivers/media/dvb-frontends/zl10039.c