[MIPS] Use ARRAY_SIZE macro when appropriate
[sfrench/cifs-2.6.git] / arch / mips / mips-boards / malta / malta_int.c
index ed221dc7f6ace1ca4dfced4dfb3da6a3767e5c62..3c206bb171602ff3ce331586ee63a11fc7319825 100644 (file)
 #include <linux/slab.h>
 #include <linux/interrupt.h>
 #include <linux/kernel_stat.h>
+#include <linux/kernel.h>
 #include <linux/random.h>
 
 #include <asm/i8259.h>
 #include <asm/irq_cpu.h>
 #include <asm/io.h>
+#include <asm/irq_regs.h>
 #include <asm/mips-boards/malta.h>
 #include <asm/mips-boards/maltaint.h>
 #include <asm/mips-boards/piix4.h>
@@ -131,7 +133,7 @@ static void corehi_irqdispatch(void)
        unsigned int intedge, intsteer, pcicmd, pcibadaddr;
         unsigned int pcimstat, intisr, inten, intpol;
        unsigned int intrcause,datalo,datahi;
-       struct pt_regs *regs;
+       struct pt_regs *regs = get_irq_regs();
 
         printk("CoreHI interrupt, shouldn't happen, so we die here!!!\n");
         printk("epc   : %08lx\nStatus: %08lx\n"
@@ -212,23 +214,23 @@ static inline unsigned int irq_ffs(unsigned int pending)
        unsigned int a0 = 7;
        unsigned int t0;
 
-       t0 = s0 & 0xf000;
+       t0 = pending & 0xf000;
        t0 = t0 < 1;
        t0 = t0 << 2;
        a0 = a0 - t0;
-       s0 = s0 << t0;
+       pending = pending << t0;
 
-       t0 = s0 & 0xc000;
+       t0 = pending & 0xc000;
        t0 = t0 < 1;
        t0 = t0 << 1;
        a0 = a0 - t0;
-       s0 = s0 << t0;
+       pending = pending << t0;
 
-       t0 = s0 & 0x8000;
+       t0 = pending & 0x8000;
        t0 = t0 < 1;
        //t0 = t0 << 2;
        a0 = a0 - t0;
-       //s0 = s0 << t0;
+       //pending = pending << t0;
 
        return a0;
 #endif
@@ -288,7 +290,7 @@ msc_irqmap_t __initdata msc_irqmap[] = {
        {MSC01C_INT_TMR,                MSC01_IRQ_EDGE, 0},
        {MSC01C_INT_PCI,                MSC01_IRQ_LEVEL, 0},
 };
-int __initdata msc_nr_irqs = sizeof(msc_irqmap)/sizeof(msc_irqmap_t);
+int __initdata msc_nr_irqs = ARRAY_SIZE(msc_irqmap);
 
 msc_irqmap_t __initdata msc_eicirqmap[] = {
        {MSC01E_INT_SW0,                MSC01_IRQ_LEVEL, 0},
@@ -302,14 +304,14 @@ msc_irqmap_t __initdata msc_eicirqmap[] = {
        {MSC01E_INT_PERFCTR,            MSC01_IRQ_LEVEL, 0},
        {MSC01E_INT_CPUCTR,             MSC01_IRQ_LEVEL, 0}
 };
-int __initdata msc_nr_eicirqs = sizeof(msc_eicirqmap)/sizeof(msc_irqmap_t);
+int __initdata msc_nr_eicirqs = ARRAY_SIZE(msc_eicirqmap);
 
 void __init arch_init_irq(void)
 {
        init_i8259_irqs();
 
        if (!cpu_has_veic)
-               mips_cpu_irq_init (MIPSCPU_INT_BASE);
+               mips_cpu_irq_init();
 
         switch(mips_revision_corid) {
         case MIPS_REVISION_CORID_CORE_MSC: