Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 8 Jun 2015 20:12:45 +0000 (UTC)
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r284167 - head/sys/i386/i386
Message-ID:  <201506082012.t58KCjZX023061@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dim
Date: Mon Jun  8 20:12:44 2015
New Revision: 284167
URL: https://svnweb.freebsd.org/changeset/base/284167

Log:
  Merge r283870 from amd64:
  
  Remove unneeded NULL checks in 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 for curproc->p_pid.
  
  Requested by:	jhb
  MFC after:	3 days

Modified:
  head/sys/i386/i386/trap.c

Modified: head/sys/i386/i386/trap.c
==============================================================================
--- head/sys/i386/i386/trap.c	Mon Jun  8 20:03:15 2015	(r284166)
+++ head/sys/i386/i386/trap.c	Mon Jun  8 20:12:44 2015	(r284167)
@@ -998,12 +998,8 @@ trap_fatal(frame, eva)
 	if (frame->tf_eflags & PSL_VM)
 		printf("vm86, ");
 	printf("IOPL = %d\n", (frame->tf_eflags & PSL_IOPL) >> 12);
-	printf("current process		= ");
-	if (curproc) {
-		printf("%lu (%s)\n", (u_long)curproc->p_pid, 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) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201506082012.t58KCjZX023061>