Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=57747b7f2517524aed5f0c5b744badf9da94a91b
Commit:     57747b7f2517524aed5f0c5b744badf9da94a91b
Parent:     f423b9a86a6dd3d2bc08d78f4d21525a14c40a6b
Author:     Mauro Carvalho Chehab <[EMAIL PROTECTED]>
AuthorDate: Wed Mar 28 22:37:20 2007 -0300
Committer:  Mauro Carvalho Chehab <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 15:45:09 2007 -0300

    V4L/DVB (5476): Fix gpiomux array size
    
    there were several "magic" for loops, addressing gpiomux array size (4).
    Adrian Bunk 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 Bunk <[EMAIL PROTECTED]> for pointing me about this 
trouble.
    Signed-off-by: Mauro Carvalho Chehab <[EMAIL PROTECTED]>
---
 drivers/media/video/bt8xx/bttv-cards.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/media/video/bt8xx/bttv-cards.c 
b/drivers/media/video/bt8xx/bttv-cards.c
index 6addc42..3d00d50 100644
--- a/drivers/media/video/bt8xx/bttv-cards.c
+++ b/drivers/media/video/bt8xx/bttv-cards.c
@@ -2970,20 +2970,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");
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to