aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2015-06-01 06:50:39 +0000
committerDimitry Andric <dim@FreeBSD.org>2015-06-01 06:50:39 +0000
commit38954a1d1c8ec6aa248679718a2a85c6d6ffe029 (patch)
treecdcbccc49a968f860ca7708cd0a3b6e46ef4f95f /sys
parent9310c7d568363767c06ec1aa2255c313e70f54bc (diff)
downloadsrc-38954a1d1c8ec6aa248679718a2a85c6d6ffe029.tar.gz
src-38954a1d1c8ec6aa248679718a2a85c6d6ffe029.zip
Remove unneeded NULL checks in amd64's trap_fatal().
Since td_name is an array member of struct thread, it can never be NULL, so the check can be removed. In addition, curproc can never be NULL, so remove the if statement, and splice the two printfs() together. While here, remove the u_long cast, and use the correct printf format specifier curproc->p_pid. Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D2695
Notes
Notes: svn path=/head/; revision=283870
Diffstat (limited to 'sys')
-rw-r--r--sys/amd64/amd64/trap.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/sys/amd64/amd64/trap.c b/sys/amd64/amd64/trap.c
index 193d20753e1d..08363756065b 100644
--- a/sys/amd64/amd64/trap.c
+++ b/sys/amd64/amd64/trap.c
@@ -840,14 +840,8 @@ trap_fatal(frame, eva)
if (frame->tf_rflags & PSL_RF)
printf("resume, ");
printf("IOPL = %ld\n", (frame->tf_rflags & PSL_IOPL) >> 12);
- printf("current process = ");
- if (curproc) {
- printf("%lu (%s)\n",
- (u_long)curproc->p_pid, curthread->td_name ?
- curthread->td_name : "");
- } else {
- printf("Idle\n");
- }
+ printf("current process = %d (%s)\n",
+ curproc->p_pid, curthread->td_name);
#ifdef KDB
if (debugger_on_panic || kdb_active)