media: dvb-frontends/cxd2099: Make en_templ constant
authorNishka Dasgupta <nishkadg.linux@gmail.com>
Mon, 19 Aug 2019 07:47:01 +0000 (04:47 -0300)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Wed, 21 Aug 2019 21:39:55 +0000 (18:39 -0300)
Static structure en_templ, of type dvb_ca_en50221, is not used except to
be copied into a local variable. Hence make it const to prevent
unintended modification of the original fields.
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/dvb-frontends/cxd2099.c

index 5264e873850e9d86a45a369d27f7e5c6f33d4af2..f88b5355493e51e814fa8a98432772d9bc9043a3 100644 (file)
@@ -594,7 +594,7 @@ static int write_data(struct dvb_ca_en50221 *ca, int slot, u8 *ebuf, int ecount)
        return ecount;
 }
 
-static struct dvb_ca_en50221 en_templ = {
+static const struct dvb_ca_en50221 en_templ = {
        .read_attribute_mem  = read_attribute_mem,
        .write_attribute_mem = write_attribute_mem,
        .read_cam_control    = read_cam_control,