Module Name: src
Committed By: riastradh
Date: Sun Mar 19 22:19:05 UTC 2017
Modified Files:
src/sys/arch/x86/x86: intr.c
Log Message:
#if DIAGNOSTIC panic ---> KASSERT
To generate a diff of this commit:
cvs rdiff -u -r1.96 -r1.97 src/sys/arch/x86/x86/intr.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/x86/x86/intr.c
diff -u src/sys/arch/x86/x86/intr.c:1.96 src/sys/arch/x86/x86/intr.c:1.97
--- src/sys/arch/x86/x86/intr.c:1.96 Tue Dec 6 15:09:04 2016
+++ src/sys/arch/x86/x86/intr.c Sun Mar 19 22:19:05 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: intr.c,v 1.96 2016/12/06 15:09:04 maxv Exp $ */
+/* $NetBSD: intr.c,v 1.97 2017/03/19 22:19:05 riastradh Exp $ */
/*-
* Copyright (c) 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -133,7 +133,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.96 2016/12/06 15:09:04 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.97 2017/03/19 22:19:05 riastradh Exp $");
#include "opt_intrdebug.h"
#include "opt_multiprocessor.h"
@@ -925,13 +925,10 @@ intr_establish_xname(int legacy_irq, str
const char *intrstr;
char intrstr_buf[INTRIDBUF];
-#ifdef DIAGNOSTIC
- if (legacy_irq != -1 && (legacy_irq < 0 || legacy_irq > 15))
- panic("%s: bad legacy IRQ value", __func__);
-
- if (legacy_irq == -1 && pic == &i8259_pic)
- panic("intr_establish: non-legacy IRQ on i8259");
-#endif
+ KASSERTMSG((legacy_irq == -1 || (0 <= legacy_irq && legacy_irq < 16)),
+ "bad legacy IRQ value: %d", legacy_irq);
+ KASSERTMSG((legacy_irq != -1 || pic != &i8259_pic),
+ "non-legacy IRQ on i8259");
ih = kmem_alloc(sizeof(*ih), KM_SLEEP);
if (ih == NULL) {