diff mbox

[13/13] arc: do not use __print_symbol()

Message ID 20171211125025.2270-14-sergey.senozhatsky@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Sergey Senozhatsky Dec. 11, 2017, 12:50 p.m. UTC
__print_symbol() uses extra stack space to sprintf() symbol
information and then to feed that buffer to printk()

  char buffer[KSYM_SYMBOL_LEN];

  sprint_symbol(buffer, address);
  printk(fmt, buffer);

Replace __print_symbol() with a direct printk("%pS") call.

Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: Vineet Gupta <vgupta@synopsys.com>
---
 arch/arc/kernel/stacktrace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Vineet Gupta Dec. 11, 2017, 4:28 p.m. UTC | #1
On 12/11/2017 04:53 AM, Sergey Senozhatsky wrote:
> __print_symbol() uses extra stack space to sprintf() symbol
> information and then to feed that buffer to printk()
>
>    char buffer[KSYM_SYMBOL_LEN];
>
>    sprint_symbol(buffer, address);
>    printk(fmt, buffer);
>
> Replace __print_symbol() with a direct printk("%pS") call.
>
> Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
> Cc: Vineet Gupta <vgupta@synopsys.com>

Applied to arc for-curr

Thx,
-Vineet

> ---
>   arch/arc/kernel/stacktrace.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arc/kernel/stacktrace.c b/arch/arc/kernel/stacktrace.c
> index 74315f302971..bf40e06f3fb8 100644
> --- a/arch/arc/kernel/stacktrace.c
> +++ b/arch/arc/kernel/stacktrace.c
> @@ -163,7 +163,7 @@ arc_unwind_core(struct task_struct *tsk, struct pt_regs *regs,
>    */
>   static int __print_sym(unsigned int address, void *unused)
>   {
> -	__print_symbol("  %s\n", address);
> +	printk("  %pS\n", (void *)address);
>   	return 0;
>   }
>   

--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Sergey Senozhatsky Dec. 12, 2017, 2:41 a.m. UTC | #2
On (12/11/17 08:28), Vineet Gupta wrote:
> On 12/11/2017 04:53 AM, Sergey Senozhatsky wrote:
> > __print_symbol() uses extra stack space to sprintf() symbol
> > information and then to feed that buffer to printk()
> > 
> >    char buffer[KSYM_SYMBOL_LEN];
> > 
> >    sprint_symbol(buffer, address);
> >    printk(fmt, buffer);
> > 
> > Replace __print_symbol() with a direct printk("%pS") call.
> > 
> > Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
> > Cc: Vineet Gupta <vgupta@synopsys.com>
> 
> Applied to arc for-curr

thanks.

	-ss
--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/arch/arc/kernel/stacktrace.c b/arch/arc/kernel/stacktrace.c
index 74315f302971..bf40e06f3fb8 100644
--- a/arch/arc/kernel/stacktrace.c
+++ b/arch/arc/kernel/stacktrace.c
@@ -163,7 +163,7 @@  arc_unwind_core(struct task_struct *tsk, struct pt_regs *regs,
  */
 static int __print_sym(unsigned int address, void *unused)
 {
-	__print_symbol("  %s\n", address);
+	printk("  %pS\n", (void *)address);
 	return 0;
 }