diff options
author | Ahmed S. Darwish <darwish.07@gmail.com> | 2007-02-14 19:57:42 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-02-21 10:35:18 -0500 |
commit | 0496daa7d88d117fab4dd190c7f6e7c4a5aa15cd (patch) | |
tree | 184317008142232cc6b90964394e35438582ad59 /drivers/media/dvb | |
parent | fd4bc4455360ff0b6ff50ec8fa5673b4da18cbb6 (diff) |
V4L/DVB (5202): DVB: Use ARRAY_SIZE macro when appropriate
Use ARRAY_SIZE macro already defined in kernel.h
Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com>
Acked-by: Manu Abraham <manu@linuxtv.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/dvb')
-rw-r--r-- | drivers/media/dvb/bt8xx/dst.c | 2 | ||||
-rw-r--r-- | drivers/media/dvb/bt8xx/dvb-bt8xx.c | 3 | ||||
-rw-r--r-- | drivers/media/dvb/frontends/cx24110.c | 4 | ||||
-rw-r--r-- | drivers/media/dvb/frontends/cx24123.c | 6 | ||||
-rw-r--r-- | drivers/media/dvb/ttpci/av7110_ir.c | 3 |
5 files changed, 10 insertions, 8 deletions
diff --git a/drivers/media/dvb/bt8xx/dst.c b/drivers/media/dvb/bt8xx/dst.c index 9f72b7000c08..0393a3d19920 100644 --- a/drivers/media/dvb/bt8xx/dst.c +++ b/drivers/media/dvb/bt8xx/dst.c | |||
@@ -1161,7 +1161,7 @@ static int dst_get_device_id(struct dst_state *state) | |||
1161 | } | 1161 | } |
1162 | } | 1162 | } |
1163 | 1163 | ||
1164 | if (i >= sizeof (dst_tlist) / sizeof (dst_tlist [0])) { | 1164 | if (i >= ARRAY_SIZE(dst_tlist)) { |
1165 | dprintk(verbose, DST_ERROR, 1, "Unable to recognize %s or %s", &state->rxbuffer[0], &state->rxbuffer[1]); | 1165 | dprintk(verbose, DST_ERROR, 1, "Unable to recognize %s or %s", &state->rxbuffer[0], &state->rxbuffer[1]); |
1166 | dprintk(verbose, DST_ERROR, 1, "please email linux-dvb@linuxtv.org with this type in"); | 1166 | dprintk(verbose, DST_ERROR, 1, "please email linux-dvb@linuxtv.org with this type in"); |
1167 | use_dst_type = DST_TYPE_IS_SAT; | 1167 | use_dst_type = DST_TYPE_IS_SAT; |
diff --git a/drivers/media/dvb/bt8xx/dvb-bt8xx.c b/drivers/media/dvb/bt8xx/dvb-bt8xx.c index 3e35931af35d..58f69f6ae391 100644 --- a/drivers/media/dvb/bt8xx/dvb-bt8xx.c +++ b/drivers/media/dvb/bt8xx/dvb-bt8xx.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/module.h> | 23 | #include <linux/module.h> |
24 | #include <linux/moduleparam.h> | 24 | #include <linux/moduleparam.h> |
25 | #include <linux/init.h> | 25 | #include <linux/init.h> |
26 | #include <linux/kernel.h> | ||
26 | #include <linux/device.h> | 27 | #include <linux/device.h> |
27 | #include <linux/delay.h> | 28 | #include <linux/delay.h> |
28 | #include <linux/slab.h> | 29 | #include <linux/slab.h> |
@@ -213,7 +214,7 @@ static int cx24108_tuner_set_params(struct dvb_frontend* fe, struct dvb_frontend | |||
213 | freq = 2150000; /* satellite IF is 950..2150MHz */ | 214 | freq = 2150000; /* satellite IF is 950..2150MHz */ |
214 | 215 | ||
215 | /* decide which VCO to use for the input frequency */ | 216 | /* decide which VCO to use for the input frequency */ |
216 | for(i=1;(i<sizeof(osci)/sizeof(osci[0]))&&(osci[i]<freq);i++); | 217 | for(i = 1; (i < ARRAY_SIZE(osci)) && (osci[i] < freq); i++); |
217 | printk("cx24108 debug: select vco #%d (f=%d)\n",i,freq); | 218 | printk("cx24108 debug: select vco #%d (f=%d)\n",i,freq); |
218 | band=bandsel[i]; | 219 | band=bandsel[i]; |
219 | /* the gain values must be set by SetSymbolrate */ | 220 | /* the gain values must be set by SetSymbolrate */ |
diff --git a/drivers/media/dvb/frontends/cx24110.c b/drivers/media/dvb/frontends/cx24110.c index ae96395217a2..10fc0c8316dd 100644 --- a/drivers/media/dvb/frontends/cx24110.c +++ b/drivers/media/dvb/frontends/cx24110.c | |||
@@ -254,7 +254,7 @@ static int cx24110_set_symbolrate (struct cx24110_state* state, u32 srate) | |||
254 | if (srate<500000) | 254 | if (srate<500000) |
255 | srate=500000; | 255 | srate=500000; |
256 | 256 | ||
257 | for(i=0;(i<sizeof(bands)/sizeof(bands[0]))&&(srate>bands[i]);i++) | 257 | for(i = 0; (i < ARRAY_SIZE(bands)) && (srate>bands[i]); i++) |
258 | ; | 258 | ; |
259 | /* first, check which sample rate is appropriate: 45, 60 80 or 90 MHz, | 259 | /* first, check which sample rate is appropriate: 45, 60 80 or 90 MHz, |
260 | and set the PLL accordingly (R07[1:0] Fclk, R06[7:4] PLLmult, | 260 | and set the PLL accordingly (R07[1:0] Fclk, R06[7:4] PLLmult, |
@@ -361,7 +361,7 @@ static int cx24110_initfe(struct dvb_frontend* fe) | |||
361 | 361 | ||
362 | dprintk("%s: init chip\n", __FUNCTION__); | 362 | dprintk("%s: init chip\n", __FUNCTION__); |
363 | 363 | ||
364 | for(i=0;i<sizeof(cx24110_regdata)/sizeof(cx24110_regdata[0]);i++) { | 364 | for(i = 0; i < ARRAY_SIZE(cx24110_regdata); i++) { |
365 | cx24110_writereg(state, cx24110_regdata[i].reg, cx24110_regdata[i].data); | 365 | cx24110_writereg(state, cx24110_regdata[i].reg, cx24110_regdata[i].data); |
366 | }; | 366 | }; |
367 | 367 | ||
diff --git a/drivers/media/dvb/frontends/cx24123.c b/drivers/media/dvb/frontends/cx24123.c index a356d28fc3bb..732e94aaa364 100644 --- a/drivers/media/dvb/frontends/cx24123.c +++ b/drivers/media/dvb/frontends/cx24123.c | |||
@@ -507,7 +507,7 @@ static int cx24123_pll_calculate(struct dvb_frontend* fe, struct dvb_frontend_pa | |||
507 | int i = 0; | 507 | int i = 0; |
508 | int pump = 2; | 508 | int pump = 2; |
509 | int band = 0; | 509 | int band = 0; |
510 | int num_bands = sizeof(cx24123_bandselect_vals) / sizeof(cx24123_bandselect_vals[0]); | 510 | int num_bands = ARRAY_SIZE(cx24123_bandselect_vals); |
511 | 511 | ||
512 | /* Defaults for low freq, low rate */ | 512 | /* Defaults for low freq, low rate */ |
513 | state->VCAarg = cx24123_AGC_vals[0].VCAprogdata; | 513 | state->VCAarg = cx24123_AGC_vals[0].VCAprogdata; |
@@ -516,7 +516,7 @@ static int cx24123_pll_calculate(struct dvb_frontend* fe, struct dvb_frontend_pa | |||
516 | vco_div = cx24123_bandselect_vals[0].VCOdivider; | 516 | vco_div = cx24123_bandselect_vals[0].VCOdivider; |
517 | 517 | ||
518 | /* For the given symbol rate, determine the VCA, VGA and FILTUNE programming bits */ | 518 | /* For the given symbol rate, determine the VCA, VGA and FILTUNE programming bits */ |
519 | for (i = 0; i < sizeof(cx24123_AGC_vals) / sizeof(cx24123_AGC_vals[0]); i++) | 519 | for (i = 0; i < ARRAY_SIZE(cx24123_AGC_vals); i++) |
520 | { | 520 | { |
521 | if ((cx24123_AGC_vals[i].symbolrate_low <= p->u.qpsk.symbol_rate) && | 521 | if ((cx24123_AGC_vals[i].symbolrate_low <= p->u.qpsk.symbol_rate) && |
522 | (cx24123_AGC_vals[i].symbolrate_high >= p->u.qpsk.symbol_rate) ) { | 522 | (cx24123_AGC_vals[i].symbolrate_high >= p->u.qpsk.symbol_rate) ) { |
@@ -658,7 +658,7 @@ static int cx24123_initfe(struct dvb_frontend* fe) | |||
658 | dprintk("%s: init frontend\n",__FUNCTION__); | 658 | dprintk("%s: init frontend\n",__FUNCTION__); |
659 | 659 | ||
660 | /* Configure the demod to a good set of defaults */ | 660 | /* Configure the demod to a good set of defaults */ |
661 | for (i = 0; i < sizeof(cx24123_regdata) / sizeof(cx24123_regdata[0]); i++) | 661 | for (i = 0; i < ARRAY_SIZE(cx24123_regdata); i++) |
662 | cx24123_writereg(state, cx24123_regdata[i].reg, cx24123_regdata[i].data); | 662 | cx24123_writereg(state, cx24123_regdata[i].reg, cx24123_regdata[i].data); |
663 | 663 | ||
664 | /* Set the LNB polarity */ | 664 | /* Set the LNB polarity */ |
diff --git a/drivers/media/dvb/ttpci/av7110_ir.c b/drivers/media/dvb/ttpci/av7110_ir.c index 744d87e563cd..f59465bb0af3 100644 --- a/drivers/media/dvb/ttpci/av7110_ir.c +++ b/drivers/media/dvb/ttpci/av7110_ir.c | |||
@@ -4,6 +4,7 @@ | |||
4 | #include <linux/moduleparam.h> | 4 | #include <linux/moduleparam.h> |
5 | #include <linux/input.h> | 5 | #include <linux/input.h> |
6 | #include <linux/proc_fs.h> | 6 | #include <linux/proc_fs.h> |
7 | #include <linux/kernel.h> | ||
7 | #include <asm/bitops.h> | 8 | #include <asm/bitops.h> |
8 | 9 | ||
9 | #include "av7110.h" | 10 | #include "av7110.h" |
@@ -218,7 +219,7 @@ int __devinit av7110_ir_init(struct av7110 *av7110) | |||
218 | static struct proc_dir_entry *e; | 219 | static struct proc_dir_entry *e; |
219 | int err; | 220 | int err; |
220 | 221 | ||
221 | if (av_cnt >= sizeof av_list/sizeof av_list[0]) | 222 | if (av_cnt >= ARRAY_SIZE(av_list)) |
222 | return -ENOSPC; | 223 | return -ENOSPC; |
223 | 224 | ||
224 | av7110_setup_irc_config(av7110, 0x0001); | 225 | av7110_setup_irc_config(av7110, 0x0001); |