Use helpers to obtain task pid in printks (arch code)
[deliverable/linux.git] / arch / x86 / kernel / traps_32.c
index 83a9bbbbe38f6007525c9245f5e98fec86d36c70..1e9d57256eb11ff9061d3713f3844ce1fa8634aa 100644 (file)
@@ -316,7 +316,7 @@ void show_registers(struct pt_regs *regs)
        printk(KERN_EMERG "ds: %04x   es: %04x   fs: %04x  gs: %04x  ss: %04x\n",
               regs->xds & 0xffff, regs->xes & 0xffff, regs->xfs & 0xffff, gs, ss);
        printk(KERN_EMERG "Process %.*s (pid: %d, ti=%p task=%p task.ti=%p)",
-               TASK_COMM_LEN, current->comm, current->pid,
+               TASK_COMM_LEN, current->comm, task_pid_nr(current),
                current_thread_info(), current, task_thread_info(current));
        /*
         * When in-kernel, we also print out the stack and code at the
@@ -398,31 +398,24 @@ void die(const char * str, struct pt_regs * regs, long err)
                local_save_flags(flags);
 
        if (++die.lock_owner_depth < 3) {
-               int nl = 0;
                unsigned long esp;
                unsigned short ss;
 
                report_bug(regs->eip, regs);
 
-               printk(KERN_EMERG "%s: %04lx [#%d]\n", str, err & 0xffff, ++die_counter);
+               printk(KERN_EMERG "%s: %04lx [#%d] ", str, err & 0xffff,
+                      ++die_counter);
 #ifdef CONFIG_PREEMPT
-               printk(KERN_EMERG "PREEMPT ");
-               nl = 1;
+               printk("PREEMPT ");
 #endif
 #ifdef CONFIG_SMP
-               if (!nl)
-                       printk(KERN_EMERG);
                printk("SMP ");
-               nl = 1;
 #endif
 #ifdef CONFIG_DEBUG_PAGEALLOC
-               if (!nl)
-                       printk(KERN_EMERG);
                printk("DEBUG_PAGEALLOC");
-               nl = 1;
 #endif
-               if (nl)
-                       printk("\n");
+               printk("\n");
+
                if (notify_die(DIE_OOPS, str, regs, err,
                                        current->thread.trap_no, SIGSEGV) !=
                                NOTIFY_STOP) {
@@ -629,7 +622,7 @@ fastcall void __kprobes do_general_protection(struct pt_regs * regs,
            printk_ratelimit())
                printk(KERN_INFO
                    "%s[%d] general protection eip:%lx esp:%lx error:%lx\n",
-                   current->comm, current->pid,
+                   current->comm, task_pid_nr(current),
                    regs->eip, regs->esp, error_code);
 
        force_sig(SIGSEGV, current);
This page took 0.025284 seconds and 5 git commands to generate.