Skip to content

Commit

Permalink
x86: do not use print_symbol()
Browse files Browse the repository at this point in the history
print_symbol() is a very old API that has been obsoleted by %pS format
specifier in a normal printk() call.

Replace print_symbol() with a direct printk("%pS") call and correctly
handle continuous lines.

Link: http://lkml.kernel.org/r/[email protected]
To: Andrew Morton <[email protected]>
To: Russell King <[email protected]>
To: Catalin Marinas <[email protected]>
To: Mark Salter <[email protected]>
To: Tony Luck <[email protected]>
To: David Howells <[email protected]>
To: Yoshinori Sato <[email protected]>
To: Guan Xuetao <[email protected]>
To: Borislav Petkov <[email protected]>
To: Greg Kroah-Hartman <[email protected]>
To: Thomas Gleixner <[email protected]>
To: Peter Zijlstra <[email protected]>
To: Vineet Gupta <[email protected]>
To: Fengguang Wu <[email protected]>
Cc: Steven Rostedt <[email protected]>
Cc: Petr Mladek <[email protected]>
Cc: LKML <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Sergey Senozhatsky <[email protected]>
Acked-by: Borislav Petkov <[email protected]> # mce.c part
[[email protected]: updated commit message]
Signed-off-by: Petr Mladek <[email protected]>
  • Loading branch information
sergey-senozhatsky authored and pmladek committed Jan 5, 2018
1 parent cb38002 commit 7b60616
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
3 changes: 1 addition & 2 deletions arch/x86/kernel/cpu/mcheck/mce.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include <linux/capability.h>
#include <linux/miscdevice.h>
#include <linux/ratelimit.h>
#include <linux/kallsyms.h>
#include <linux/rcupdate.h>
#include <linux/kobject.h>
#include <linux/uaccess.h>
Expand Down Expand Up @@ -235,7 +234,7 @@ static void __print_mce(struct mce *m)
m->cs, m->ip);

if (m->cs == __KERNEL_CS)
print_symbol("{%s}", m->ip);
pr_cont("{%pS}", (void *)m->ip);
pr_cont("\n");
}

Expand Down
5 changes: 2 additions & 3 deletions arch/x86/mm/mmio-mod.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#include <linux/slab.h>
#include <linux/uaccess.h>
#include <linux/io.h>
#include <linux/kallsyms.h>
#include <asm/pgtable.h>
#include <linux/mmiotrace.h>
#include <asm/e820/api.h> /* for ISA_START_ADDRESS */
Expand Down Expand Up @@ -123,8 +122,8 @@ static void die_kmmio_nesting_error(struct pt_regs *regs, unsigned long addr)
pr_emerg("unexpected fault for address: 0x%08lx, last fault for address: 0x%08lx\n",
addr, my_reason->addr);
print_pte(addr);
print_symbol(KERN_EMERG "faulting IP is at %s\n", regs->ip);
print_symbol(KERN_EMERG "last faulting IP was at %s\n", my_reason->ip);
pr_emerg("faulting IP is at %pS\n", (void *)regs->ip);
pr_emerg("last faulting IP was at %pS\n", (void *)my_reason->ip);
#ifdef __i386__
pr_emerg("eax: %08lx ebx: %08lx ecx: %08lx edx: %08lx\n",
regs->ax, regs->bx, regs->cx, regs->dx);
Expand Down

0 comments on commit 7b60616

Please sign in to comment.