From: Sepherosa Ziehau Date: Fri, 16 Dec 2011 03:08:03 +0000 (+0800) Subject: nexus/intr: Change the wrong cpuid backtrace to assertion X-Git-Tag: v3.0.0~372 X-Git-Url: http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/828d8bb00bd92773daeae970dce4078bf307b207 nexus/intr: Change the wrong cpuid backtrace to assertion --- diff --git a/sys/platform/pc32/i386/nexus.c b/sys/platform/pc32/i386/nexus.c index 0ae3d48..b321bbc 100644 --- a/sys/platform/pc32/i386/nexus.c +++ b/sys/platform/pc32/i386/nexus.c @@ -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; diff --git a/sys/platform/pc64/x86_64/nexus.c b/sys/platform/pc64/x86_64/nexus.c index 4fca4e3..2ab6deb 100644 --- a/sys/platform/pc64/x86_64/nexus.c +++ b/sys/platform/pc64/x86_64/nexus.c @@ -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;