summaryrefslogtreecommitdiff
path: root/linux
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2007-03-28 22:37:20 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-03-28 22:37:20 -0300
commit17531ab07b15d6e8c339eb930f63f9f155a3b23d (patch)
tree60ce7fc83908a342c28dacaf245c623b91841d2d /linux
parent44f4444b3b724e070979c3bb6ea2e9cee9f92e99 (diff)
downloadmediapointer-dvb-s2-17531ab07b15d6e8c339eb930f63f9f155a3b23d.tar.gz
mediapointer-dvb-s2-17531ab07b15d6e8c339eb930f63f9f155a3b23d.tar.bz2
Fix gpiomux array size
From: Mauro Carvalho Chehab <mchehab@infradead.org> there were several "magic" for loops, addressing gpiomux array size (4). Adrian Busta showed that one of the loops were wrong, going from 0 to 4. This patch provides the right fix for this trouble, by using ARRAY_SIZE on all places where we have a for loop using gpiomux. Thanks to Adrian Busta for pointing me about this trouble. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'linux')
-rw-r--r--linux/drivers/media/video/bt8xx/bttv-cards.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/linux/drivers/media/video/bt8xx/bttv-cards.c b/linux/drivers/media/video/bt8xx/bttv-cards.c
index b0e6c3e9c..15f032def 100644
--- a/linux/drivers/media/video/bt8xx/bttv-cards.c
+++ b/linux/drivers/media/video/bt8xx/bttv-cards.c
@@ -3015,20 +3015,20 @@ void __devinit bttv_idcard(struct bttv *btv)
if (UNSET != audiomux[0]) {
gpiobits = 0;
- for (i = 0; i < 4; i++) {
+ for (i = 0; i < ARRAY_SIZE(bttv_tvcards->gpiomux); i++) {
bttv_tvcards[btv->c.type].gpiomux[i] = audiomux[i];
gpiobits |= audiomux[i];
}
} else {
gpiobits = audioall;
- for (i = 0; i < 4; i++) {
+ for (i = 0; i < ARRAY_SIZE(bttv_tvcards->gpiomux); i++) {
bttv_tvcards[btv->c.type].gpiomux[i] = audioall;
}
}
bttv_tvcards[btv->c.type].gpiomask = (UNSET != gpiomask) ? gpiomask : gpiobits;
printk(KERN_INFO "bttv%d: gpio config override: mask=0x%x, mux=",
btv->c.nr,bttv_tvcards[btv->c.type].gpiomask);
- for (i = 0; i < 5; i++) {
+ for (i = 0; i < ARRAY_SIZE(bttv_tvcards->gpiomux); i++) {
printk("%s0x%x", i ? "," : "", bttv_tvcards[btv->c.type].gpiomux[i]);
}
printk("\n");