]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
V4L/DVB (5480): Fix cx88_print_irqbits calls to use ARRAY_SIZE
authorMauro Carvalho Chehab <mchehab@infradead.org>
Thu, 29 Mar 2007 11:47:04 +0000 (08:47 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Fri, 27 Apr 2007 18:45:13 +0000 (15:45 -0300)
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 <mchehab@infradead.org>
drivers/media/video/cx88/cx88-alsa.c
drivers/media/video/cx88/cx88-core.c
drivers/media/video/cx88/cx88-mpeg.c
drivers/media/video/cx88/cx88-video.c
drivers/media/video/cx88/cx88.h

index e4355fdc3b6d179fd959b9ad2481f5ea340786f9..5a8f18f8ddbb14cbee9cd035c04fbc0994b2d7eb 100644 (file)
@@ -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);
index d86813be56de33fa8df22e3402ba94fa669af524..f31ec96924b9e6a8273c2e208dbe052b0d282115 100644 (file)
@@ -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;
 }
 
index db98f1fd3965589bb3483ef7c7d84fea14d5d2b0..def939d435d59e725032bb865643e56a7898178e 100644 (file)
@@ -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)) {
index bdfe2af70124c8ecac34a22bd4e184227c204ec1..5ae5c02644e9e7e0f653b97d3649e18d6f4a57ff 100644 (file)
@@ -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)) {
index d16ed93080e9a175dd4f7aa81fc15b1b002e1deb..738d4f20c580da46fd1ba215d4c0ce9f563568c9 100644 (file)
@@ -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,