From 14c4bf3c6f7d76d2b2b50cc82f6830d6948f6faa Mon Sep 17 00:00:00 2001 From: Julia Lawall Date: Sun, 11 Sep 2016 11:44:12 -0300 Subject: [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/) // @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 = { ... }; // Signed-off-by: Julia Lawall Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb-frontends/helene.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/media/dvb-frontends/helene.c') diff --git a/drivers/media/dvb-frontends/helene.c b/drivers/media/dvb-frontends/helene.c index 3d1cd5fa4904..dc43c5f6d0ea 100644 --- a/drivers/media/dvb-frontends/helene.c +++ b/drivers/media/dvb-frontends/helene.c @@ -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, -- cgit v1.2.3