Commit 14c4bf3c authored by Julia Lawall's avatar Julia Lawall Committed by Mauro Carvalho Chehab

[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: default avatarJulia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent db83d08d
......@@ -464,7 +464,7 @@ static int ascot2e_get_frequency(struct dvb_frontend *fe, u32 *frequency)
return 0;
}
static struct dvb_tuner_ops ascot2e_tuner_ops = {
static const struct dvb_tuner_ops ascot2e_tuner_ops = {
.info = {
.name = "Sony ASCOT2E",
.frequency_min = 1000000,
......
......@@ -739,7 +739,7 @@ static int dvb_pll_init(struct dvb_frontend *fe)
return -EINVAL;
}
static struct dvb_tuner_ops dvb_pll_tuner_ops = {
static const struct dvb_tuner_ops dvb_pll_tuner_ops = {
.release = dvb_pll_release,
.sleep = dvb_pll_sleep,
.init = dvb_pll_init,
......
......@@ -842,7 +842,7 @@ static int helene_get_frequency(struct dvb_frontend *fe, u32 *frequency)
return 0;
}
static struct dvb_tuner_ops helene_tuner_ops = {
static const struct dvb_tuner_ops helene_tuner_ops = {
.info = {
.name = "Sony HELENE Ter tuner",
.frequency_min = 1000000,
......@@ -856,7 +856,7 @@ static struct dvb_tuner_ops helene_tuner_ops = {
.get_frequency = helene_get_frequency,
};
static struct dvb_tuner_ops helene_tuner_ops_s = {
static const struct dvb_tuner_ops helene_tuner_ops_s = {
.info = {
.name = "Sony HELENE Sat tuner",
.frequency_min = 500000,
......
......@@ -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,
......
......@@ -258,7 +258,7 @@ static int ix2505v_get_frequency(struct dvb_frontend *fe, u32 *frequency)
return 0;
}
static struct dvb_tuner_ops ix2505v_tuner_ops = {
static const struct dvb_tuner_ops ix2505v_tuner_ops = {
.info = {
.name = "Sharp IX2505V (B0017)",
.frequency_min = 950000,
......
......@@ -186,7 +186,7 @@ static int stb6000_get_frequency(struct dvb_frontend *fe, u32 *frequency)
return 0;
}
static struct dvb_tuner_ops stb6000_tuner_ops = {
static const struct dvb_tuner_ops stb6000_tuner_ops = {
.info = {
.name = "ST STB6000",
.frequency_min = 950000,
......
......@@ -522,7 +522,7 @@ static int stb6100_set_params(struct dvb_frontend *fe)
return 0;
}
static struct dvb_tuner_ops stb6100_ops = {
static const struct dvb_tuner_ops stb6100_ops = {
.info = {
.name = "STB6100 Silicon Tuner",
.frequency_min = 950000,
......
......@@ -382,7 +382,7 @@ static int stv6110_get_bandwidth(struct dvb_frontend *fe, u32 *bandwidth)
return 0;
}
static struct dvb_tuner_ops stv6110_tuner_ops = {
static const struct dvb_tuner_ops stv6110_tuner_ops = {
.info = {
.name = "ST STV6110",
.frequency_min = 950000,
......
......@@ -345,7 +345,7 @@ static int stv6110x_release(struct dvb_frontend *fe)
return 0;
}
static struct dvb_tuner_ops stv6110x_ops = {
static const struct dvb_tuner_ops stv6110x_ops = {
.info = {
.name = "STV6110(A) Silicon Tuner",
.frequency_min = 950000,
......
......@@ -1217,7 +1217,7 @@ static int get_bandwidth(struct dvb_frontend *fe, u32 *bandwidth)
}
static struct dvb_tuner_ops tuner_ops = {
static const struct dvb_tuner_ops tuner_ops = {
.info = {
.name = "NXP TDA18271C2D",
.frequency_min = 47125000,
......
......@@ -206,7 +206,7 @@ static int tda665x_release(struct dvb_frontend *fe)
return 0;
}
static struct dvb_tuner_ops tda665x_ops = {
static const struct dvb_tuner_ops tda665x_ops = {
.get_status = tda665x_get_status,
.set_params = tda665x_set_params,
.get_frequency = tda665x_get_frequency,
......
......@@ -161,7 +161,7 @@ static int tda8261_release(struct dvb_frontend *fe)
return 0;
}
static struct dvb_tuner_ops tda8261_ops = {
static const struct dvb_tuner_ops tda8261_ops = {
.info = {
.name = "TDA8261",
......
......@@ -129,7 +129,7 @@ static int tda826x_get_frequency(struct dvb_frontend *fe, u32 *frequency)
return 0;
}
static struct dvb_tuner_ops tda826x_tuner_ops = {
static const struct dvb_tuner_ops tda826x_tuner_ops = {
.info = {
.name = "Philips TDA826X",
.frequency_min = 950000,
......
......@@ -496,7 +496,7 @@ static int ts2020_read_signal_strength(struct dvb_frontend *fe,
return 0;
}
static struct dvb_tuner_ops ts2020_tuner_ops = {
static const struct dvb_tuner_ops ts2020_tuner_ops = {
.info = {
.name = "TS2020",
.frequency_min = 950000,
......
......@@ -157,7 +157,7 @@ static int tua6100_get_frequency(struct dvb_frontend *fe, u32 *frequency)
return 0;
}
static struct dvb_tuner_ops tua6100_tuner_ops = {
static const struct dvb_tuner_ops tua6100_tuner_ops = {
.info = {
.name = "Infineon TUA6100",
.frequency_min = 950000,
......
......@@ -446,7 +446,7 @@ static int zl10036_init(struct dvb_frontend *fe)
return ret;
}
static struct dvb_tuner_ops zl10036_tuner_ops = {
static const struct dvb_tuner_ops zl10036_tuner_ops = {
.info = {
.name = "Zarlink ZL10036",
.frequency_min = 950000,
......
......@@ -255,7 +255,7 @@ static int zl10039_release(struct dvb_frontend *fe)
return 0;
}
static struct dvb_tuner_ops zl10039_ops = {
static const struct dvb_tuner_ops zl10039_ops = {
.release = zl10039_release,
.init = zl10039_init,
.sleep = zl10039_sleep,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment