Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ericvh...
[pandora-kernel.git] / arch / microblaze / kernel / intc.c
index a69d3e3..6eea6f9 100644 (file)
@@ -12,6 +12,7 @@
 #include <linux/irq.h>
 #include <asm/page.h>
 #include <linux/io.h>
+#include <linux/bug.h>
 
 #include <asm/prom.h>
 #include <asm/irq.h>
@@ -130,6 +131,7 @@ void __init init_IRQ(void)
                if (intc)
                        break;
        }
+       BUG_ON(!intc);
 
        intc_baseaddr = *(int *) of_get_property(intc, "reg", NULL);
        intc_baseaddr = (unsigned long) ioremap(intc_baseaddr, PAGE_SIZE);
@@ -137,8 +139,8 @@ void __init init_IRQ(void)
 
        intr_type =
                *(int *) of_get_property(intc, "xlnx,kind-of-intr", NULL);
-       if (intr_type >= (1 << nr_irq))
-               printk(KERN_INFO " ERROR: Mishmash in king-of-intr param\n");
+       if (intr_type >= (1 << (nr_irq + 1)))
+               printk(KERN_INFO " ERROR: Mismatch in kind-of-intr param\n");
 
 #ifdef CONFIG_SELFMOD_INTC
        selfmod_function((int *) arr_func, intc_baseaddr);