Index: sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c =================================================================== --- sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c +++ sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c @@ -7338,7 +7338,7 @@ volatile uint16_t *flags; hrtime_t now; - if (panicstr != NULL) + if (KERNEL_PANICKED()) return; #ifdef illumos @@ -7369,7 +7369,7 @@ #ifdef illumos if (panic_quiesce) { #else - if (panicstr != NULL) { + if (KERNEL_PANICKED()) { #endif /* * We don't trace anything if we're panicking. Index: sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c =================================================================== --- sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c +++ sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c @@ -718,7 +718,7 @@ * always uses sc->hs_chan, then we must send to that channel or a poll * timeout will occur. */ - if (panicstr) { + if (KERNEL_PANICKED()) { outgoing_channel = sc->hs_chan; } else { outgoing_channel = sc->hs_sel_chan[ch_sel]; Index: sys/dev/vt/vt_core.c =================================================================== --- sys/dev/vt/vt_core.c +++ sys/dev/vt/vt_core.c @@ -593,7 +593,8 @@ * switch to console mode when panicking, making sure the panic * is readable (even when a GUI was using ttyv0). */ - if ((kdb_active || panicstr) && vd->vd_driver->vd_postswitch) + if ((kdb_active || KERNEL_PANICKED()) && + vd->vd_driver->vd_postswitch) vd->vd_driver->vd_postswitch(vd); VT_UNLOCK(vd); return (0); Index: sys/kern/kern_shutdown.c =================================================================== --- sys/kern/kern_shutdown.c +++ sys/kern/kern_shutdown.c @@ -835,7 +835,7 @@ * If we are suppressing secondary panics, log the warning but do not * re-enter panic/kdb. */ - if (panicstr != NULL && kassert_suppress_in_panic) { + if (KERNEL_PANICKED() && kassert_suppress_in_panic) { if (kassert_do_log) { printf("KASSERT failed: %s\n", buf); #ifdef KDB @@ -932,7 +932,7 @@ bootopt = RB_AUTOBOOT; newpanic = 0; - if (panicstr) + if (KERNEL_PANICKED()) bootopt |= RB_NOSYNC; else { bootopt |= RB_DUMP; @@ -1016,7 +1016,7 @@ struct proc *p; int error; - if (panicstr) + if (KERNEL_PANICKED()) return; p = (struct proc *)arg; @@ -1036,7 +1036,7 @@ struct thread *td; int error; - if (panicstr) + if (KERNEL_PANICKED()) return; td = (struct thread *)arg; Index: sys/kern/subr_asan.c =================================================================== --- sys/kern/subr_asan.c +++ sys/kern/subr_asan.c @@ -387,7 +387,7 @@ return; if (__predict_false(kasan_md_unsupported(addr))) return; - if (__predict_false(panicstr != NULL)) + if (KERNEL_PANICKED()) return; if (__builtin_constant_p(size)) { Index: sys/kern/subr_msan.c =================================================================== --- sys/kern/subr_msan.c +++ sys/kern/subr_msan.c @@ -178,7 +178,7 @@ char buf[128]; int type; - if (__predict_false(panicstr != NULL || kdb_active || kmsan_reporting)) + if (__predict_false(KERNEL_PANICKED() || kdb_active || kmsan_reporting)) return; kmsan_reporting = true; @@ -234,7 +234,7 @@ long foff; int type; - if (__predict_false(panicstr != NULL || kdb_active || kmsan_reporting)) + if (__predict_false(KERNEL_PANICKED() || kdb_active || kmsan_reporting)) return; kmsan_reporting = true;