Commit e90a2857 authored by Heiko Carstens's avatar Heiko Carstens Committed by Martin Schwidefsky

[S390] Simplify stack trace.

sparse gives us a few of these:
stacktrace.c:69:38: warning: incorrect type in argument 2
                    (different signedness)
stacktrace.c:69:38:    expected unsigned int *skip

Just get rid of the 'skip' argument since it is contained in the
struct stack_trace that gets passed anyway.
Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 810cb5b3
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
#include <linux/kallsyms.h> #include <linux/kallsyms.h>
static unsigned long save_context_stack(struct stack_trace *trace, static unsigned long save_context_stack(struct stack_trace *trace,
unsigned int *skip,
unsigned long sp, unsigned long sp,
unsigned long low, unsigned long low,
unsigned long high) unsigned long high)
...@@ -28,10 +27,10 @@ static unsigned long save_context_stack(struct stack_trace *trace, ...@@ -28,10 +27,10 @@ static unsigned long save_context_stack(struct stack_trace *trace,
sf = (struct stack_frame *)sp; sf = (struct stack_frame *)sp;
while(1) { while(1) {
addr = sf->gprs[8] & PSW_ADDR_INSN; addr = sf->gprs[8] & PSW_ADDR_INSN;
if (!(*skip)) if (!trace->skip)
trace->entries[trace->nr_entries++] = addr; trace->entries[trace->nr_entries++] = addr;
else else
(*skip)--; trace->skip--;
if (trace->nr_entries >= trace->max_entries) if (trace->nr_entries >= trace->max_entries)
return sp; return sp;
low = sp; low = sp;
...@@ -48,10 +47,10 @@ static unsigned long save_context_stack(struct stack_trace *trace, ...@@ -48,10 +47,10 @@ static unsigned long save_context_stack(struct stack_trace *trace,
return sp; return sp;
regs = (struct pt_regs *)sp; regs = (struct pt_regs *)sp;
addr = regs->psw.addr & PSW_ADDR_INSN; addr = regs->psw.addr & PSW_ADDR_INSN;
if (!(*skip)) if (!trace->skip)
trace->entries[trace->nr_entries++] = addr; trace->entries[trace->nr_entries++] = addr;
else else
(*skip)--; trace->skip--;
if (trace->nr_entries >= trace->max_entries) if (trace->nr_entries >= trace->max_entries)
return sp; return sp;
low = sp; low = sp;
...@@ -65,20 +64,17 @@ void save_stack_trace(struct stack_trace *trace) ...@@ -65,20 +64,17 @@ void save_stack_trace(struct stack_trace *trace)
unsigned long orig_sp, new_sp; unsigned long orig_sp, new_sp;
orig_sp = sp & PSW_ADDR_INSN; orig_sp = sp & PSW_ADDR_INSN;
new_sp = save_context_stack(trace, orig_sp,
new_sp = save_context_stack(trace, &trace->skip, orig_sp, S390_lowcore.panic_stack - PAGE_SIZE,
S390_lowcore.panic_stack - PAGE_SIZE, S390_lowcore.panic_stack);
S390_lowcore.panic_stack);
if (new_sp != orig_sp) if (new_sp != orig_sp)
return; return;
new_sp = save_context_stack(trace, &trace->skip, new_sp, new_sp = save_context_stack(trace, new_sp,
S390_lowcore.async_stack - ASYNC_SIZE, S390_lowcore.async_stack - ASYNC_SIZE,
S390_lowcore.async_stack); S390_lowcore.async_stack);
if (new_sp != orig_sp) if (new_sp != orig_sp)
return; return;
save_context_stack(trace, new_sp,
save_context_stack(trace, &trace->skip, new_sp,
S390_lowcore.thread_info, S390_lowcore.thread_info,
S390_lowcore.thread_info + THREAD_SIZE); S390_lowcore.thread_info + THREAD_SIZE);
return;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment