lkml.org 
[lkml]   [2008]   [Jun]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
Subject[PATCH] stacktrace: print_stack_trace() cleanup
From
From: Vegard Nossum <vegard.nossum@gmail.com>
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.)

Cc: Arjan van de Ven <arjan@infradead.org>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Vegard Nossum <vegard.nossum@gmail.com>
---
kernel/stacktrace.c | 9 +++------
1 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/kernel/stacktrace.c b/kernel/stacktrace.c
index b71816e..2ee264b 100644
--- a/kernel/stacktrace.c
+++ b/kernel/stacktrace.c
@@ -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]);
}
}

--
1.5.4.1


\
 
 \ /
  Last update: 2008-06-13 11:03    [W:0.045 / U:2.732 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site