diff options
author | lawrence rust <lawrence@softsystem.co.uk> | 2010-08-25 08:50:20 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-10-20 23:04:52 -0400 |
commit | 2e4e98e788d8fbe30892bee3375067a4937155da (patch) | |
tree | 66d0ae3a74fa77f3e1cffa752dc61bd4089ce609 /drivers/media/dvb | |
parent | f71d76812e6cd3af8e293eeb8eb465c208e771cc (diff) |
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: Lawrence Rust <lvr@softsystem.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb')
-rw-r--r-- | drivers/media/dvb/dvb-core/dvb_frontend.h | 2 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/friio-fe.c | 2 | ||||
-rw-r--r-- | drivers/media/dvb/frontends/cx24110.c | 2 | ||||
-rw-r--r-- | drivers/media/dvb/frontends/lgs8gxx.c | 2 | ||||
-rw-r--r-- | drivers/media/dvb/frontends/mt352.c | 2 | ||||
-rw-r--r-- | drivers/media/dvb/frontends/mt352.h | 2 | ||||
-rw-r--r-- | drivers/media/dvb/frontends/si21xx.c | 2 | ||||
-rw-r--r-- | drivers/media/dvb/frontends/stb6100.c | 2 | ||||
-rw-r--r-- | drivers/media/dvb/frontends/stb6100.h | 4 | ||||
-rw-r--r-- | drivers/media/dvb/frontends/stv0288.c | 2 | ||||
-rw-r--r-- | drivers/media/dvb/frontends/stv0299.c | 2 | ||||
-rw-r--r-- | drivers/media/dvb/frontends/stv0299.h | 2 | ||||
-rw-r--r-- | drivers/media/dvb/frontends/tda1004x.c | 2 | ||||
-rw-r--r-- | drivers/media/dvb/frontends/zl10353.c | 2 |
14 files changed, 15 insertions, 15 deletions
diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.h b/drivers/media/dvb/dvb-core/dvb_frontend.h index bf0e6bed28dd..f9f19be77181 100644 --- a/drivers/media/dvb/dvb-core/dvb_frontend.h +++ b/drivers/media/dvb/dvb-core/dvb_frontend.h | |||
@@ -260,7 +260,7 @@ struct dvb_frontend_ops { | |||
260 | int (*init)(struct dvb_frontend* fe); | 260 | int (*init)(struct dvb_frontend* fe); |
261 | int (*sleep)(struct dvb_frontend* fe); | 261 | int (*sleep)(struct dvb_frontend* fe); |
262 | 262 | ||
263 | int (*write)(struct dvb_frontend* fe, u8* buf, int len); | 263 | int (*write)(struct dvb_frontend* fe, const u8 buf[], int len); |
264 | 264 | ||
265 | /* if this is set, it overrides the default swzigzag */ | 265 | /* if this is set, it overrides the default swzigzag */ |
266 | int (*tune)(struct dvb_frontend* fe, | 266 | int (*tune)(struct dvb_frontend* fe, |
diff --git a/drivers/media/dvb/dvb-usb/friio-fe.c b/drivers/media/dvb/dvb-usb/friio-fe.c index 93c21ddd0b77..015b4e8af1a5 100644 --- a/drivers/media/dvb/dvb-usb/friio-fe.c +++ b/drivers/media/dvb/dvb-usb/friio-fe.c | |||
@@ -75,7 +75,7 @@ static int jdvbt90502_single_reg_write(struct jdvbt90502_state *state, | |||
75 | return 0; | 75 | return 0; |
76 | } | 76 | } |
77 | 77 | ||
78 | static int _jdvbt90502_write(struct dvb_frontend *fe, u8 *buf, int len) | 78 | static int _jdvbt90502_write(struct dvb_frontend *fe, const u8 buf[], int len) |
79 | { | 79 | { |
80 | struct jdvbt90502_state *state = fe->demodulator_priv; | 80 | struct jdvbt90502_state *state = fe->demodulator_priv; |
81 | int err, i; | 81 | int err, i; |
diff --git a/drivers/media/dvb/frontends/cx24110.c b/drivers/media/dvb/frontends/cx24110.c index 00a4e8f03304..7a1a5bc337d8 100644 --- a/drivers/media/dvb/frontends/cx24110.c +++ b/drivers/media/dvb/frontends/cx24110.c | |||
@@ -310,7 +310,7 @@ static int cx24110_set_symbolrate (struct cx24110_state* state, u32 srate) | |||
310 | 310 | ||
311 | } | 311 | } |
312 | 312 | ||
313 | static int _cx24110_pll_write (struct dvb_frontend* fe, u8 *buf, int len) | 313 | static int _cx24110_pll_write (struct dvb_frontend* fe, const u8 buf[], int len) |
314 | { | 314 | { |
315 | struct cx24110_state *state = fe->demodulator_priv; | 315 | struct cx24110_state *state = fe->demodulator_priv; |
316 | 316 | ||
diff --git a/drivers/media/dvb/frontends/lgs8gxx.c b/drivers/media/dvb/frontends/lgs8gxx.c index 5ea28ae2ba8f..0fcddc4569d2 100644 --- a/drivers/media/dvb/frontends/lgs8gxx.c +++ b/drivers/media/dvb/frontends/lgs8gxx.c | |||
@@ -662,7 +662,7 @@ static void lgs8gxx_release(struct dvb_frontend *fe) | |||
662 | } | 662 | } |
663 | 663 | ||
664 | 664 | ||
665 | static int lgs8gxx_write(struct dvb_frontend *fe, u8 *buf, int len) | 665 | static int lgs8gxx_write(struct dvb_frontend *fe, const u8 buf[], int len) |
666 | { | 666 | { |
667 | struct lgs8gxx_state *priv = fe->demodulator_priv; | 667 | struct lgs8gxx_state *priv = fe->demodulator_priv; |
668 | 668 | ||
diff --git a/drivers/media/dvb/frontends/mt352.c b/drivers/media/dvb/frontends/mt352.c index beba5aa0db50..319672f8e1a7 100644 --- a/drivers/media/dvb/frontends/mt352.c +++ b/drivers/media/dvb/frontends/mt352.c | |||
@@ -69,7 +69,7 @@ static int mt352_single_write(struct dvb_frontend *fe, u8 reg, u8 val) | |||
69 | return 0; | 69 | return 0; |
70 | } | 70 | } |
71 | 71 | ||
72 | static int _mt352_write(struct dvb_frontend* fe, u8* ibuf, int ilen) | 72 | static int _mt352_write(struct dvb_frontend* fe, const u8 ibuf[], int ilen) |
73 | { | 73 | { |
74 | int err,i; | 74 | int err,i; |
75 | for (i=0; i < ilen-1; i++) | 75 | for (i=0; i < ilen-1; i++) |
diff --git a/drivers/media/dvb/frontends/mt352.h b/drivers/media/dvb/frontends/mt352.h index 595092f9f0c4..ca2562d6f289 100644 --- a/drivers/media/dvb/frontends/mt352.h +++ b/drivers/media/dvb/frontends/mt352.h | |||
@@ -63,7 +63,7 @@ static inline struct dvb_frontend* mt352_attach(const struct mt352_config* confi | |||
63 | } | 63 | } |
64 | #endif // CONFIG_DVB_MT352 | 64 | #endif // CONFIG_DVB_MT352 |
65 | 65 | ||
66 | static inline int mt352_write(struct dvb_frontend *fe, u8 *buf, int len) { | 66 | static inline int mt352_write(struct dvb_frontend *fe, const u8 buf[], int len) { |
67 | int r = 0; | 67 | int r = 0; |
68 | if (fe->ops.write) | 68 | if (fe->ops.write) |
69 | r = fe->ops.write(fe, buf, len); | 69 | r = fe->ops.write(fe, buf, len); |
diff --git a/drivers/media/dvb/frontends/si21xx.c b/drivers/media/dvb/frontends/si21xx.c index d21a327db629..4b0c99a08a85 100644 --- a/drivers/media/dvb/frontends/si21xx.c +++ b/drivers/media/dvb/frontends/si21xx.c | |||
@@ -268,7 +268,7 @@ static int si21_writereg(struct si21xx_state *state, u8 reg, u8 data) | |||
268 | return (ret != 1) ? -EREMOTEIO : 0; | 268 | return (ret != 1) ? -EREMOTEIO : 0; |
269 | } | 269 | } |
270 | 270 | ||
271 | static int si21_write(struct dvb_frontend *fe, u8 *buf, int len) | 271 | static int si21_write(struct dvb_frontend *fe, const u8 buf[], int len) |
272 | { | 272 | { |
273 | struct si21xx_state *state = fe->demodulator_priv; | 273 | struct si21xx_state *state = fe->demodulator_priv; |
274 | 274 | ||
diff --git a/drivers/media/dvb/frontends/stb6100.c b/drivers/media/dvb/frontends/stb6100.c index f73c13323e90..80a9e4cba631 100644 --- a/drivers/media/dvb/frontends/stb6100.c +++ b/drivers/media/dvb/frontends/stb6100.c | |||
@@ -506,7 +506,7 @@ static struct dvb_tuner_ops stb6100_ops = { | |||
506 | }; | 506 | }; |
507 | 507 | ||
508 | struct dvb_frontend *stb6100_attach(struct dvb_frontend *fe, | 508 | struct dvb_frontend *stb6100_attach(struct dvb_frontend *fe, |
509 | struct stb6100_config *config, | 509 | const struct stb6100_config *config, |
510 | struct i2c_adapter *i2c) | 510 | struct i2c_adapter *i2c) |
511 | { | 511 | { |
512 | struct stb6100_state *state = NULL; | 512 | struct stb6100_state *state = NULL; |
diff --git a/drivers/media/dvb/frontends/stb6100.h b/drivers/media/dvb/frontends/stb6100.h index 395d056599a6..2ab096614b3f 100644 --- a/drivers/media/dvb/frontends/stb6100.h +++ b/drivers/media/dvb/frontends/stb6100.h | |||
@@ -97,13 +97,13 @@ struct stb6100_state { | |||
97 | #if defined(CONFIG_DVB_STB6100) || (defined(CONFIG_DVB_STB6100_MODULE) && defined(MODULE)) | 97 | #if defined(CONFIG_DVB_STB6100) || (defined(CONFIG_DVB_STB6100_MODULE) && defined(MODULE)) |
98 | 98 | ||
99 | extern struct dvb_frontend *stb6100_attach(struct dvb_frontend *fe, | 99 | extern struct dvb_frontend *stb6100_attach(struct dvb_frontend *fe, |
100 | struct stb6100_config *config, | 100 | const struct stb6100_config *config, |
101 | struct i2c_adapter *i2c); | 101 | struct i2c_adapter *i2c); |
102 | 102 | ||
103 | #else | 103 | #else |
104 | 104 | ||
105 | static inline struct dvb_frontend *stb6100_attach(struct dvb_frontend *fe, | 105 | static inline struct dvb_frontend *stb6100_attach(struct dvb_frontend *fe, |
106 | struct stb6100_config *config, | 106 | const struct stb6100_config *config, |
107 | struct i2c_adapter *i2c) | 107 | struct i2c_adapter *i2c) |
108 | { | 108 | { |
109 | printk(KERN_WARNING "%s: Driver disabled by Kconfig\n", __func__); | 109 | printk(KERN_WARNING "%s: Driver disabled by Kconfig\n", __func__); |
diff --git a/drivers/media/dvb/frontends/stv0288.c b/drivers/media/dvb/frontends/stv0288.c index 2930a5d6768a..743989dbb18d 100644 --- a/drivers/media/dvb/frontends/stv0288.c +++ b/drivers/media/dvb/frontends/stv0288.c | |||
@@ -78,7 +78,7 @@ static int stv0288_writeregI(struct stv0288_state *state, u8 reg, u8 data) | |||
78 | return (ret != 1) ? -EREMOTEIO : 0; | 78 | return (ret != 1) ? -EREMOTEIO : 0; |
79 | } | 79 | } |
80 | 80 | ||
81 | static int stv0288_write(struct dvb_frontend *fe, u8 *buf, int len) | 81 | static int stv0288_write(struct dvb_frontend *fe, const u8 buf[], int len) |
82 | { | 82 | { |
83 | struct stv0288_state *state = fe->demodulator_priv; | 83 | struct stv0288_state *state = fe->demodulator_priv; |
84 | 84 | ||
diff --git a/drivers/media/dvb/frontends/stv0299.c b/drivers/media/dvb/frontends/stv0299.c index 968874469726..4e3db3a42e06 100644 --- a/drivers/media/dvb/frontends/stv0299.c +++ b/drivers/media/dvb/frontends/stv0299.c | |||
@@ -92,7 +92,7 @@ static int stv0299_writeregI (struct stv0299_state* state, u8 reg, u8 data) | |||
92 | return (ret != 1) ? -EREMOTEIO : 0; | 92 | return (ret != 1) ? -EREMOTEIO : 0; |
93 | } | 93 | } |
94 | 94 | ||
95 | static int stv0299_write(struct dvb_frontend* fe, u8 *buf, int len) | 95 | static int stv0299_write(struct dvb_frontend* fe, const u8 buf[], int len) |
96 | { | 96 | { |
97 | struct stv0299_state* state = fe->demodulator_priv; | 97 | struct stv0299_state* state = fe->demodulator_priv; |
98 | 98 | ||
diff --git a/drivers/media/dvb/frontends/stv0299.h b/drivers/media/dvb/frontends/stv0299.h index 0fd96e22b650..ba219b767a69 100644 --- a/drivers/media/dvb/frontends/stv0299.h +++ b/drivers/media/dvb/frontends/stv0299.h | |||
@@ -65,7 +65,7 @@ struct stv0299_config | |||
65 | * First of each pair is the register, second is the value. | 65 | * First of each pair is the register, second is the value. |
66 | * List should be terminated with an 0xff, 0xff pair. | 66 | * List should be terminated with an 0xff, 0xff pair. |
67 | */ | 67 | */ |
68 | u8* inittab; | 68 | const u8* inittab; |
69 | 69 | ||
70 | /* master clock to use */ | 70 | /* master clock to use */ |
71 | u32 mclk; | 71 | u32 mclk; |
diff --git a/drivers/media/dvb/frontends/tda1004x.c b/drivers/media/dvb/frontends/tda1004x.c index f2a8abe0a243..ea485d923550 100644 --- a/drivers/media/dvb/frontends/tda1004x.c +++ b/drivers/media/dvb/frontends/tda1004x.c | |||
@@ -598,7 +598,7 @@ static int tda1004x_decode_fec(int tdafec) | |||
598 | return -1; | 598 | return -1; |
599 | } | 599 | } |
600 | 600 | ||
601 | static int tda1004x_write(struct dvb_frontend* fe, u8 *buf, int len) | 601 | static int tda1004x_write(struct dvb_frontend* fe, const u8 buf[], int len) |
602 | { | 602 | { |
603 | struct tda1004x_state* state = fe->demodulator_priv; | 603 | struct tda1004x_state* state = fe->demodulator_priv; |
604 | 604 | ||
diff --git a/drivers/media/dvb/frontends/zl10353.c b/drivers/media/dvb/frontends/zl10353.c index 8c612719adfc..adbbf6d3d044 100644 --- a/drivers/media/dvb/frontends/zl10353.c +++ b/drivers/media/dvb/frontends/zl10353.c | |||
@@ -64,7 +64,7 @@ static int zl10353_single_write(struct dvb_frontend *fe, u8 reg, u8 val) | |||
64 | return 0; | 64 | return 0; |
65 | } | 65 | } |
66 | 66 | ||
67 | static int zl10353_write(struct dvb_frontend *fe, u8 *ibuf, int ilen) | 67 | static int zl10353_write(struct dvb_frontend *fe, const u8 ibuf[], int ilen) |
68 | { | 68 | { |
69 | int err, i; | 69 | int err, i; |
70 | for (i = 0; i < ilen - 1; i++) | 70 | for (i = 0; i < ilen - 1; i++) |