summaryrefslogtreecommitdiffstats
path: root/arch/parisc/mm
diff options
context:
space:
mode:
authorHelge Deller <deller@gmx.de>2016-10-11 20:49:42 +0200
committerHelge Deller <deller@gmx.de>2016-10-11 20:52:47 +0200
commit0a862485f42af7df530b0b5f0e5ba8ffbb3a4a12 (patch)
tree15623a89fecbbfbedcc6854ee148ee8ff2efe171 /arch/parisc/mm
parente3b6a02816ebbda3acfde2f079446ba92c97e70b (diff)
downloadlinux-0a862485f42af7df530b0b5f0e5ba8ffbb3a4a12.tar.bz2
parisc: Show trap name in kernel crash
Show the real trap name when the kernel crashes. Signed-off-by: Helge Deller <deller@gmx.de>
Diffstat (limited to 'arch/parisc/mm')
-rw-r--r--arch/parisc/mm/fault.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/arch/parisc/mm/fault.c b/arch/parisc/mm/fault.c
index d64f1c854fdf..8ff9253930af 100644
--- a/arch/parisc/mm/fault.c
+++ b/arch/parisc/mm/fault.c
@@ -204,6 +204,16 @@ static const char * const trap_description[] = {
[28] "Unaligned data reference trap",
};
+const char *trap_name(unsigned long code)
+{
+ const char *t = NULL;
+
+ if (code < ARRAY_SIZE(trap_description))
+ t = trap_description[code];
+
+ return t ? t : "Unknown trap";
+}
+
/*
* Print out info about fatal segfaults, if the show_unhandled_signals
* sysctl is set:
@@ -213,8 +223,6 @@ show_signal_msg(struct pt_regs *regs, unsigned long code,
unsigned long address, struct task_struct *tsk,
struct vm_area_struct *vma)
{
- const char *trap_name = NULL;
-
if (!unhandled_signal(tsk, SIGSEGV))
return;
@@ -226,10 +234,7 @@ show_signal_msg(struct pt_regs *regs, unsigned long code,
tsk->comm, code, address);
print_vma_addr(KERN_CONT " in ", regs->iaoq[0]);
- if (code < ARRAY_SIZE(trap_description))
- trap_name = trap_description[code];
- pr_warn(KERN_CONT " trap #%lu: %s%c", code,
- trap_name ? trap_name : "unknown",
+ pr_cont(" trap #%lu: %s%c", code, trap_name(code),
vma ? ',':'\n');
if (vma)