[TRIVIAL PATCH 05/26] avr32: Convert print_symbol to %pSR

From: Joe Perches
Date: Wed Dec 12 2012 - 13:20:12 EST


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@xxxxxxxxxxx>
---
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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/