Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/xen/xen #if DIAGNOSTIC panic ---> KASSERTMSG
details: https://anonhg.NetBSD.org/src/rev/83229f66c6f7
branches: trunk
changeset: 357444:83229f66c6f7
user: riastradh <riastradh%NetBSD.org@localhost>
date: Sat Nov 11 08:22:08 2017 +0000
description:
#if DIAGNOSTIC panic ---> KASSERTMSG
diffstat:
sys/arch/xen/xen/evtchn.c | 28 +++++++++-------------------
1 files changed, 9 insertions(+), 19 deletions(-)
diffs (63 lines):
diff -r 597fe7447a33 -r 83229f66c6f7 sys/arch/xen/xen/evtchn.c
--- a/sys/arch/xen/xen/evtchn.c Sat Nov 11 07:52:41 2017 +0000
+++ b/sys/arch/xen/xen/evtchn.c Sat Nov 11 08:22:08 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: evtchn.c,v 1.75 2017/11/10 19:24:17 riastradh Exp $ */
+/* $NetBSD: evtchn.c,v 1.76 2017/11/11 08:22:08 riastradh Exp $ */
/*
* Copyright (c) 2006 Manuel Bouyer.
@@ -54,7 +54,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: evtchn.c,v 1.75 2017/11/10 19:24:17 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: evtchn.c,v 1.76 2017/11/11 08:22:08 riastradh Exp $");
#include "opt_xen.h"
#include "isa.h"
@@ -314,12 +314,9 @@
int i;
uint32_t iplbit;
-#ifdef DIAGNOSTIC
- if (evtch >= NR_EVENT_CHANNELS) {
- printf("event number %d > NR_IRQS\n", evtch);
- panic("evtchn_do_event");
- }
-#endif
+ KASSERTMSG(evtch >= 0, "negative evtch: %d", evtch);
+ KASSERTMSG(evtch < NR_EVENT_CHANNELS,
+ "evtch number %d > NR_EVENT_CHANNELS", evtch);
#ifdef IRQ_DEBUG
if (evtch == IRQ_DEBUG)
@@ -337,11 +334,7 @@
return 0;
}
-#ifdef DIAGNOSTIC
- if (evtsource[evtch] == NULL) {
- panic("evtchn_do_event: unknown event");
- }
-#endif
+ KASSERTMSG(evtsource[evtch] != NULL, "unknown event %d", evtch);
ci->ci_data.cpu_nintr++;
evtsource[evtch]->ev_evcnt.ev_count++;
ilevel = ci->ci_ilevel;
@@ -851,12 +844,9 @@
printf("event_set_handler IRQ %d handler %p\n", evtch, func);
#endif
-#ifdef DIAGNOSTIC
- if (evtch >= NR_EVENT_CHANNELS) {
- printf("evtch number %d > NR_EVENT_CHANNELS\n", evtch);
- panic("event_set_handler");
- }
-#endif
+ KASSERTMSG(evtch >= 0, "negative evtch: %d", evtch);
+ KASSERTMSG(evtch < NR_EVENT_CHANNELS,
+ "evtch number %d > NR_EVENT_CHANNELS", evtch);
#if 0
printf("event_set_handler evtch %d handler %p level %d\n", evtch,
Home |
Main Index |
Thread Index |
Old Index