Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=66623a0419da2bae2efab40a46018faacce2e3aa
Commit:     66623a0419da2bae2efab40a46018faacce2e3aa
Parent:     53c4e9551c2930767fcdaa54323616c32ed6e9c6
Author:     Mauro Carvalho Chehab <[EMAIL PROTECTED]>
AuthorDate: Thu Mar 29 08:47:04 2007 -0300
Committer:  Mauro Carvalho Chehab <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 15:45:13 2007 -0300

    V4L/DVB (5480): Fix cx88_print_irqbits calls to use ARRAY_SIZE
    
    cx88_print_irqbits were expecting a string pointer with 32 bytes. Better
    to pass the string size and use ARRAY_SIZE on its calls.
    
    Signed-off-by: Mauro Carvalho Chehab <[EMAIL PROTECTED]>
---
 drivers/media/video/cx88/cx88-alsa.c  |    3 ++-
 drivers/media/video/cx88/cx88-core.c  |    8 ++++----
 drivers/media/video/cx88/cx88-mpeg.c  |    3 ++-
 drivers/media/video/cx88/cx88-video.c |    3 ++-
 drivers/media/video/cx88/cx88.h       |    2 +-
 5 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/drivers/media/video/cx88/cx88-alsa.c 
b/drivers/media/video/cx88/cx88-alsa.c
index e4355fd..5a8f18f 100644
--- a/drivers/media/video/cx88/cx88-alsa.c
+++ b/drivers/media/video/cx88/cx88-alsa.c
@@ -232,7 +232,8 @@ static void cx8801_aud_irq(snd_cx88_card_t *chip)
        cx_write(MO_AUD_INTSTAT, status);
        if (debug > 1  ||  (status & mask & ~0xff))
                cx88_print_irqbits(core->name, "irq aud",
-                                  cx88_aud_irqs, status, mask);
+                                  cx88_aud_irqs, ARRAY_SIZE(cx88_aud_irqs),
+                                  status, mask);
        /* risc op code error */
        if (status & (1 << 16)) {
                printk(KERN_WARNING "%s/0: audio risc op code 
error\n",core->name);
diff --git a/drivers/media/video/cx88/cx88-core.c 
b/drivers/media/video/cx88/cx88-core.c
index d86813b..f31ec96 100644
--- a/drivers/media/video/cx88/cx88-core.c
+++ b/drivers/media/video/cx88/cx88-core.c
@@ -489,12 +489,12 @@ static char *cx88_pci_irqs[32] = {
 };
 
 void cx88_print_irqbits(char *name, char *tag, char **strings,
-                       u32 bits, u32 mask)
+                       int len, u32 bits, u32 mask)
 {
        unsigned int i;
 
        printk(KERN_DEBUG "%s: %s [0x%x]", name, tag, bits);
-       for (i = 0; i < 32; i++) {
+       for (i = 0; i < len; i++) {
                if (!(bits & (1 << i)))
                        continue;
                if (strings[i])
@@ -520,8 +520,8 @@ int cx88_core_irq(struct cx88_core *core, u32 status)
        }
        if (!handled)
                cx88_print_irqbits(core->name, "irq pci",
-                                  cx88_pci_irqs, status,
-                                  core->pci_irqmask);
+                                  cx88_pci_irqs, ARRAY_SIZE(cx88_pci_irqs),
+                                  status, core->pci_irqmask);
        return handled;
 }
 
diff --git a/drivers/media/video/cx88/cx88-mpeg.c 
b/drivers/media/video/cx88/cx88-mpeg.c
index db98f1f..def939d 100644
--- a/drivers/media/video/cx88/cx88-mpeg.c
+++ b/drivers/media/video/cx88/cx88-mpeg.c
@@ -366,7 +366,8 @@ static void cx8802_mpeg_irq(struct cx8802_dev *dev)
 
        if (debug || (status & mask & ~0xff))
                cx88_print_irqbits(core->name, "irq mpeg ",
-                                  cx88_mpeg_irqs, status, mask);
+                                  cx88_mpeg_irqs, ARRAY_SIZE(cx88_mpeg_irqs),
+                                  status, mask);
 
        /* risc op code error */
        if (status & (1 << 16)) {
diff --git a/drivers/media/video/cx88/cx88-video.c 
b/drivers/media/video/cx88/cx88-video.c
index bdfe2af..5ae5c02 100644
--- a/drivers/media/video/cx88/cx88-video.c
+++ b/drivers/media/video/cx88/cx88-video.c
@@ -1555,7 +1555,8 @@ static void cx8800_vid_irq(struct cx8800_dev *dev)
        cx_write(MO_VID_INTSTAT, status);
        if (irq_debug  ||  (status & mask & ~0xff))
                cx88_print_irqbits(core->name, "irq vid",
-                                  cx88_vid_irqs, status, mask);
+                                  cx88_vid_irqs, ARRAY_SIZE(cx88_vid_irqs),
+                                  status, mask);
 
        /* risc op code error */
        if (status & (1 << 16)) {
diff --git a/drivers/media/video/cx88/cx88.h b/drivers/media/video/cx88/cx88.h
index d16ed93..738d4f2 100644
--- a/drivers/media/video/cx88/cx88.h
+++ b/drivers/media/video/cx88/cx88.h
@@ -512,7 +512,7 @@ struct cx8802_dev {
 /* cx88-core.c                                                 */
 
 extern void cx88_print_irqbits(char *name, char *tag, char **strings,
-                              u32 bits, u32 mask);
+                              int len, u32 bits, u32 mask);
 
 extern int cx88_core_irq(struct cx88_core *core, u32 status);
 extern void cx88_wakeup(struct cx88_core *core,
-
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