[media] drivers/media/usb/dvb-usb-v2: constify mxl111sf_demod_config structure
authorJulia Lawall <Julia.Lawall@lip6.fr>
Fri, 13 Nov 2015 12:24:39 +0000 (10:24 -0200)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Thu, 19 Nov 2015 13:20:18 +0000 (11:20 -0200)
The mxl111sf_demod_config structure is never modified, so declare it
as const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Reviewed-by: Michael Ira Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/usb/dvb-usb-v2/mxl111sf-demod.c
drivers/media/usb/dvb-usb-v2/mxl111sf-demod.h
drivers/media/usb/dvb-usb-v2/mxl111sf.c

index ea3753653368d46a2f8f1a0017812dbe08a22c34..84f6de6fa07db183d94fca0ad6473fc85da34e11 100644 (file)
@@ -35,7 +35,7 @@ MODULE_PARM_DESC(debug, "set debugging level (1=info (or-able)).");
 struct mxl111sf_demod_state {
        struct mxl111sf_state *mxl_state;
 
-       struct mxl111sf_demod_config *cfg;
+       const struct mxl111sf_demod_config *cfg;
 
        struct dvb_frontend fe;
 };
@@ -579,7 +579,7 @@ static struct dvb_frontend_ops mxl111sf_demod_ops = {
 };
 
 struct dvb_frontend *mxl111sf_demod_attach(struct mxl111sf_state *mxl_state,
-                                          struct mxl111sf_demod_config *cfg)
+                                  const struct mxl111sf_demod_config *cfg)
 {
        struct mxl111sf_demod_state *state = NULL;
 
index 0bd83e52669c143854ec2eea9636d8279251a185..7065aca81252cc6275bafa2e36f6d9f013340166 100644 (file)
@@ -35,11 +35,11 @@ struct mxl111sf_demod_config {
 #if IS_ENABLED(CONFIG_DVB_USB_MXL111SF)
 extern
 struct dvb_frontend *mxl111sf_demod_attach(struct mxl111sf_state *mxl_state,
-                                          struct mxl111sf_demod_config *cfg);
+                                  const struct mxl111sf_demod_config *cfg);
 #else
 static inline
 struct dvb_frontend *mxl111sf_demod_attach(struct mxl111sf_state *mxl_state,
-                                          struct mxl111sf_demod_config *cfg)
+                                  const struct mxl111sf_demod_config *cfg)
 {
        printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
        return NULL;
index b71b2e60d0803663f88fe1a789411f10c3649c63..1710f9038d7500a59a3133ea03de2a5860f6984e 100644 (file)
@@ -731,7 +731,7 @@ fail:
        return ret;
 }
 
-static struct mxl111sf_demod_config mxl_demod_config = {
+static const struct mxl111sf_demod_config mxl_demod_config = {
        .read_reg        = mxl111sf_read_reg,
        .write_reg       = mxl111sf_write_reg,
        .program_regs    = mxl111sf_ctrl_program_regs,