lkml.org 
[lkml]   [2012]   [Dec]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[TRIVIAL PATCH 05/26] avr32: Convert print_symbol to %pSR
Date
Use the new vsprintf extension to avoid any possible
message interleaving.

Remove a couple of #ifdef CONFIG_KALLSYMS branches
that are now the same code.

Signed-off-by: Joe Perches <joe@perches.com>
---
arch/avr32/kernel/process.c | 25 +++++++------------------
1 files changed, 7 insertions(+), 18 deletions(-)

diff --git a/arch/avr32/kernel/process.c b/arch/avr32/kernel/process.c
index fd78f58..7a56e86 100644
--- a/arch/avr32/kernel/process.c
+++ b/arch/avr32/kernel/process.c
@@ -148,12 +148,7 @@ static void show_trace_log_lvl(struct task_struct *tsk, unsigned long *sp,
unsigned long new_fp;

lr = *(unsigned long *)fp;
-#ifdef CONFIG_KALLSYMS
- printk("%s [<%08lx>] ", log_lvl, lr);
-#else
- printk(" [<%08lx>] ", lr);
-#endif
- print_symbol("%s\n", lr);
+ printk("%s [<%08lx>] %pSR\n", log_lvl, lr, (void *)lr);

new_fp = *(unsigned long *)(fp + 4);
if (new_fp <= fp)
@@ -172,14 +167,9 @@ static void show_trace_log_lvl(struct task_struct *tsk, unsigned long *sp,

while (!kstack_end(sp)) {
addr = *sp++;
- if (kernel_text_address(addr)) {
-#ifdef CONFIG_KALLSYMS
- printk("%s [<%08lx>] ", log_lvl, addr);
-#else
- printk(" [<%08lx>] ", addr);
-#endif
- print_symbol("%s\n", addr);
- }
+ if (kernel_text_address(addr))
+ printk("%s [<%08lx>] %pSR\n",
+ log_lvl, addr, (void *)addr);
}
printk("\n");
}
@@ -235,10 +225,9 @@ void show_regs_log_lvl(struct pt_regs *regs, const char *log_lvl)
if (!user_mode(regs)) {
sp = (unsigned long)regs + FRAME_SIZE_FULL;

- printk("%s", log_lvl);
- print_symbol("PC is at %s\n", instruction_pointer(regs));
- printk("%s", log_lvl);
- print_symbol("LR is at %s\n", lr);
+ printk("%sPC is at %pSR\n",
+ log_lvl, (void *)instruction_pointer(regs));
+ printk("%sLR is at %pSR\n", log_lvl, (void *)lr);
}

printk("%spc : [<%08lx>] lr : [<%08lx>] %s\n"
--
1.7.8.112.g3fd21


\
 
 \ /
  Last update: 2012-12-12 19:41    [W:0.407 / U:0.596 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site