From: Vegard Nossum Date: Fri, 13 Jun 2008 09:00:14 +0000 (+0200) Subject: stacktrace: print_stack_trace() cleanup X-Git-Tag: v2.6.27-rc1~1085^2~6 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=a5a242dceed5d1c74fe46088762a9e4312c2d000;p=linux-2.6-omap-h63xx.git stacktrace: print_stack_trace() cleanup - shorter code and better atomicity with regards to printk(). (It's been tested with the backtrace self-test code on i386 and x86_64.) Cc: Arjan van de Ven Signed-off-by: Vegard Nossum Signed-off-by: Ingo Molnar --- diff --git a/kernel/stacktrace.c b/kernel/stacktrace.c index 0914d0cbc83..7eaea9d02a5 100644 --- a/kernel/stacktrace.c +++ b/kernel/stacktrace.c @@ -11,17 +11,14 @@ void print_stack_trace(struct stack_trace *trace, int spaces) { - int i, j; + int i; if (WARN_ON(!trace->entries)) return; for (i = 0; i < trace->nr_entries; i++) { - unsigned long ip = trace->entries[i]; - - for (j = 0; j < spaces + 1; j++) - printk(" "); - print_ip_sym(ip); + printk("%*c", 1 + spaces, ' '); + print_ip_sym(trace->entries[i]); } }