nexus/intr: Change the wrong cpuid backtrace to assertion
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Fri, 16 Dec 2011 03:08:03 +0000 (11:08 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Fri, 16 Dec 2011 08:08:03 +0000 (16:08 +0800)
sys/platform/pc32/i386/nexus.c
sys/platform/pc64/x86_64/nexus.c

index 0ae3d48..b321bbc 100644 (file)
@@ -355,11 +355,8 @@ nexus_alloc_resource(device_t bus, device_t child, int type, int *rid,
 
        switch (type) {
        case SYS_RES_IRQ:
-               if (cpuid < 0 || cpuid >= ncpus) {
-                       kprintf("NEXUS cpuid %d:\n", cpuid);
-                       print_backtrace(-1);
-                       cpuid = 0; /* XXX */
-               }
+               KASSERT(cpuid >= 0 || cpuid < ncpus,
+                   ("nexus invalid cpuid %d:\n", cpuid));
                rm = &irq_rman[cpuid];
                break;
 
index 4fca4e3..2ab6deb 100644 (file)
@@ -351,11 +351,8 @@ nexus_alloc_resource(device_t bus, device_t child, int type, int *rid,
 
        switch (type) {
        case SYS_RES_IRQ:
-               if (cpuid < 0 || cpuid >= ncpus) {
-                       kprintf("NEXUS cpuid %d:\n", cpuid);
-                       print_backtrace(-1);
-                       cpuid = 0; /* XXX */
-               }
+               KASSERT(cpuid >= 0 || cpuid < ncpus,
+                   ("nexus invalid cpuid %d:\n", cpuid));
                rm = &irq_rman[cpuid];
                break;