From 96105144475eeafa8445d2f9f3077a39dd7369a5 Mon Sep 17 00:00:00 2001 From: Julia Lawall Date: Sun, 11 Sep 2016 11:44:13 -0300 Subject: [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/) // @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/tuners/tea5761.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/media/tuners/tea5761.c') diff --git a/drivers/media/tuners/tea5761.c b/drivers/media/tuners/tea5761.c index bf78cb9fc52c..36b0b1e1d05b 100644 --- a/drivers/media/tuners/tea5761.c +++ b/drivers/media/tuners/tea5761.c @@ -301,7 +301,7 @@ static int tea5761_get_frequency(struct dvb_frontend *fe, u32 *frequency) return 0; } -static struct dvb_tuner_ops tea5761_tuner_ops = { +static const struct dvb_tuner_ops tea5761_tuner_ops = { .info = { .name = "tea5761", // Philips TEA5761HN FM Radio }, -- cgit v1.2.3