Commit 66623a04 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

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: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent 53c4e955
...@@ -232,7 +232,8 @@ static void cx8801_aud_irq(snd_cx88_card_t *chip) ...@@ -232,7 +232,8 @@ static void cx8801_aud_irq(snd_cx88_card_t *chip)
cx_write(MO_AUD_INTSTAT, status); cx_write(MO_AUD_INTSTAT, status);
if (debug > 1 || (status & mask & ~0xff)) if (debug > 1 || (status & mask & ~0xff))
cx88_print_irqbits(core->name, "irq aud", 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 */ /* risc op code error */
if (status & (1 << 16)) { if (status & (1 << 16)) {
printk(KERN_WARNING "%s/0: audio risc op code error\n",core->name); printk(KERN_WARNING "%s/0: audio risc op code error\n",core->name);
......
...@@ -489,12 +489,12 @@ static char *cx88_pci_irqs[32] = { ...@@ -489,12 +489,12 @@ static char *cx88_pci_irqs[32] = {
}; };
void cx88_print_irqbits(char *name, char *tag, char **strings, void cx88_print_irqbits(char *name, char *tag, char **strings,
u32 bits, u32 mask) int len, u32 bits, u32 mask)
{ {
unsigned int i; unsigned int i;
printk(KERN_DEBUG "%s: %s [0x%x]", name, tag, bits); 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))) if (!(bits & (1 << i)))
continue; continue;
if (strings[i]) if (strings[i])
...@@ -520,8 +520,8 @@ int cx88_core_irq(struct cx88_core *core, u32 status) ...@@ -520,8 +520,8 @@ int cx88_core_irq(struct cx88_core *core, u32 status)
} }
if (!handled) if (!handled)
cx88_print_irqbits(core->name, "irq pci", cx88_print_irqbits(core->name, "irq pci",
cx88_pci_irqs, status, cx88_pci_irqs, ARRAY_SIZE(cx88_pci_irqs),
core->pci_irqmask); status, core->pci_irqmask);
return handled; return handled;
} }
......
...@@ -366,7 +366,8 @@ static void cx8802_mpeg_irq(struct cx8802_dev *dev) ...@@ -366,7 +366,8 @@ static void cx8802_mpeg_irq(struct cx8802_dev *dev)
if (debug || (status & mask & ~0xff)) if (debug || (status & mask & ~0xff))
cx88_print_irqbits(core->name, "irq mpeg ", 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 */ /* risc op code error */
if (status & (1 << 16)) { if (status & (1 << 16)) {
......
...@@ -1555,7 +1555,8 @@ static void cx8800_vid_irq(struct cx8800_dev *dev) ...@@ -1555,7 +1555,8 @@ static void cx8800_vid_irq(struct cx8800_dev *dev)
cx_write(MO_VID_INTSTAT, status); cx_write(MO_VID_INTSTAT, status);
if (irq_debug || (status & mask & ~0xff)) if (irq_debug || (status & mask & ~0xff))
cx88_print_irqbits(core->name, "irq vid", 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 */ /* risc op code error */
if (status & (1 << 16)) { if (status & (1 << 16)) {
......
...@@ -512,7 +512,7 @@ struct cx8802_dev { ...@@ -512,7 +512,7 @@ struct cx8802_dev {
/* cx88-core.c */ /* cx88-core.c */
extern void cx88_print_irqbits(char *name, char *tag, char **strings, 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 int cx88_core_irq(struct cx88_core *core, u32 status);
extern void cx88_wakeup(struct cx88_core *core, extern void cx88_wakeup(struct cx88_core *core,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment