Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2e4e98e7 authored by lawrence rust's avatar lawrence rust Committed by Mauro Carvalho Chehab
Browse files

V4L/DVB: drivers/media: Make static data tables and strings const



Making static data const avoids allocation of additional r/w memory and
reduces initialisation time.  It also provides some additional opportunities
for compiler optimisations.

Signed-off-by: default avatarLawrence Rust <lvr@softsystem.co.uk>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent f71d7681
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -1042,7 +1042,7 @@ static const struct dvb_tuner_ops xc5000_tuner_ops = {


struct dvb_frontend *xc5000_attach(struct dvb_frontend *fe,
struct dvb_frontend *xc5000_attach(struct dvb_frontend *fe,
				   struct i2c_adapter *i2c,
				   struct i2c_adapter *i2c,
				   struct xc5000_config *cfg)
				   const struct xc5000_config *cfg)
{
{
	struct xc5000_priv *priv = NULL;
	struct xc5000_priv *priv = NULL;
	int instance;
	int instance;
+2 −2
Original line number Original line Diff line number Diff line
@@ -53,11 +53,11 @@ struct xc5000_config {
    (defined(CONFIG_MEDIA_TUNER_XC5000_MODULE) && defined(MODULE))
    (defined(CONFIG_MEDIA_TUNER_XC5000_MODULE) && defined(MODULE))
extern struct dvb_frontend *xc5000_attach(struct dvb_frontend *fe,
extern struct dvb_frontend *xc5000_attach(struct dvb_frontend *fe,
					  struct i2c_adapter *i2c,
					  struct i2c_adapter *i2c,
					  struct xc5000_config *cfg);
					  const struct xc5000_config *cfg);
#else
#else
static inline struct dvb_frontend *xc5000_attach(struct dvb_frontend *fe,
static inline struct dvb_frontend *xc5000_attach(struct dvb_frontend *fe,
						 struct i2c_adapter *i2c,
						 struct i2c_adapter *i2c,
						 struct xc5000_config *cfg)
						 const struct xc5000_config *cfg)
{
{
	printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
	printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
	return NULL;
	return NULL;
+1 −1
Original line number Original line Diff line number Diff line
@@ -260,7 +260,7 @@ struct dvb_frontend_ops {
	int (*init)(struct dvb_frontend* fe);
	int (*init)(struct dvb_frontend* fe);
	int (*sleep)(struct dvb_frontend* fe);
	int (*sleep)(struct dvb_frontend* fe);


	int (*write)(struct dvb_frontend* fe, u8* buf, int len);
	int (*write)(struct dvb_frontend* fe, const u8 buf[], int len);


	/* if this is set, it overrides the default swzigzag */
	/* if this is set, it overrides the default swzigzag */
	int (*tune)(struct dvb_frontend* fe,
	int (*tune)(struct dvb_frontend* fe,
+1 −1
Original line number Original line Diff line number Diff line
@@ -75,7 +75,7 @@ static int jdvbt90502_single_reg_write(struct jdvbt90502_state *state,
	return 0;
	return 0;
}
}


static int _jdvbt90502_write(struct dvb_frontend *fe, u8 *buf, int len)
static int _jdvbt90502_write(struct dvb_frontend *fe, const u8 buf[], int len)
{
{
	struct jdvbt90502_state *state = fe->demodulator_priv;
	struct jdvbt90502_state *state = fe->demodulator_priv;
	int err, i;
	int err, i;
+1 −1
Original line number Original line Diff line number Diff line
@@ -310,7 +310,7 @@ static int cx24110_set_symbolrate (struct cx24110_state* state, u32 srate)


}
}


static int _cx24110_pll_write (struct dvb_frontend* fe, u8 *buf, int len)
static int _cx24110_pll_write (struct dvb_frontend* fe, const u8 buf[], int len)
{
{
	struct cx24110_state *state = fe->demodulator_priv;
	struct cx24110_state *state = fe->demodulator_priv;


Loading