Commit a454ab31 authored by Ingo Molnar's avatar Ingo Molnar

x86, mm: fault.c, use printk_once() in is_errata93()

Andrew pointed out that the 'once' variable has a needlessly
function-global scope. We can in fact eliminate it completely,
via the use of printk_once().

[ Impact: cleanup ]
Reported-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 9518e0e4
...@@ -514,8 +514,6 @@ static void dump_pagetable(unsigned long address) ...@@ -514,8 +514,6 @@ static void dump_pagetable(unsigned long address)
static int is_errata93(struct pt_regs *regs, unsigned long address) static int is_errata93(struct pt_regs *regs, unsigned long address)
{ {
#ifdef CONFIG_X86_64 #ifdef CONFIG_X86_64
static int once;
if (address != regs->ip) if (address != regs->ip)
return 0; return 0;
...@@ -525,10 +523,7 @@ static int is_errata93(struct pt_regs *regs, unsigned long address) ...@@ -525,10 +523,7 @@ static int is_errata93(struct pt_regs *regs, unsigned long address)
address |= 0xffffffffUL << 32; address |= 0xffffffffUL << 32;
if ((address >= (u64)_stext && address <= (u64)_etext) || if ((address >= (u64)_stext && address <= (u64)_etext) ||
(address >= MODULES_VADDR && address <= MODULES_END)) { (address >= MODULES_VADDR && address <= MODULES_END)) {
if (!once) { printk_once(errata93_warning);
printk(errata93_warning);
once = 1;
}
regs->ip = address; regs->ip = address;
return 1; return 1;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment