stacktrace: print_stack_trace() cleanup
PATCH 1/1 stacktrace: print_stack_trace() cleanup
From: Vegard Nossum <[email protected]>
Date: Fri, 13 Jun 2008 10:05:26 +0200
Subject: [PATCH] stacktrace: print_stack_trace() cleanup
This admittedly doesn't have too many benefits, these are the two I can think of: shorter code and better atomicity with regards to printk().
(It's been tested with the backtrace self-test code on i386 and x86_64.)
--- kernel/stacktrace.c | 9 +++------ 1 files changed, 3 insertions(+), 6 deletions(-)
kernel/stacktrace.c +3 -6
@@ -11,14 +11,11 @@void print_stack_trace (struct stack_trace *trace,int spaces) { -int i, j; +int i;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]); } }
Signature · 1 line
1.5.4.1
Ingo Molnar
AppliedQuoted 10 lines · Vegard Nossum
From: Vegard Nossum <[email protected]>
Date: Fri, 13 Jun 2008 10:05:26 +0200
Subject: [PATCH] stacktrace:print_stack_trace()cleanupThis admittedly doesn't have too many benefits, these are the two I can think of: shorter code and better atomicity with regards to
printk().(It's been tested with the backtrace self-test code on i386 and
x86_64.)
applied to tip/core/stacktrace - thanks Vegard. (I have hand-merged it as there were a few stacktrace changes in the stacktrace tree already, queued up for v2.6.27.)
Ingo